SetActorUse
Sends an actor to one of the level’s seats, beds or work spots to do what the game’s people do there.
key is a smart object’s key of GetSmartObjects. The actor walks to the object (at 1.3 m/s, around walls on the navigation
mesh), starts the activity with the game’s own animation - sits down, lies down, kneels in the bed, takes up the work - and stays in
it until StopActorUse or a MoveActor (it gets up first, then walks). OnActorActivity tells "start" and "end". One
actor an object; a woman takes the women’s animation where the game has one. A chore mimes its tool (no draw knife in the hands at
the trestle).
Syntax
Section titled “Syntax”SetActorUse(id, key)| Parameter | Type | |
|---|---|---|
id |
number | the actor |
key |
string | the smart object’s key |
Returns
Section titled “Returns”boolean - false for an unknown or taken object, an activity without an animation for this body, or an actor that is not standing free
Example
Section titled “Example”-- every guard off duty finds a seatlocal x, y, z = GetEntityPos(guard)local seat = GetNearestSmartObject(x, y, z, 40, "sit")if seat then SetActorUse(guard, seat.key) endSee also
Section titled “See also”GetSmartObjects · SetActorUseAt · StopActorUse · OnActorActivity · the Actor life group of the index
