SetActorAnim
Puts a pose on a standing actor - a clip of the game’s animation set.
clip is a clip name of the male animation set (behavior_sitting_variation01_loop,
greetings_wave_big_over, woodchopping_loop_01 …) or one of the aliases the API names: sit, wave, bow, nod,
pray, chop, sweep, smith (ACTOR_ANIM in Constants). loop true (the default) plays it
until cleared; false plays it once. nil clears the pose; so do MoveActor and a death. The pose rides in the actor’s
state bag (key anim), so a player who arrives later finds the guard sitting. A chore without its prop mimes - a smith
without an anvil.
Syntax
Section titled “Syntax”SetActorAnim(id, clip [, loop])| Parameter | Type | |
|---|---|---|
id |
number | the actor |
clip |
string | nil | a clip name or an alias; nil clears the pose |
loop |
boolean | true (the default) loops; false plays once (optional) |
Returns
Section titled “Returns”boolean - false for anything but a living actor
Example
Section titled “Example”StopActor(guard)SetActorAnim(guard, "sit") -- an alias: loopsSetActorAnim(herald, "greetings_wave_big_over", false) -- a clip by name, onceSetActorAnim(guard, nil) -- stands upSee also
Section titled “See also”MoveActor · StopActor · SetEntityState · the NPC actors group of the index
