API ReferenceGE Extensionsflowgraphnodesmission
Get Custom Vehicle Data (Flowgraph Node)
- **Node Name:** `Get Custom Vehicle Data`
Overview
- Node Name:
Get Custom Vehicle Data - Category:
once_instant - File:
extensions/flowgraph/nodes/mission/getCustomVehicleData.lua
Reads dynamic fields stored on a vehicle object and outputs them through custom pins. Supports user-created output pins of various types.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | Vehicle ID to read data from (fixed pin) |
Output Pins
Dynamic - user can add custom output pins of types: string, number, bool, any, table, vec3, quat, color.
Internals
| Field | Purpose |
|---|---|
self.savePins | Enables pin persistence across serialization |
self.allowCustomOutPins | Allows user to add custom output pins in the editor |
Allowed Pin Types
string, number, bool, any, table, vec3, quat, color (flow is not allowed).
How It Works
- On execution, the node looks up the vehicle by
vehIdviascenetree.findObjectById(). - It iterates through all non-fixed output pins and attempts to read matching dynamic fields from the vehicle.
- Built-in fields checked:
waypoints(table),routeSpeed(number),risk(number). - The node includes a
convertStringToTable()helper for parsing comma-separated strings into tables.
Note: The implementation appears incomplete - the generic pin iteration loop has an empty body, and only waypoints, routeSpeed, and risk are explicitly handled.
Lua Example
-- Set dynamic fields on a vehicle in the level editor:
-- vehicle.routeSpeed = "15"
-- vehicle.risk = "0.5"
-- vehicle.waypoints = "wp1,wp2,wp3"
-- This node reads them back:
-- routeSpeed output = 15 (number)
-- risk output = 0.5 (number)
-- waypoints output = {"wp1", "wp2", "wp3"} (table)Key Dependencies
scenetree.findObjectById()- vehicle lookup- Dynamic fields on
BeamNGVehicleobjects _flowgraph_createNode()- standard flowgraph node registration
Additional Methods
C:init()
Initializes the node, setting up pins and default properties.
C:workOnce()
Called once when the node is triggered (flow-once execution).
See Also
- ARunForLife (Flowgraph Node) - Related reference
- Update Display Drag Race (Flowgraph Node) - Related reference
- Clear Lights Drag Race (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide