1 #insert scripts\shared\shared.gsh;
3 #insert scripts\shared\ai\systems\animation_state_machine.gsh;
4 #insert scripts\shared\ai\systems\blackboard.gsh;
5 #insert scripts\shared\ai\utility.gsh;
9 #define IS_NULL(variable) (IsInt(variable) && variable == 0)
11 #namespace AnimationStateNetwork;
16 level._AnimationMocomps = [];
21 function RunAnimationMocomp( mocompName, mocompStatus, asmEntity, mocompAnim, mocompAnimBlendOutTime, mocompDuration )
23 Assert( ( mocompStatus >= 0 && mocompStatus <= 2 ),
"ASM - Unsupported MocompStatus " + mocompStatus +
" for RunAnimationMocomp." );
25 Assert( IsDefined( level._AnimationMocomps[mocompName] ),
"BT - RegisterAnimationMocomps with " + mocompName +
" does not exists." );
27 if( mocompStatus == 0 )
29 else if( mocompStatus == 1 )
34 animationMocompResult = asmEntity [[level._AnimationMocomps[mocompName][mocompStatus]]]( asmEntity, mocompAnim, mocompAnimBlendOutTime,
"", mocompDuration );
36 return animationMocompResult;
42 mocompName = ToLower( mocompName );
44 Assert( IsString( mocompName ),
"ASM - mocompName for RegisterAnimationMocomps is not a string." );
45 Assert( !IsDefined(level._AnimationMocomps[mocompName]),
"mocomp with name " + mocompName +
" is already registered." );
47 level._AnimationMocomps[mocompName] =
array();
50 Assert( IsDefined( startFuncPtr ) && IsFunctionPtr( startFuncPtr ),
"BT - RegisterAnimationMocomps must have startFunctionPtr and it must be of type functionPtr." );
54 if( IsDefined( updateFuncPtr ) )
56 Assert( IsFunctionPtr( updateFuncPtr ),
"BT - RegisterAnimationMocomps must have updateFuncPtr and it must be of type functionPtr." );
65 if( IsDefined( terminateFuncPtr ) )
67 Assert( IsFunctionPtr( terminateFuncPtr ),
"BT - RegisterAnimationMocomps must have terminateFuncPtr and it must be of type functionPtr." );