API ReferenceGE Extensionsflowgraphnodesvehicle
Get Vehicle Data
- **Node Name:** `Get Vehicle Data`
Overview
- Node Name:
Get Vehicle Data - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/vehicleMapData.lua
Provides vehicle position, direction, velocity, damage, and other properties from the map.objects data. This is the modern replacement for the legacy vehicleData.lua node.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | Vehicle ID. Falls back to player vehicle via be:getPlayerVehicleID(0). |
Output Pins
| Pin | Type | Description |
|---|---|---|
position | vec3 | Vehicle refnode position. |
dirVec | vec3 | Forward direction vector. |
dirVecUp | vec3 | Up direction vector (hidden). |
rotation | quat | Vehicle rotation quaternion (hidden). |
velocity | number | Speed in m/s. |
velocityVector | vec3 | Velocity vector (hidden). |
active | bool | Whether the vehicle is active (hidden). |
damage | number | Damage amount (not monetary). |
newAPIDamage | number | Damage from the new API (getSectionDamageSum()). |
Internals
Key Methods
| Method | Description |
|---|---|
init() | No-op. |
work() | Reads map.objects[vehId] for telemetry; uses isUsed() checks to skip unused outputs for performance. |
Performance Optimisation
This node checks pinOut.xxx:isUsed() before computing each output. Unused pins are skipped entirely, avoiding unnecessary vec3→table conversions.
How It Works
- Resolves the vehicle ID (falls back to
be:getPlayerVehicleID(0)). - Looks up the vehicle in
map.objectsfor position, direction, velocity, and damage. - Only computes and outputs values for pins that are actually connected.
- Uses
veh:getSectionDamageSum()for the new damage API output.
Usage Example
-- Flowgraph:
-- [Vehicle ID] → vehId → [Get Vehicle Data (Map)]
-- ↓ velocity → [Speed Check]
-- ↓ position → [Distance Calc]
-- ↓ damage → [Damage Monitor]
-- Equivalent GE Lua:
local data = map.objects[vehId]
local speed = data.vel:length()
local pos = data.pos
local dmg = data.damage
local newDmg = scenetree.findObjectById(vehId):getSectionDamageSum()Key Dependencies
map.objects- vehicle telemetry from the map systembe:getPlayerVehicleID(0)- player vehicle ID fallbackveh:getSectionDamageSum()- new damage API
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide