API ReferenceGE Extensionsflowgraphnodesui
Get Gamestate (Flowgraph Node)
- **Node Name:** `Get Gamestate`
Overview
- Node Name:
Get Gamestate - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/getGamestate.lua
Reads the current UI game state string each frame.
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
state | string | Current game state (e.g. "freeroam", "play", "scenario-end") |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Sets output to core_gamestate.state.state |
How It Works
Each frame, reads core_gamestate.state.state and outputs the current state string. This can be used to branch flowgraph logic based on whether the game is in freeroam, playing, in a menu, etc.
Usage Example
-- Output value is the current state string:
local state = core_gamestate.state.state
-- e.g. "freeroam", "play", "scenario-end", "menu", etc.
-- In a flowgraph, connect to a String Compare or Switch node
-- to branch based on current game state.Key Dependencies
core_gamestate.state.state- the current UI state string
See Also
- Medal / Auto Medal (Flowgraph Node) - Related reference
- Clear Messages (Flowgraph Node) - Related reference
- Context Translation (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide