So as I was working through testing various characters. I noticed all the basic movements the character controller tries to preform on a character, and I tried to make a default character Animation Script file that I could apply to all characters.
I also created a default animationset.dat file as well. I also created a full set of .asq files that have it all linked. I will post the .AAS file here and the .dat here and then try zipping up and attaching the full set.
Here is the .AAS file
! 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
BaseMode = Normal, Combat
variable BasePosture = Idle, Turning, Moving, Dead, Prone, Alive, Stunned, Paralyzed
variable OverridePosture = None, Falling, Landing, Jumping, Knockback, Dead, Knockdown
variable IdleType = Normal, Dead, Paralyzed, Stunned, Ranger, Knockdown
// General Movement Input
variable CurrentMotion = CombatMove, Idle, TurningLeft, TurningRight, Forward, Backingup
variable MoveType = Normal, Swim
MoveDirection = Forward, Backward, SideStepLeft, SideStepRight
TurnDirection = None, Right, Left
TurnAmount = None, T45Degrees, T90Degrees, T135Degrees, T180Degrees
variable AlreadyTurning = True, False
// Combat Inputs
variable Attacking = None, Ranger2x4, RangerBlossom, RangerKneelFire, RangerMelee, RangerQuadstorm, RangerSlasher, RangerTorque, RangerUppercut, SpellMelee, SpellUppercut, SpellSlasher, SpellBladeSpinner, SpellBlast, SpellBlastStaff, SpellTorque, SpellRaiser, SpellStaff360Slam, SwordMelee, Sword5thDegree, SwordCombo, SwordFlipSlash, SwordJuggleSlash, SwordStinger, SwordUppercut
variable ImpactHit = None, Blam, Dodge, Block, Parry
WeaponHand = Closed, Opened
variable WeaponType = None, Sword, Bow
// Special Inputs to play a specific animation
variable Special = None, HeartpullA, HeartpullB
// Used in various actions to control logic flow and assist in code reuse
variable AnimationSettingsGroup = None, Primary, Secondary, Tertiary
}
transition BasePosture
{
from Idle to Dead = trDie
from Turning to Dead = trDie
from Moving to Dead = trDie
from Dead to Idle = trBackToDead
from Dead to Turning = trBackToDead
from Dead to Moving = trBackToDead
from Dead to Paralyzed = trBackToDead
from Dead to Stunned = trBackToDead
from Dead to Alive = trLiveAgain
from Idle to Paralyzed = trParalyze
from Turning to Paralyzed = trParalyze
from Moving to Paralyzed = trParalyze
from Stunned to Paralyzed = trParalyze
from Idle to Stunned = trStun
from Turning to Stunned = trStun
from Moving to Stunned = trStun
from Paralyzed to Idle = trIdle
from Stunned to Idle = trIdle
from Moving to Idle = trIdle
from Turning to Idle = trIdle
}
transition OverridePosture {
from None to Jumping = trDoJump
from Jumping to Falling = trDoFall
from None to Knockdown = trKnockdown
from Knockdown to None = trStand
from Dead to Knockdown = trBackToDead
from Knockdown to Dead = trDie
}
transition MoveType {
from Normal to Swim = EnterSwim
from Swim to Normal = LeaveSwim
}
action EnterSwim
{
force(1) AnimAllBody{
when BasePosture {
is Idle:
anim "swimidle"
align false
blend 0.1
hold 0 seconds
looping true
change AlreadyTurning to False
change CurrentMotion to Idle
is Moving:
when MoveDirection {
is Forward:
anim "swimforward"
blend 0.1
hold 0 seconds
change CurrentMotion to Forward
is Backward:
anim "swimbackwards"
blend 0.1
hold 0 seconds
change CurrentMotion to Backingup
}
}
}
}
action LeaveSwim
{
force(1) AnimAllBody{
when BasePosture {
is Idle:
anim "idle"
align false
blend 0.3
hold 0 seconds
looping true
change AlreadyTurning to False
change CurrentMotion to Idle
is Moving:
when MoveDirection {
is Forward:
anim "walkrun"
blend 0.3
hold 0 seconds
change CurrentMotion to Forward
is Backward:
anim "backingup"
blend 0.3
hold 0 seconds
change CurrentMotion to Backingup
}
}
}
}
action trDie
{
force(1) AnimAllBody
{
if(OverridePosture != Dead) {
anim "death"
hold 1
blend 0.1
align false
looping false
change AlreadyTurning to False
change CurrentMotion to Idle
change Attacking to None
change IdleType to Dead
change OverridePosture to Dead
}
}
}
action trLiveAgain
{
change OverridePosture to None
change BasePosture to Idle
change IdleType to Normal
}
action trBackToDead
{
change IdleType to Dead
change OverridePosture to Dead
change BasePosture to Dead
}
action trIdle
{
force(1) AnimAllBody
{
change IdleType to Normal
call fnIdle
}
}
action trStun
{
force(1) AnimAllBody
{
anim "stunned"
hold 1
blend 0.25
align false
looping true
change AlreadyTurning to False
change CurrentMotion to Idle
change Attacking to None
}
}
action trParalyze
{
force(1) AnimAllBody
{
anim "paralyzed"
hold 1
blend 0.25
align false
looping true
change AlreadyTurning to False
change CurrentMotion to Idle
change Attacking to None
change IdleType to Paralyzed
}
}
action trDoJump
{
force(1) AnimAllBody
{
if(BasePosture != Dead) {
anim "jump"
blend .025
hold 1
looping false
FreezeLastSequence true
change OverridePosture to Falling
}
}
}
action trDoFall
{
force(1) AnimAllBody
{
if(BasePosture != Dead) {
anim "falling"
blend .1
hold .1
looping true
FreezeLastSequence true
}
}
}
action trStand
{
force(2) AnimAllBody
{
when IdleType {
is Knockdown:
anim "standup" // Just a placeholder till we get standup
DEFAULT:
// do nothing
}
hold 0.9
blend 0.25
align false
looping false
change IdleType to Normal
change AlreadyTurning to False
change CurrentMotion to Idle
change Attacking to None
}
}
action trKnockdown
{
force(1) AnimAllBody
{
anim "knockdown"
hold 1
blend 0.25
align false
looping false
change AlreadyTurning to False
change CurrentMotion to Idle
change Attacking to None
change IdleType to Knockdown
}
}
action Default
{
call fnAnimAllBodyChannel
}
action fnAnimAllBodyChannel {
// Setting the channel and its priority is handled by the individual funciton calls
call fnOverridePosture
when BaseMode {
is Normal:
call fnBaseBehaviors // Basic Postures, Idle, Moving, Turning etc
is Combat:
call fnEvalCombatInputs // Basic Behaviors, idle, move, turn
if (Attacking != None) {
call fnAttackBehaviors
}
call fnBaseBehaviors
DEFAULT:
call fnBaseBehaviors
}
}
action fnEvalCombatInputs {
if((BasePosture = Prone) OR (BasePosture = Dead) OR (BasePosture = Moving) OR (BasePosture = Turning)) {
//change Attacking to None
//change Special to None
}
if(Attacking != None) {
change CurrentMotion to CombatMove
change IdleType to Normal // This cancels special idles like aiming
change ImpactHit to None // Cancel our impact if we are attacking
}
}
action fnAttackBehaviors {
force(1) AnimAllBody
{
call fnEvalAttackInputs
change AnimationSettingsGroup to Primary
when Attacking {
is None:
// pass through
DEFAULT:
anim str("", Attacking )
change MoveType to Normal
change ImpactHit to None
}
when AnimationSettingsGroup {
is None:
return
is Primary:
blend 0.1
hold 1
looping false
change Attacking to None
stop
}
}
}
action fnEvalAttackInputs {
return // nothing to do yet
when Attacking {
DEFAULT:
}
}
action fnBaseBehaviors {
when BaseMode {
DEFAULT:
when BasePosture {
is Turning:
return
is Moving:
call fnMovement
is Dead:
call fnDead
DEFAULT:
call fnIdle
}
}
}
action fnEvaluateIdleInputs {
change AlreadyTurning to False
change CurrentMotion to Idle
}
action fnDead {
set(1) AnimAllBody
{
when IdleType {
is Dead:
anim "death"
DEFAULT:
when BaseMode {
is Combat:
anim "death"
DEFAULT:
anim "death"
}
}
}
}
action fnIdle {
set(1) AnimAllBody
{
call fnEvaluateIdleInputs
change AnimationSettingsGroup to Primary // Groups of Align/Blend/Hold/Looping settings that are used in common
// by many animations
when IdleType {
is Dead:
anim "death"
align false
blend 0
hold 0
looping true
stop
is Paralyzed:
anim "paralzyed"
is Knockdown:
anim "knockdown"
DEFAULT:
when BaseMode {
is Combat:
when WeaponType {
is Bow:
return
DEFAULT:
anim "idle"
}
change AnimationSettingsGroup to Secondary
DEFAULT:
when WeaponType {
is Bow:
return
DEFAULT:
anim "idle"
}
}
align true
blend 0
hold 0
looping true
}
when AnimationSettingsGroup {
is None:
return
is Primary:
align false
blend 0.5
hold 0.5 seconds recycle
looping true
stop
is Secondary:
align false
blend 0.25
hold 0.25 seconds recycle
looping true
change AlreadyTurning to False
change CurrentMotion to Idle
stop
is Tertiary:
looping true
hold 1
align true
blend 0
stop
}
}
}
// Movement behavior, translates inputs into the appropriate move animation
action fnMovement {
set(1) AnimAllBody
{
when MoveDirection {
is Forward:
when MoveType {
is Normal:
anim "walkrun"
is Swim:
anim "swimforward"
DEFAULT:
when BaseMode {
DEFAULT:
anim "walkrun"
}
}
blend 0
hold 0 seconds
change CurrentMotion to Forward
is Backward:
when MoveType {
is Normal:
anim "backingup"
is Swim:
anim "swimbackwards"
DEFAULT:
when BaseMode {
DEFAULT:
anim "backingup"
}
}
blend 0.25
hold 0.25 seconds
change CurrentMotion to Backingup
}
align false
looping true
change AlreadyTurning to False
}
}
action fnOverridePosture {
set(1) AnimAllBody
{
if(BasePosture != Dead) {
when OverridePosture {
is Jumping:
anim "jump"
blend .025
hold 1
looping false
FreezeLastSequence true
stop
is Falling:
anim "falling"
blend .1
hold .1
looping true
FreezeLastSequence true
stop
is Landing:
anim "landing"
blend .1
hold .5
looping false
FreezeLastSequence false
change OverridePosture to None
stop
is Knockback:
anim "knockback"
blend .1
hold .5
looping false
change OverridePosture to None
stop
is Knockdown:
anim "knockdown"
blend 0.3
hold 0.1
looping true
stop
}
}
}
}