Turok EX Modding Guide

Scripts kAnimState

Manages an actor's animation. You can get a reference to an actor's anim state by calling kActor::AnimState().

Anim ID constants can be found in scripts/animations.txt.

Variables

int flags

bit field of current animation flags

possible flags are:

ANF_BLEND
ANF_LOOP
ANF_STOPPED
ANF_NOINTERRUPT
ANF_ROOTMOTION
ANF_PAUSED
ANF_CYCLECOMPLETED

Methods

void Blend( int animID, float animRate, float blendTime, int flags )

void Set( int animID, float animRate, int flags )

play an animation with or without tween time, respectively

animRate is the time per frame, in 160 seconds

blendTime is the time to crossfade between the previous and new animation, in 130 seconds

int NumFrames()

number of frames the current animation consists of

float PlayTime()

time in seconds the current animation has been playing

does not increase while paused

float TrackTime()

fraction of the current animation that's been played so far (0.0 to 1.0)

does not reflect tweening, e.g., halfway between the first two frames of a ten-frame animation would return 0.1, not 0.15

int PlayingID()

ID of the actor's current animation

valid even if the animation is paused or stopped

bool IsPlaying( int animID )

returns whether the given animation is playing

returns true even if the animation is paused, but not if it's stopped

bool CheckAnimID( int animID )

returns whether this actor has an animation with the given ID

void Stop()

void Pause()

void Resume()

bool Stopped()

bool Blending()

bool Looping()

bool CycleCompleted()

void ChangeSpeed( float animRate )

animRate works the same as in Blend() and Set()

void SetLastFrame( bool bPerformActions = false )

cut to the last frame of the current animation

if bPerformActions is true, all keyframe actions (sounds, particles, melee damage, etc.) will be performed (not just the ones for the skipped frames), otherwise none of them will be performed