PlayAnimation(int, float, float)

From NWN Lexicon
Jump to navigationJump to search

Play an animation.

void PlayAnimation(
    int nAnimation,
    float fSpeed = 1.0,
    float fSeconds = 0.0
);

Parameters

nAnimation
ANIMATION_*
fSpeed
The speed of the animation. (Default: 1.0)
fSeconds
Duration of the animation in seconds (this is not used for fire and forget animations). (Default: 0.0)


Description

Play nAnimation immediately on the object that called this function. It essentially calls ClearAllActions then ActionPlayAnimation. Therefore this cannot be queued the same way ActionPlayAnimation can be.

Most animations apply to creatures, but not all creatures can be made to perform each animation.

ANIMATION_PLACEABLES_* work on placeables and ANIMATION_DOOR_* work on doors.

The fSpeed parameter can be used to speed up or slow down the animation. 1.0 is normal speed.

The fSeconds parameter is only used with looping animations (ANIMATION_LOOPING_*) and determines how long the creature will perform that animation. A common parameter for looping animations is 6.0, as it means that the creature spends a full round doing that animation.

ANIMATION_FIREFORGET_* animations do not need fSeconds to be provided.


See Also

functions: 

ActionPlayAnimation

constants: 

ANIMATION_* Constants



 author: Tom Cassiotis, editor: Jochem van 't Hull