Skip to content

AddEmote

A new emote, or a new look for a known one.

The body the others see plays clip - a clip of the game’s male animation set, the names SetActorAnim takes (the animation lists) - and the player’s own game plays fragment with tags: a Mannequin fragment of the player’s animation database (the fragment families of the same lists, GreetingsUpperBody, ApplauseHappy …; the tags pick a variant, +-joined). loop true plays it until the player moves or it is stopped, else once. false when a part will not do (the server’s log says which). It is not on the wheel until SetEmoteWheel puts it there; PlayPlayerEmote (a mode’s command) takes it at once.

opts gives it more:

  • an in and an out - inClip / inFragment / inTags play once before the loop and outClip / outFragment / outTags once when it ends, on every screen: sitting down and standing up, lying down and getting up. A player who comes into view while it loops sees the loop at once.
  • upper = true - an upper-body gesture: clip plays on the upper body for everyone (the player’s own game too), and walking, running or crouching do not end it. With loop it loops there until stopped - hands tied behind the back while the player walks; a whole-body clip works too (the legs keep walking under it). It needs no fragment and has no in or out.
  • locked = true - only the mode ends it (StopPlayerEmote, another PlayPlayerEmote): the player’s own keys, a step away, a crouch, a drawn weapon, a fight or a hit no longer end it, and the player cannot pick another emote meanwhile. A death, a respawn, a horse, a knock-out and being carried still end it - play it again after them if it should last (GetPlayerEmote says whether it still plays). Pair a locked full-body one with TogglePlayerControllable so the player cannot walk off in it.
  • item = "<item>" - an item held while it plays, a tool for a working clip: the game’s item name or GUID (the work tools are in the item lists’ NPCTool) or one of your own items (DefineItem), which shows its own look; hand = "left" puts it in the left hand (the right, the weapon hand, by default). Every screen shows it in the player’s hand, their own too; a drawn weapon is put away first and cannot be drawn until the emote ends. Nothing enters the player’s inventory. false for an item the server does not know. The item sits in the hand at its own grip, so 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, sweeping_floor_stand the broom in the right (the clips are the work spots’ in the activities); a weapon in its place is held at the weapon’s grip. A work that bends the whole body (chopping wood, sweeping the floor) wants a whole-body emote, not upper: an upper-body one keeps the hips standing and the axe or broom works the air - give it the clip’s fragment family for the player’s own game (WoodChopping_loop, SweepingFloor: the animation lists’ second column).

A whole-body emote with an in or an out, or a locked one, seats the player from the in to the end of the out: their view turns at most 60 degrees either way and the body keeps its heading (in third person the camera turns around it), and the walk, jump and crouch keys stand the player up instead of moving them - a locked one waits for the mode.

The fragment’s state must hold while the loop plays: a fragment that plays once and stops (a lie-down, a fall) as the loop shows it over and over on the player’s own screen - give the loop a looping fragment (WoundedLying_1, LyingInjured, SittingIdle with its tags …) and the one-shot as the in. A lying player’s own first-person view lies with the head (hair across the view, or inside it): SetPlayerThirdPerson "force" while they lie shows them from beside the body.

AddEmote(name, label, clip, fragment [, tags, loop, opts])
Parameter Type
name string 1-24 of a-z, 0-9, _ and -
label string what the wheel shows (the name, capitalised, when empty)
clip string the body’s clip
fragment string the player’s own fragment
tags string its fragment tags ("") (optional)
loop boolean until stopped (false = once) (optional)
opts table any of upper (an upper-body gesture that walks along; false), locked (only the mode ends it; false), inClip, inFragment, inTags (played once before the loop), outClip, outFragment, outTags (played once when it ends), item (an item held while it plays) and hand ("right" or "left") (optional)

boolean

-- kneel in prayer until the player gets up
AddEmote("kneel", "Kneel", "pray_kneel_loop", "PrayKneeling", "", true)
-- hands tied behind the back while the player walks; only the mode takes them off
AddEmote("cuffed", "Cuffed", "hands_tied_back_idle", "", "", true, {upper = true, locked = true})
-- chopping wood bent over the block with the woodcutters' axe in the hand until the mode says the work is done
AddEmote("chop", "Chop wood", "woodchopping_loop_04", "WoodChopping_loop", "", true, {locked = true, item = "axe_chopping"})
-- sweeping the floor bent over the broom: a whole-body emote with the sweepers' own fragment
AddEmote("sweep", "Sweep", "sweeping_floor_stand", "SweepingFloor", "", true, {locked = true, item = "broom"})
-- a defeated player: struck down, lies wounded until the mode lets them up, then gets up
AddEmote("downed", "Downed", "quest_wounded_a_loop_01", "WoundedLying_1", "", true, {
locked = true,
inClip = "quest_stand_hlbrd_killed_fall_down", inFragment = "Quest_StandHlbrdKilledFallDown",
outClip = "resting_ground_out_01", outFragment = "GetUp", outTags = "lyingGround+var1",
})
PlayPlayerEmote(pid, "downed")
TogglePlayerControllable(pid, false)
SetPlayerThirdPerson(pid, "force") -- their own view from beside the body, not from inside its head
-- ... later, the mode lets them up
StopPlayerEmote(pid)
TogglePlayerControllable(pid, true)
SetPlayerThirdPerson(pid, "allow")
-- lie down to rest (a calmer one: lies down, rests, gets up)
AddEmote("rest", "Rest", "resting_ground_idle_01", "Lying", "lyingGround+var1", true, {
inClip = "resting_ground_in_01", inFragment = "LieDown", inTags = "liePlaceGround+lieVar01",
outClip = "resting_ground_out_01", outFragment = "GetUp", outTags = "lyingGround+var1",
})

SetEmoteWheel · GetEmotes · SetActorAnim · PlayPlayerEmote · the Emotes group of the index