Skip to content

State Nodes

Read and write named variables in the graph state. Every variable lives in a scope: local (this module run), parent, shared (all modules in the graph), scene loop (reset each loop iteration) or game (persisted with the scene save). See States for scope semantics. The ...Path variants address nested values with slash-separated paths such as quest/stage. The nodes that increment numeric state in place are on State Counter Nodes.

12 nodes.

Node Registry path
Set State (Conditional) state/ConditionalSetState
Unset State (Conditional) state/ConditionalUnsetState
Game State state/Gamestate
Get State state/GetState
Get State (Path) state/GetStatePath
Has State state/HasState
Has State (Path) state/HasStatePath
Set State state/SetState
Set State (Path) state/SetStatePath
Unset State state/UnsetState
Unset State (Path) state/UnsetStatePath
Update Game State state/UpdateGameState

Set State (Conditional)

state/ConditionalSetState

Set a variable in the graph state

Provides a required state input causing the node to only run when a state is provided

Inputs

Input Type Description
state any
name str (optional)
value any

Outputs

Output Type Description
state any
name str
value any
scope str

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Unset State (Conditional)

state/ConditionalUnsetState

Unset a variable in the graph state

Provides a required state input causing the node to only run when a state is provided

Inputs

Input Type Description
state any
name str (optional)

Outputs

Output Type Description
state any
name str
value any
scope str

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Game State

state/Gamestate

Get the game state variables of the active scene. Change them with Update Game State or a state node in the game scope: a change made in place sends no game_state.changed event.

Outputs

Output Type Description
variables dict Dict of the scene's game state variables

Get State

state/GetState

Get a variable from the graph state

Inputs

Input Type Description
name str (optional) the name to get
default any value to return if the variable is not set (optional)

Outputs

Output Type Description
name str the name that was retrieved
value any the value that was retrieved
scope str the scope that was retrieved

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Get State (Path)

state/GetStatePath

Get a variable from the graph state using a path (e.g., 'a/b/c').

Does not create missing containers - returns default if path doesn't exist.

Inputs

Input Type Description
name str (optional) the path name to get (e.g., 'a/b/c')
default any (optional) default value if path doesn't exist

Outputs

Output Type Description
name str the name that was retrieved
value any the value that was retrieved
scope str the scope that was retrieved

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Has State

state/HasState

Check if a variable exists in the graph state

Inputs

Input Type Description
name str (optional) the name to check

Outputs

Output Type Description
name str the name that was checked
value any
scope str the scope that was checked

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Has State (Path)

state/HasStatePath

Check if a variable exists in the graph state using a path (e.g., 'a/b/c').

Does not create missing containers - returns False if path doesn't exist.

Inputs

Input Type Description
name str (optional) the path name to check (e.g., 'a/b/c')

Outputs

Output Type Description
name str the name that was checked
value any
scope str the scope that was checked

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Set State

state/SetState

Set a variable in the graph state

Inputs

Input Type Description
name str (optional) the name to set
value any the value to set

Outputs

Output Type Description
name str the name that was set
value any the value that was set
scope str the scope that was set

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Set State (Path)

state/SetStatePath

Set a variable in the graph state using a path (e.g., 'a/b/c').

Creates intermediate dictionaries as needed (mkdir -p semantics). Mutating operation - conditional by default with required state input.

Inputs

Input Type Description
state any required state input (conditional execution)
name str (optional) the path name to set (e.g., 'a/b/c')
value any the value to set

Outputs

Output Type Description
state any the state that was passed in
name str the name that was set
value any the value that was set
scope str the scope that was set

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Unset State

state/UnsetState

Unset a variable in the graph state

Inputs

Input Type Description
name str (optional) the name to unset

Outputs

Output Type Description
name str the name that was unset
value any the value that was unset
scope str the scope that was unset

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Unset State (Path)

state/UnsetStatePath

Unset a variable in the graph state using a path (e.g., 'a/b/c').

Does not create missing containers - returns None if path doesn't exist. Mutating operation - conditional by default with required state input.

Inputs

Input Type Description
state any required state input (conditional execution)
name str (optional) the path name to unset (e.g., 'a/b/c')

Outputs

Output Type Description
state any the state that was passed in
name str the name that was unset
value any the value that was unset
scope str the scope that was unset

Properties

Property Type Default Description
name str unset The name of the variable to manipulate
scope str "local" Which scope to manipulate. Choices: local, parent, shared, scene loop, game.

Update Game State

state/UpdateGameState

Apply update dicts to the game state variables, in order; each changed value sends game_state.changed.

Inputs

Input Type Description
state any graph state
updates dict,list one dict, or a list of dicts applied one after another

Outputs

Output Type Description
state any graph state
variables dict the game state variables after the update

Properties

Property Type Default Description
merge bool True Merge nested dicts; off replaces each top-level key