API ReferenceGE Extensionsflowgraphnodesvehicle
Set Ignition
- **Node Name:** `Set Ignition`
Overview
- Node Name:
Set Ignition - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/setIgnition.lua
Sets the ignition mode for a vehicle. If no vehicle ID is given, the current player vehicle is used. Use the GetElectricsValue node to read the current ignition level.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of the vehicle to affect. If empty, uses player vehicle |
mode | number | Ignition mode to set |
Hard Templates for mode
| Value | Label |
|---|---|
0 | Off |
1 | Accessory Mode |
2 | Ignition On |
3 | Starter On |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Empty initialization |
postInit() | Sets up hard templates for the mode pin (0–3 ignition levels) |
work() | Resolves vehicle and executes setIgnitionLevel action via vehicle bridge |
How It Works
- On each tick, resolves the vehicle by
vehIdor falls back togetPlayerVehicle(0). - Calls
core_vehicleBridge.executeAction(veh, 'setIgnitionLevel', mode)with the numeric mode. - The ignition levels correspond to real vehicle states: off → accessory → ignition → starter.
Usage Example
-- In a flowgraph - turn off a vehicle's ignition:
-- [Vehicle ID] → [Set Ignition].vehId
-- [Number: 0] → [Set Ignition].mode
-- Direct Lua equivalent:
local veh = getPlayerVehicle(0)
core_vehicleBridge.executeAction(veh, 'setIgnitionLevel', 0) -- off
core_vehicleBridge.executeAction(veh, 'setIgnitionLevel', 3) -- starter onKey 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