Sgbernie
Based on game build 714014 | Last updated: 2026-03-08
Overview
SGbernie is a StateGraph for the Bernie entity that orchestrates its behavior through a set of named states (idle, taunt, hit, death, activate, deactivate, and walk-related states generated by CommonStates.AddWalkStates). Each state defines animations, sound effects, timers, and timeline events to create rich, responsive gameplay behavior. The stategraph integrates with the locomotor and timer components to manage movement and timed cooldowns.
Usage example
local inst = CreateEntity()
-- ... (configure prefab, components, etc.) ...
inst.sg = StateGraph("bernie", inst, states, events, "activate")
Note: This file itself defines the full StateGraph definition and returns it; it is not meant to be manually instantiated by modders. Use inst.sg = inst.components.stategraph after attaching the stategraph component to a Bernie prefab.
Dependencies & tags
Components used: locomotor, timer, animstate, soundemitter, transform
Tags added in states: idle, canrotate, busy, deactivating
Properties
No public properties exposed; configuration is internal to state callbacks.
Main functions
This file defines a StateGraph return value and does not expose custom functions beyond the internal onenter, ontimeout, onexit, and timeline callbacks registered per state.
Events & listeners
- Listens to:
locomote— viaCommonHandlers.OnLocomote(false, true)for movement updates.attacked— viaCommonHandlers.OnAttacked()for damage reaction.death— triggersGoToState("death")unless alreadydeactivating.animover— per-state handlers switch states when animations complete.
- Pushes: No custom events are fired by this component; behavior flows through state transitions and external event handlers.