API ReferenceGE Extensionsflowgraphnodesutil
Load Project (Flowgraph Node)
- **Node Name:** `Load Project`
Overview
- Node Name:
Load Project - Category:
once_p_duration - File:
extensions/flowgraph/nodes/util/loadProject.lua
Loads and executes another flowgraph project by file path. Paths are relative to flowgraphEditor/, and the .flow.json extension can be omitted.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
filepath | string | File path to the flowgraph project to load |
startNextFrame | bool | If true, starts the project next frame; if false, starts immediately |
Internals
Key Methods
| Method | Description |
|---|---|
init(mgr) | Sets destroyTargetOnStop to true, initializes target reference |
postInit() | Configures file picker to accept .flow.json files |
_executionStopped() | Stops and removes the loaded project if destroyTargetOnStop is set |
workOnce() | Resolves the file path, loads the manager, and starts it |
Node Data Properties
| Property | Default | Description |
|---|---|---|
destroyTargetOnStop | true | Automatically destroy the loaded project when this node's flowgraph stops |
Path Resolution
The node tries three path variants in order:
filepathas-isfilepath+.flow.jsonflowgraphEditor/+filepath+.flow.json
How It Works
- Resolves the input filepath using
mgr:getRelativeAbsolutePath()with three fallback patterns. - Calls
core_flowgraphManager.loadManager(file)to load the project. - Either starts it immediately (
mgr:setRunning(true)) or defers to next frame (core_flowgraphManager.startNextFrame(mgr)). - Stores reference in
self.targetso it can be cleaned up when execution stops.
Usage Example
-- Load a sub-flowgraph for a minigame:
-- [Start Event] → flow → [Load Project] filepath="minigames/race_setup"
-- startNextFrame=false
-- Load with deferred start:
-- [Load Project] filepath="cutscenes/intro" startNextFrame=trueKey Dependencies
core_flowgraphManager.loadManager()- loads a flowgraph project from filecore_flowgraphManager.startNextFrame()- deferred project startcore_flowgraphManager.removeNextFrame()- deferred project removal
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide