Playing AI Animations

From The DarkMod Wiki
Revision as of 00:14, 8 November 2007 by Greebo (talk | contribs) (New page: == Animation Channels == Each Actor has a set of animation channels (all AIs are deriving from Actors, by the way): * ANIMCHANNEL_TORSO * ANIMCHANNEL_LEGS * ANIMCHANNEL_HEAD * ANIMCHANNE...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Animation Channels

Each Actor has a set of animation channels (all AIs are deriving from Actors, by the way):

  • ANIMCHANNEL_TORSO
  • ANIMCHANNEL_LEGS
  • ANIMCHANNEL_HEAD
  • ANIMCHANNEL_EYELIDS
  • (ANIMCHANNEL_ALL)

Each channel can play an animation independently from the other channels, hence it's possible to play the walk animation on the LEGS channel and the cough animation on the TORSO.

Playing Animations

The most basic way to play an animation is to call the script event playAnim (via script) or Event_PlayAnim (SDK). Both take the desired animation channel and the animation's name as argument:

scriptEvent float playAnim(float channel, string animName);
void idActor::Event_PlayAnim(int channel, const char *animname);

However, for most applications this is not enough. When a channel is done playing the anim, it will stop playing anything, which might cause the AI's hands to hang around uselessly (in the case of the TORSO channel). Because of this, Animation States were introduced:

Animation States

TODO