Sgstageusher
Based on game build 714014 | Last updated: 2026-03-08
Overview
SGstageusher is the stategraph for the Stageusher entity, controlling its behavior through a set of discrete states including idle, standup, sitdown, attack, attack_loop, hit, and extinguish (with variants). It relies on the locomotor, combat, and burnable components to drive state transitions. The stategraph integrates with CommonStates.AddWalkStates to provide walk animations and handles both standing and seated postures via the IsStanding property and ChangeStanding method.
Usage example
-- Typically added via the prefab definition:
inst:AddStateGraph("stageusher", "stategraphs/SGstageusher")
-- Event callbacks are registered automatically by the stategraph:
inst:PushEvent("doattack", { target = enemy })
inst:PushEvent("standup")
inst:PushEvent("sitdown")
Dependencies & tags
Components used: locomotor, combat, burnable
Tags: Adds "idle", "canrotate", "busy", "attack", "hit" depending on state; checks "busy" via HasStateTag.
Properties
No public properties.
Main functions
State(name)
- Description: Each state is defined via
State { name = "...", ... }and contributes to the overall behavior of the entity. States are returned in thestatesarray and passed toStateGraph. - Parameters: N/A — this is a data definition, not a callable function.
- Returns: N/A.
CommonStates.AddWalkStates(states, timelines)
- Description: Extends the
statestable with walk-related states (walk_start,walk,walk_stop) and injects provided timeline sound events. - Parameters:
states(table) — the existing state definitions to extend.timelines(table) — containsstarttimeline,walktimeline, andendtimelinemappings of frame offsets to sound callbacks.
- Returns: Nothing (modifies
statesin place).
Events & listeners
-
Listens to:
"doattack"— triggersattackstate (unless"busy"tag is present)."standup"— triggersstandupstate (unless"busy"), or queues a standing request if busy."sitdown"— triggerssitdownstate (unless"busy"), or queues a sitting request if busy."animover"— in most states, returns toidleafter animation completes."animqueueover"— inextinguish_standing, transitions toidleafter queued animations."handfinished"— inattack_loop, ends loop and goes tostandup."ontimeout"— inattack_loop, safety fallback after 10 seconds."OnLocomote"and"OnAttacked"— provided viaCommonHandlers.
-
Pushes: None — the stategraph itself does not fire events; it responds to events pushed onto the entity.