API ReferenceGE ExtensionsflowgraphnodesvehicleaiscriptAI
Stored AI Path
- **Node Name:** `Stored AI Path`
Overview
- Node Name:
Stored AI Path - Category:
provider - File:
extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathStored.lua
Stores a ScriptAI path directly within the flowgraph node. Paths can be loaded from the ScriptAI Manager editor tool and are serialized with the flowgraph. Outputs the path data for use with "AI Follow Path from Data".
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
path | table (aiPath) | The stored AI path data. |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Initializes empty aiPath array and selector state. |
work() | Outputs {path = self.aiPath} on the path pin. |
drawCustomProperties() | Editor UI - shows path element count, debug visualization, ScriptAI Manager integration, and recording selector. |
drawDebugPath() | Renders the stored path as purple square prisms in the 3D viewport (distance-culled). |
_onSerialize(res) | Saves the aiPath array. |
_onDeserialized(nodeData) | Restores the aiPath array. |
How It Works
- The node stores an array of path waypoints (
{x, y, z, t, dir?, up?}) directly inself.aiPath. - In the editor, use the ScriptAI Manager to record a path, then click "Load Selected Recording into node."
- The path data persists with the flowgraph via serialization.
work()wraps the array as{path = self.aiPath}matching theaiPathtable type.
Debug Visualization
When the editor properties panel is open, the node draws the stored path in 3D:
- Purple square prisms connect consecutive waypoints.
- Points beyond 100–200m from the camera are culled for performance.
Usage Example
-- Flowgraph chain:
-- [Stored AI Path] → path → [AI Follow Path from Data (vehId, loopCount=1)] → flow → [Done]
-- The stored path format:
local aiPath = {
{x = 100, y = 200, z = 50, t = 0.0},
{x = 105, y = 205, z = 50, t = 1.2},
-- ...
}Key Dependencies
editor_scriptAIManager- ScriptAI Manager editor extension for recording pathseditor_scriptAIManager.getCurrentRecordings()- retrieves available recordings- Debug drawing:
debugDrawer:drawSquarePrism()for path visualization
See Also
- AI Follow Path from Data (Flowgraph Node) - Related reference
- AI Path from File (Flowgraph Node) - Related reference
- Play ScriptAI Recording (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide