Skip to content

OnActorActivity

An actor’s activity or pair began, ended or never got under way.

state is "start" once the actor is in place and the activity’s loop plays (seated, kneeling, the pair talking), "end" when it got up (StopActorUse, a MoveActor) and "cancel" when it never got there (its walk ended short of the place, a pair’s partner did not come within 30 s). An activity the server cut off - a death, a mount, a fight, the actor removed, another activity - ends without the callback.

function OnActorActivity(id, activity, state)
-- ...
end
Parameter Type
id number the actor
activity string the activity’s name, or the pair’s
state string "start", "end" or "cancel"

nothing

-- the smith works until noon, then sits down
function OnActorActivity(id, activity, state)
if id == smith and state == "end" then SetActorUse(id, "smartObject[Bench/bench_1place_low12]") end
end

SetActorUse · SetActorUseAt · PlayActorPairAnim · StopActorUse · the Actor life group of the index