Sgcharlie Stage Post
Based on game build 714014 | Last updated: 2026-03-08
Overview
SGcharlie_stage_post is a stategraph that governs the behavioral states of the Charlie (statue mask) stage post entity during in-game events and cutscenes. It manages transitions between closed, open, narrating, and stinger states based on animation completion events, timeouts, and external triggers such as ontalk. The stategraph plays associated sound effects and controls animation playback using the AnimState and SoundEmitter components.
Usage example
The stategraph is automatically instantiated and managed by the engine when the associated entity (e.g., charlie_stage_post) is spawned. Modders typically trigger transitions via events:
inst:PushEvent("ontalk", { sgparam = "upbeat" }) -- Initiates a narrate state
inst:PushEvent("animover") -- May trigger next state depending on current context
Dependencies & tags
Components used: AnimState, SoundEmitter
Tags: Adds dynamic state tags including idle, busy, open, closed, on, and talking.
Properties
No public properties.
Main functions
State { name = "narrate", ... } onenter(inst, data)
- Description: Enters the narrating state, playing looping animation and sound based on the provided
data.sgparam. A timeout is scheduled, and the state exits upon timeout or thedonetalkingevent. - Parameters:
inst(entity instance),data(table with optionalsgparamkey:"upbeat","mysterious", or default). - Returns: Nothing.
State { name = "stinger", ... } onenter(inst, sound)
- Description: Triggers a stinger animation and plays the specified sound. Expects non-nil
soundstring; otherwise, transitions immediately toidle_open_on. - Parameters:
inst(entity instance),sound(string ornil). - Returns: Nothing.
- Error states: If
sound == nil, the function returns early and transitions toidle_open_onwithout playing animation or sound.
Events & listeners
- Listens to:
ontalk– initiatesnarratestate iftalkingtag is absent.animover– transitions between idle, open/closed, and narrator states upon animation completion.animqueueover– exitsstingerstate when animation queue completes.donetalking– signals end of narration and transitions toidle_open_on.
- Pushes: No events are directly pushed by this stategraph itself.