API ReferenceGE Extensionsflowgraphnodesscene
Store Statics (Flowgraph Node)
- **Node Name:** `Store Statics`
Overview
- Node Name:
Store Statics - Category: (default)
- File:
extensions/flowgraph/nodes/scene/storeStatics.lua
Stores TSStatic object configurations (shape, position, rotation, scale) within the node and manages spawning/despawning them at runtime. Provides an editor UI for selecting, storing, and managing static objects.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Standard inflow - spawns stored objects |
reset | flow (impulse) | Clears all spawned objects |
Output Pins
| Pin | Type | Description |
|---|---|---|
flow | flow | Standard outflow |
Internals
| Field | Purpose |
|---|---|
self.objects | List of currently spawned TSStatic references |
self.storedObjects | Serialized list of {pos, rot, scl, shapeName, currentId} entries |
self._objectesExistedBeforeStart | Flag to prevent cleanup of objects that existed before execution |
Behavior
work()- On flow, spawns all stored objects (if not already spawned). On reset, clears them.spawnObjects(force)- IteratesstoredObjects, callscreateObject()for each, and registers with the editor.createObject(pos, rot, scl, shape)- Creates a TSStatic with the given transform and shape.updateStoredObjects(ids)- Captures transforms from selected scene objects, deletes the originals, stores the data, and respawns them as managed objects.clearObjects()- Deletes all spawned objects and resetscurrentIdin stored entries.
Editor UI (drawCustomProperties)
- Shows count of selected TSStatic objects.
- Store Selected Objects - Captures selected TSStatics into the node's storage.
- Spawn All / Despawn All - Manual spawn/despawn controls.
- Select All - Selects all currently spawned objects in the editor.
- Clear Storage - Removes all stored data.
- Lists stored objects with shape name, spawn status, and delete buttons.
How It Works
- In the editor, select TSStatic objects and click "Store Selected Objects" to capture their transforms.
- The original objects are deleted and immediately respawned as managed objects.
- During flowgraph execution,
work()spawns stored objects on first flow. - Objects that existed before execution starts are preserved on stop (not deleted).
- Serialization saves
storedObjectsso the configuration persists with the flowgraph.
Key Dependencies
createObject("TSStatic")- spawns static mesh objectseditor.selectObjects()/editor.deselectObjectSelection()- editor selection APIeditor.onAddSceneTreeObjects()/onRemoveSceneTreeObjects()- scene tree sync
Additional Methods
C:_executionStarted()
Called when graph execution starts. Used for initialization/reset.
C:_executionStopped()
Called when graph execution stops. Used for cleanup.
C:_onDeserialized(nodeData)
Called after the node is deserialized (loaded from file). Restores runtime state from saved data.
Parameters:
nodeData
C:_onSerialize(res)
Called when the node is serialized (saved to file). Returns data to persist.
Parameters:
res
C:destroy()
Destroys the node and cleans up any created objects.
C:init(mgr, ...)
Initializes the node, setting up pins and default properties.
Parameters:
mgr...
C:onClientEndMission()
Cleanup callback when the mission/level ends.
See Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide