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

Author Topic: Basic .aas file for character animation  (Read 1504 times)

ToY-Krun

  • General Accounts
  • *
  • Posts: 677
  • Support Volunteer
    • View Profile
Basic .aas file for character animation
« on: Mar 15, 16, 12:41:11 PM »

EDIT NOTE: I went through and formatted the code properly so it should be easier to read/follow now :)


this is a very basic copy for a .aas file to get you started.

The commented sections I've left for reference and example.

The inputs included are used by the Engine by default and so whether you use them
or not, I've left them.

As you learn more about the inputs and animations you can add/remove them as you like.

Copy this and paste it into your .aas script REPLACING what you have.
OR use it as reference to create your own script.

The .aas script can be quite complex or very simple depending on your character design
and animations used.

NOTE: you will need to either name your animations as listed in the script below OR change
the names in the script to match your own.

For example, if you use "walk" or "walkrun" as your forward movement, then in the script
below, look for "anim = "Forward"" and change "Forward" to "walk" or "walkrun". Get the idea?

NOTE2:
the commented OverridePostures which are commented out, are recognized by the engine by default,
to use them simply create animations for them and uncomment the sections for that animation.
For example, create a "Jump" animation, upload it, and uncomment the OverridePosture code for "Jumping"
change the name of the animation used "anim = "jump"" IF your jump animation is named differently.

That should get you moving!  Then you can tweak it as you like to get your animations blended/activated
as you need.


Quote
! biped control
!
!this is a super basic template to start with
!add more stuff and make it do something neat!!


channels
{
  AnimAllBody
}

inputs
{
  // Basic inputs used by the HeroEngine_ACCController
  BaseMode = Normal, Combat
  BasePosture = Idle, Turning, Moving, Dead 
  MoveType = Normal
  IdleType = Normal
  MoveDirection = Forward, Backward
  TurnDirection = None, Right, Left
  TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
  variable OverridePosture = None, Jumping, Falling, Dead, Knockback, ResurrectTarget, Landing
  variable AlreadyTurning =  True, False
  variable CurrentMotion = Idle, TurningLeft, TurningRight, Forward, Backward
}

action Default
{
   set(1) AnimAllBody
   {
      when OverridePosture {
   
         is Jumping:
            //anim "jump"
            //blend .025
            //hold 1
            //looping false
            //FreezeLastSequence true
            change OverridePosture to Falling
            //stop
         is Falling:
            //anim "fall_loop"
            //blend .025
            //hold 1
            //looping false
            //FreezeLastSequence true
            Change OverridePosture to Landing
            //stop
         is Landing:
            //anim "fall_landing"
            //blend .1
            //hold .5
            //looping false
            change OverridePosture to None
            //stop
      }
      when BasePosture {
         is Idle:
         when MoveType {
            is Swim:
               //anim "swim_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 Right:
                  when TurnAmount {
                     is T45Degrees:
                        anim "T45Right"
                     is T90Degrees:
                        anim "T90Right"
                     is T135Degrees:
                        anim "T135Right"
                     is T180Degrees:
                        anim "T180Left"
                  }
                  change CurrentMotion to TurningRight
               is Left:
                  when TurnAmount {
                     is T45Degrees:
                        anim "T45Left"
                     is T90Degrees:
                        anim "T90Left"
                     is T135Degrees:
                        anim "T135Left"
                     is T180Degrees:
                        anim "T180Left"
                  }
                  change CurrentMotion to TurningLeft
            }
            hold 1.0
            if (AlreadyTurning = True) {
               align True   
            }
            else {   
               blend 0.1
               align False
            }
            looping False
            change AlreadyTurning to True
         is Dead:
            //anim "dead"
         is Moving:
            when MoveDirection {
               is Forward:
                  when MoveType {
                  is Swim:
                     //anim "swim"
                  DEFAULT:
                     anim "Forward"
                  }
                  blend 0
                  hold 0 seconds
                  change CurrentMotion to Forward
               is Backward:
                  when MoveType {
                     is Swim:
                        //anim "swim"
                     DEFAULT:
                        anim "Backward"
                  }
                  blend 0.25
                  hold 0.25 seconds
                  change CurrentMotion to Backward
            }
            looping True
            change AlreadyTurning to False
      }
   }
}
« Last Edit: Mar 15, 16, 02:38:54 PM by ToY-Krun »
Logged