Summary
The Lightbar controller can be used to implement custom lightbar flash patterns. Also allows the definition of multiple flashing modes that you’ll be able to cycle through.
File Info
Filename | lightbar.lua |
Path | /lua/vehicle/controller/lightbar.lua |
Type | Auxiliary |
Usage type | Multiple |
JBeam Properties
See the lightbar mode
section for more info on the different parameters available.
lightbarMode
See the light mode pattern
section for more info on the different parameters available.
lightbarModePattern
Public Functions
Function name
Parameters
Description
Function name
toggleMode()
Parameters
Description
Toggles between available lightbar modes
Example Usage
"controller": [
["fileName"],
["lightbar"]
],
"lightbar": {
"defaultModeIndex": 1,
"modes": [
["name", "config"]
["Left Signal", [
["electric", "value", "duration"],
["blue_3", 1, 1.0],
["blue_2", 0, 0.1],
["white_2", 0, 0.2],
["blue_1", 0, 0.3],
["red_1", 0, 0.4],
["white_1", 0, 0.5],
["red_2", 0, 0.6],
["red_3", 0, 0.7],
["blue_3", 0, 0.0],
["blue_2", 1, 0.9],
["white_2", 1, 0.8],
["blue_1", 1, 0.7],
["red_1", 1, 0.6],
["white_1", 1, 0.5],
["red_2", 1, 0.4],
["red_3", 1, 0.3],
],
],
["Right Signal", [
["electric", "value", "duration"],
["red_3", 1, 1.0],
["red_2", 0, 0.1],
["white_1", 0, 0.2],
["red_1", 0, 0.3],
["blue_1", 0, 0.4],
["white_2", 0, 0.5],
["blue_2", 0, 0.6],
["blue_3", 0, 0.7],
["red_3", 0, 0.0],
["red_2", 1, 0.9],
["white_1", 1, 0.8],
["red_1", 1, 0.7],
["blue_1", 1, 0.6],
["white_2", 1, 0.5],
["blue_2", 1, 0.4],
["blue_3", 1, 0.3],
],
],
],
}