HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Character Run Animation Not Working  (Read 2765 times)

shockdot

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Character Run Animation Not Working
« on: Jun 21, 13, 02:36:58 PM »

I'm trying to script my characters run animation, but it's not working. When i click the W or forward arrow key the character does not respond what so ever...

The animation works fine in the HeroEngine Viewer, and the same .aas script has scripting for jumping, which works. So it's just an issue with moving.

Here's my BasicHM.aas file
Code: [Select]
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  animation = Idle
 
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Prone, Dead, Sitting, Kneeling, Alive, Climbing
  OverridePosture = None, Jumping, Landing, Falling, Dead, Knockback, ResurrectTarget
  MoveType = Normal, Swim
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable AlreadyTurning =  true, false
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backingup, CombatMove
}

transition OverridePosture
{
from None to Jumping = DoJump
}

action DoJump
{
anim "Jump"
blend 1
hold 1
looping false
FreezeLastSequence true
}

action Default
{
set(1) AnimAllBody
{
when OverridePosture
{
is Jumping:
anim "Jump"
blend 1
hold 1
looping false
FreezeLastSequence true
stop
is Falling:
anim "Jump"
blend 1
hold 1
looping false
FreezeLastSequence true
stop
is Landing:
anim "idle"
blend .1
hold .5
looping false
stop
}

when BaseMode
{
is Normal:
when BasePosture
{
is Idle:
when MoveType
{
is Normal:
anim "idle"
DEFAULT:
anim "idle"
}
align False
blend 0.25
hold 0.25 seconds recycle
looping True
change AlreadyTurning to false
change CurrentMotion to Idle
is Turning:
when TurnDirection
{
is Left:
anim "run"
change CurrentMotion to TurningLeft
is Right:
anim "run"
change CurrentMotion to TurningRight
}
hold 1.0
if (AlreadyTurning = true)
{
align True   
}
else
{   
blend 0.1
align False
}
looping False
change AlreadyTurning to true
is Moving:
when MoveDirection
{
is Forward:
when MoveType
{
is Normal:
anim "run"
DEFAULT:
anim "run"
}
blend 0 
hold 0 seconds
change CurrentMotion to Forward
is Backward:
when MoveType
{
is Normal:
anim "run"
DEFAULT:
anim "run"
}
blend 0 
hold 0 seconds
change CurrentMotion to Backingup
}
looping True
change AlreadyTurning to false
}
}
}
}

Here's my run.asq file
Code: [Select]
!
! Animation Sequence Spec: run
! 06/21/2013 14:36
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=Run.hgm
    .InitialSpeed=1
    .InitialLoop=True
    .InitialAlign=False
    .Preload=False

Here's my ANIMATIONSET.dat file
Code: [Select]
!
!
Version=1
[SEQUENCES]
  idle
  Jump
  run
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Character Run Animation Not Working
« Reply #1 on: Jun 21, 13, 03:16:05 PM »

problem, is the default controller is never in normal mode, it's always in combat mode by default.

which you don't cover. If you are possessing a mob same things always is in combat mode.
So you have to override the base controller mechanics or program to use combat basemode.
Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

shockdot

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Re: Character Run Animation Not Working
« Reply #2 on: Jun 21, 13, 08:19:07 PM »

Ah, I didn't know this... All the hero engine examples I've seen used normal. Ill give this a shot when I get home from
Work! Thanks.
Logged

shockdot

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Re: Character Run Animation Not Working
« Reply #3 on: Jun 22, 13, 10:43:10 AM »

problem, is the default controller is never in normal mode, it's always in combat mode by default.

which you don't cover. If you are possessing a mob same things always is in combat mode.
So you have to override the base controller mechanics or program to use combat basemode.

Thanks that worked, but character doesn't move from it's possition. I'm guessing I have to code this part, which is odd if that's the case since jump works....

Something else I noticed for some reason the animation moves from left to right while it's running... Which it shouldn't, it doesn't in 3ds max... EDIT: After posting this I remembered reading about the SRB. The animation I had was causing the root bone to rotate via the z axis, and move via the x and y axis.. Which it should only be moving via the y axis. The left and right moving problem is solved ;)...

Now I just need to work on the character movement.
« Last Edit: Jun 22, 13, 11:31:21 AM by shockdot »
Logged