API ReferenceGE Extensionsflowgraphnodesstates
State Exit (Flowgraph State Node)
- **Node Name:** `State Exit`
Overview
- Node Name:
State Exit - Type: State node (created via
_flowgraph_createStateNode) - File:
extensions/flowgraph/nodes/states/stateExit.lua
Exit point for a stategraph. When reached, triggers a named transition to leave the current state.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | state | State flow input - receives flow from the graph |
Additional pins: Supports manually added state type pins via allowedManualPinTypes.
Node Properties
| Property | Value | Description |
|---|---|---|
hidden | true | Not visible in the node palette |
icon | "trending_up" | Upward arrow icon |
color | red (1, 0.4, 0.4, 1) | Red tint to indicate exit |
Internals
| Field | Purpose |
|---|---|
self.transitionName | Name of the transition triggered on exit |
self.savePins | Whether custom pins are serialized |
Behavior
drawMiddle()- Displays the transition name in the node UI.drawCustomProperties()- Provides a combo box to select from available transition names defined on the parent state node.- Serialization -
transitionNameis saved/restored with the graph.
How It Works
- A stategraph can have multiple State Exit nodes, each with a different
transitionName. - When execution reaches this node, the named transition fires on the parent state machine.
- The transition name is selected from the parent node's
getTransitionNames()list via the editor UI. - The parent stategraph node uses the transition name to determine which state to enter next.
Key Dependencies
_flowgraph_createStateNode(C)- state node factory- Parent state node's
getTransitionNames()- provides available transition options
Additional Methods
C:_onDeserialized(data)
Called after the node is deserialized (loaded from file). Restores runtime state from saved data.
Parameters:
data
C:_onSerialize(res)
Called when the node is serialized (saved to file). Returns data to persist.
Parameters:
res
C:init(mgr)
Initializes the node, setting up pins and default properties.
Parameters:
mgr
See Also
- State Entry (Flowgraph State Node) - Related reference
- State Node (Flowgraph Node) - Related reference
- Transition (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide