API ReferenceGE Extensionsflowgraphnodesvehicle
Get Gearboxmode
- **Node Name:** `Get Gearboxmode`
Overview
- Node Name:
Get Gearboxmode - Category:
once_f_duration - File:
extensions/flowgraph/nodes/vehicle/getGearboxMode.lua
Gets the current gearbox mode of a vehicle (e.g. automatic, manual, sequential). Uses an async request through the vehicle bridge and waits for the response.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle. Defaults to player vehicle |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | any | The gearbox mode value |
Internals
Key Methods
| Method | Description |
|---|---|
init() / _executionStarted() | Reset via onNodeReset() |
onNodeReset() | Clears receivedInfo and sets duration to inactive |
workOnce() | Sends an async request via core_vehicleBridge.requestValue(veh, callback, "mainController", "gearboxMode") |
work() | Checks if receivedInfo has been populated by the callback; if so, outputs it and sets duration to finished |
How It Works
workOnce()resolves the vehicle and sends an async request to the vehicle's main controller for its gearbox mode.- The callback stores the result in
self.receivedInfo. - Each frame,
work()checks if the response has arrived. - When available, it outputs the value, clears
receivedInfo, and sets duration tofinished.
Usage Example
-- In a flowgraph:
-- [Get Gearboxmode] → value → [String Compare "arcade"] → [Is Automatic]
-- Programmatic equivalent:
local veh = getPlayerVehicle(0)
core_vehicleBridge.requestValue(veh, function(val)
print("Gearbox mode:", val.result)
end, "mainController", "gearboxMode")Key Dependencies
core_vehicleBridge.requestValue()- sends an async request to a vehicle controller and invokes a callback with the result
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