API ReferenceGE Extensionsflowgraphnodesvehicle
Set Gearbox Mode
- **Node Name:** `Set Gearbox Mode`
Overview
- Node Name:
Set Gearbox Mode - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/setGearbox.lua
Sets the gearbox mode for a vehicle (e.g., arcade or realistic). If no vehicle ID is given, the current player vehicle is used.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to affect. If empty, uses player vehicle |
mode | string | Gearbox mode to set |
Hard Templates for mode
| Value | Description |
|---|---|
arcade | Arcade gearbox mode |
realistic | Realistic gearbox mode |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Empty initialization |
postInit() | Sets up hard templates for the mode pin (arcade, realistic) |
work() | Resolves vehicle and executes setGearboxMode action via vehicle bridge |
How It Works
- On each tick, resolves the vehicle by
vehIdor falls back togetPlayerVehicle(0). - Calls
core_vehicleBridge.executeAction(veh, 'setGearboxMode', mode)with the selected mode. - This sends the gearbox mode command to the vehicle's Lua environment.
Usage Example
-- In a flowgraph - set realistic gearbox:
-- [Vehicle ID] → [Set Gearbox Mode].vehId
-- [String: "realistic"] → [Set Gearbox Mode].mode
-- Direct Lua equivalent:
local veh = getPlayerVehicle(0)
core_vehicleBridge.executeAction(veh, 'setGearboxMode', 'realistic')Key Dependencies
core_vehicleBridge.executeAction(veh, action, ...)- sends actions to the vehicle Lua environmentscenetree.findObjectById()- resolves vehicle by IDgetPlayerVehicle(0)- gets the current player vehicle
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