API ReferenceGE Extensionsflowgraphnodesvehicle
Set Lights
- **Node Name:** `Set Lights`
Overview
- Node Name:
Set Lights - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/setLights.lua
Sets the front headlight state of a vehicle. 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 | number | Light mode to set |
Hard Templates for mode
| Value | Label |
|---|---|
0 | Off |
1 | On (low beams) |
2 | Highbeams |
Internals
Key Methods
| Method | Description |
|---|---|
init() | Empty initialization |
postInit() | Sets up hard templates for the mode pin (Off/On/Highbeams) |
work() | Resolves vehicle and executes setLightMode action via vehicle bridge |
How It Works
- On each tick, resolves the vehicle by
vehIdor falls back togetPlayerVehicle(0). - Calls
core_vehicleBridge.executeAction(veh, 'setLightMode', mode)with the selected mode. - Mode 0 = off, 1 = headlights on, 2 = high beams.
Usage Example
-- In a flowgraph - turn on headlights:
-- [Vehicle ID] → [Set Lights].vehId
-- [Number: 1] → [Set Lights].mode
-- Direct Lua equivalent:
local veh = getPlayerVehicle(0)
core_vehicleBridge.executeAction(veh, 'setLightMode', 1) -- headlights on
core_vehicleBridge.executeAction(veh, 'setLightMode', 2) -- high beams
core_vehicleBridge.executeAction(veh, 'setLightMode', 0) -- offKey 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