API ReferenceGE Extensionsflowgraphnodesutilfile
Load Data (Flowgraph Node)
- **Node Name:** `Load Data`
Overview
- Node Name:
Load Data - Category:
once_instant - File:
extensions/flowgraph/nodes/util/file/loadData.lua
Loads simple data from a file for reuse across multiple sessions. Supports user-defined output pins of various types.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
file | string (fixed) | Name of the file to load from (extension not needed) |
Output Pins
User-defined custom output pins. Allowed types: string, number, bool, any, table, vec3, quat, color.
Internals
Key Methods
| Method | Description |
|---|---|
init(mgr) | Enables pin saving and allows custom output pins |
workOnce() | Reads each output pin's value from the file module using the pin name as key |
onNodeReset() | Forces a reload of the file data via mgr.modules.file:forceReload() |
Properties
| Property | Value |
|---|---|
savePins | true - pin configuration is persisted |
allowCustomOutPins | true - user can add output pins in the editor |
allowedManualPinTypes | string, number, bool, any, table, vec3, quat, color |
How It Works
- User adds custom output pins in the flowgraph editor (e.g., a
numberpin namedscore). - When the node executes, it reads the file specified by the
fileinput pin. - For each output pin (excluding
flow), it callsself.mgr.modules.file:read(file, pinName)to load the stored value. - On node reset, the file cache is force-reloaded to pick up any external changes.
Usage Example
-- Pair with a Save Data node to persist player progress:
-- [Save Data] file="progress" ← score=100, level=3
-- ...later session...
-- [Load Data] file="progress" → score → [Use Score]
-- → level → [Use Level]Key Dependencies
self.mgr.modules.file- flowgraph file module for persistent key/value storage
See Also
- Save Data (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide