RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Align For CouplingApply Velocity to VehicleBoost VehicleSet Vehicle ColorsCustom Parts Config ProviderEnter VehicleFlip UprightFreeze VehicleGenerate License PlateGet Vehicle ActiveGet Electrics ValueGet GearboxmodeGet Powertrain DataGravity ForceDistance From GroundHas Coupler TagIs CoupledIs Player UsableKeep VehicleMove Vehicle ToOn Cannon FiredOn Vehicle DestroyedOn Vehicle ResetOn Vehicle SpawnedOn Vehicle SwitchedPlayer UsableRandom Config ProviderRecover In PlaceRemove VehicleTimeline ReplaySet Vehicle ActiveSet Gearbox ModeSet IgnitionSet License PlateSet LightbarSet LightsShift to Gear IndexSpawn VehicleVehicle StatesTeleport To Last RoadToggle Vehicle ControlsMove To ShowroomVehicle TouchProps TouchStatic Object TouchTrack VehicleTrailer Respawn ControlVehicle Config ProviderGet Vehicle DataGet Vehicle DataGet Vehicle BoundsVehicle PingGet Vehicle Wheel Center
Get Custom Vehicle ValueCustom vlua - deprecatedCustom Vehicle LuaVehicle ActionWheel Distance

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodesvehiclespecial

Get Custom Vehicle Value

- **Node Name:** `Get Custom Vehicle Value`

Overview

  • Node Name: Get Custom Vehicle Value
  • Category: (duration + once behaviour)
  • File: extensions/flowgraph/nodes/vehicle/special/customVehicleGetter.lua

Gets a custom value from a vehicle's Lua environment (e.g., ignition status, hazard lights). The outflow is delayed by a few frames because the value must round-trip through the vehicle Lua and back.

Pin Schema

Input Pins

PinTypeDescription
flowflowInflow for this node
resetflow (impulse)Resets the node so it can query again
VehIdnumberID of the vehicle. If empty, uses player vehicle

Output Pins

PinTypeDescription
flowflowFires once the value has been returned
valueanyThe raw returned value
valBoolboolThe value converted to boolean (for numbers: 0 → false, non-zero → true)

Internals

Built-in Functions

NameDescriptionVehicle Lua Path
IgnitionReturns the ignition statuselectrics.values.ignition
Hazard LightReturns the hazard light statuselectrics.values.hazard_enabled

Key Methods

MethodDescription
init()Sets default function to the first built-in
drawCustomProperties()ImGui dropdown to select which function to query
work()Sends the Lua query on first call, then waits for the returned value
_executionStarted()Resets returned value and done flag
getCmd()Builds the round-trip Lua command string
returnValue(value)Callback - deserializes the returned value from vehicle Lua

Round-Trip Mechanism

The node uses a two-step communication pattern:

  1. GE → Vehicle Lua: veh:queueLuaCommand(cmd) sends a command to read a value.
  2. Vehicle Lua → GE: The command serializes the value and sends it back via obj:queueGameEngineLua().
  3. The returned value is deserialized and stored in self.returnedValue.

The generated command looks like:

obj:queueGameEngineLua("local n = core_flowgraphManager.getManagerGraphNode(mgrId, graphId, nodeId) if n then n:returnValue('"..serialize(electrics.values.ignition).."') end")

How It Works

  1. On first work() call (when not done), sends the Lua query to the vehicle.
  2. Sets done = true to prevent re-sending.
  3. Waits for self.returnedValue to be populated by the returnValue() callback.
  4. Once the value arrives, sets output flow to true and populates value and valBool pins.
  5. The reset impulse clears done so the query can be re-sent.

Usage Example

-- In a flowgraph - check if ignition is on:
-- [Trigger] → [Get Custom Vehicle Value].flow
-- [Get Custom Vehicle Value] → (valBool) → [Branch]

-- The underlying round-trip pattern:
local veh = getPlayerVehicle(0)
veh:queueLuaCommand('obj:queueGameEngineLua("callback("..serialize(electrics.values.ignition)..")")')

Key Dependencies

  • veh:queueLuaCommand() - sends Lua code to the vehicle environment
  • obj:queueGameEngineLua() - sends Lua code back to the game engine
  • core_flowgraphManager.getManagerGraphNode() - retrieves a flowgraph node for callbacks
  • serialize() / deserialize() - value serialization for cross-environment communication

See Also

  • Custom Vehicle Lua (Flowgraph Node) - Related reference
  • Custom vlua - Deprecated (Flowgraph Node) - Related reference
  • Vehicle Action (Flowgraph Node) - Related reference
  • FlowGraph Guide - Guide

Fire

- **Node Name:** `Fire`

Custom vlua - deprecated

- **Node Name:** `Custom vlua - deprecated`

On this page

OverviewPin SchemaInput PinsOutput PinsInternalsBuilt-in FunctionsKey MethodsRound-Trip MechanismHow It WorksUsage ExampleKey DependenciesSee Also