Sgwilsonghost
Based on game build 714014 | Last updated: 2026-03-08
Overview
SGwilsonghost defines the complete stategraph for Wilson's ghost form in DST. It handles player input, movement states (idle, run), special actions (haunt, jumpin, migrate), interactions like talking (talk, mime), and death-related transitions (dissipate, remoteresurrect). The stategraph integrates with core components such as health, locomotor, playercontroller, and teleporter, ensuring correct behavior during networked gameplay (including pause prediction and replication). It uses state tags (busy, idle, moving, pausepredict) to manage interrupts and synchronization between server and client.
Usage example
-- The stategraph is automatically associated with Wilson's ghost prefab
-- when he dies and transitions to ghost form. Modders can extend it
-- by overriding or adding states/events, but it's typically not added manually.
-- Example extension pattern (not direct usage):
local SG = require("stategraphs/SGwilsonghost")
-- Modify SG.states or SG.events before returning if creating a custom SG.
Dependencies & tags
Components used: health, locomotor, playercontroller, teleporter
Tags: State tags include idle, moving, running, busy, talking, canrotate, pausepredict, nopredict, autopredict, doing.
Properties
No public properties.
Main functions
This is a stategraph definition file, not a component with methods. It returns a StateGraph instance and does not define public functions accessible via inst.components.X.
Events & listeners
-
Listens to:
locomote— updates movement state based onlocomotorstatus (runvsidle).attacked— triggershitstate if not dead.ontalk— enterstalkormimestate depending on themimetag.vault_teleport— entersvault_teleportstate.animover— triggered on animation completion in multiple states to advance state transitions.ghostdissipated— pushed internally upondissipateanimation completion.
-
Pushes:
ghostdissipated— fired after thedissipateanimation finishes.- (Note: The
deathevent listener is commented out; theghostdissipatedevent replaces it in ghost flow.)