API ReferenceGE Extensionsflowgraphnodesutil
GHOST (Flowgraph Node)
- **Node Name:** `GHOST`
Overview
- Node Name:
GHOST - Category:
logic - File:
extensions/flowgraph/nodes/util/ghost.lua - Hidden:
true- not shown in the node palette
A placeholder node that represents a deserialized node whose original type no longer exists. When a flowgraph references a node type that has been removed or renamed, the ghost node preserves the original data.
Pin Schema
No pins defined. The ghost node is inert.
Internals
Key Methods
| Method | Description |
|---|---|
init() | Sets formerNodeType to "NOT GHOST" |
work() | Empty - does nothing |
drawMiddle(builder, style) | Displays the former node type name and a "Dump ghost data" button |
__onSerialize() | Returns the stored ghostData for re-serialization |
_onDeserialized(nodeData) | Sets an error, stores original type name, extracts short name, saves raw node data |
How It Works
- When a flowgraph file is loaded and a node type cannot be found, the engine creates a GHOST node instead.
_onDeserialized()is called with the original node data:- Sets a
workerror indicating the node type doesn't exist. - Stores the original type name in
formerNodeType. - Extracts the last path component for the display name (e.g.,
[GHOST]myNode). - Preserves all original data in
ghostData.
- Sets a
- If the flowgraph is re-saved,
__onSerialize()returns the original data, allowing recovery if the node type is restored.
Usage Example
-- Ghost nodes are not manually created. They appear automatically when:
-- 1. A mod removes a custom node type
-- 2. A flowgraph file references a node that was renamed
-- 3. A project is loaded in a version missing certain nodes
-- To debug ghost data in the editor:
-- Click the "Dump ghost data" button in the node's middle area
-- The original node data will be printed to the console via dump()Key Dependencies
_flowgraph_createNode()- standard node registration- Flowgraph deserialization system - triggers ghost creation for missing types
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide