Skip to content

SetActorHandItem

Puts an item in an actor’s hand - a tool for its work or its animation - or empties the hand.

A copy of the item in the actor’s hand on every screen, held the way its animation holds it: an axe for chopping wood, a broom, a hammer, a saw. item is the game’s item name or GUID (the item lists; the work tools are in NPCTool) or one of your own items (DefineItem), which shows its own look. The right hand is the weapon hand; the torch (SetActorTorch) takes the left. The game’s hold pose of the item is kept off, so the clip moves the arm. Nothing enters the actor’s bag, and an actor coming into view later shows it too. A death drops what its hands held. The item sits in the hand at its own grip: give a clip the tool its animation was made for, in the hand the game’s workers use (woodchopping_loop_04 holds axe_chopping in the right hand; the clips are the work spots’ in the activities).

The level’s work spots (SetActorUseAt) bring their own tools; this is for the clips you play yourself (SetActorAnim) and for an actor that should simply carry something.

SetActorHandItem(id, item [, hand])
Parameter Type
id number the actor
item string the item’s name or GUID, or your own item’s name; nil or "" empties the hand
hand string "right" (the default) or "left" (optional)

true, or false and the reason (not a living person actor, an unknown item)

-- a woodcutter by the road, chopping all day with an axe of the mode's own
DefineItem("woodaxe", {base = "axe_chopping", name = "Woodcutter's axe"})
local id = CreateActor("", 812.5, 1440.2, 31.6, 90, "Woodcutter")
SetActorHandItem(id, "woodaxe")
SetActorAnim(id, "woodchopping_loop_04", true)

GetActorHandItem · SetActorTorch · SetActorAnim · DefineItem · AddEmote · the NPC actors group of the index