Electrics

Electrics refer to all the information that is created by the vehicle’s systems for use by other systems and the jbeam itself, notably for things like hydros and props .

It includes mostly information about the vehicle’s status, things like the speed, the status of lights, engine information, etc. You can think of it as the network of sensors and switches that are connected to the car’s ECU.

You can see the current state of a vehicle’s electrics by choosing the current vehicle in the console and entering “dump(electrics)”

As electrics can have multiple sources, there is no definitive list of all the electrics. The main ones are available here, along with the vehicle controller page.

Most electrics are defined in base SI units, and will often need to be converted when using them for gauges and displays.

Electrics

These are the electrics which are managed by vehicleLua and not tied to specific controllers or drivetrain elements.

Vehicle controls

Name
Units/Values
Description
Name
horn
Units/Values
0 or 1
Description
Indicates the horn is active.
Name
parkingbrake
Units/Values
0 to 1
Description
Parking brake input
Name
parkingbrake_input
Units/Values
0 to 1
Description
Parking brake input
Name
reverse
Units/Values
0 or 1
Description
Indicates a reverse gear is selected.
Name
steering
Units/Values
Degrees
Description
Angle of the steering wheel.
Name
steering_input
Units/Values
-1 to 1
Description
Steering input percentage.
Name
throttle_input
Units/Values
0 to 1
Description
Throttle input percentage.

Lights

Name
Units/Values
Description
Name
brakelight_signal_R
Units/Values
0 or 1
Description
Combines the brake electrics with the signal_R electric. Lights up if either of those are on. Used for american style indicator/lights.
Name
brakelight_signal_L
Units/Values
0 or 1
Description
Combines the brake electrics with the signal_L electric. Lights up if either of those are on. Used for american style indicator/lights.
Name
fog
Units/Values
0 or 1
Description
Indicates the foglights are turned on.
Name
hazard
Units/Values
0 or 1
Description
Flashing function when hazards are on.
Name
hazard_enabled
Units/Values
0 or 1
Description
Indicates the hazards have been turned on
Name
highbeam
Units/Values
0 or 1
Description
Tells if the high beams are turned on.
Name
lightbar
Units/Values
number
Description
Indicates the current lightbar mode
Name
lights
Units/Values
number
Description
index of the current light mode (0 is off, 1 is lowbeams, 2 is highbeams)
Name
lights_state
Units/Values
number
Description
index of the current light mode (0 is off, 1 is lowbeams, 2 is highbeams)
Name
lowbeam
Units/Values
0 or 1
Description
Tells if the low beams are turned on.
Name
lowhighbeam
Units/Values
0 or 1
Description
Tells if either the low or high beams are turned on.
Name
lowhighbeam_signal_R
Units/Values
0 or 1
Description
Combines the lowhighbeam electrics with the signal_R electric. Lights up if either of those are on. Used for american style indicator/lights.
Name
lowhighbeam_signal_L
Units/Values
0 or 1
Description
Combines the lowhighbeam electrics with the signal_L electric. Lights up if either of those are on. Used for american style indicator/lights.
Name
parking
Units/Values
0 to 1
Description
Currently unused
Name
reverse
Units/Values
0 or 1
Description
Indicates a reverse gear is selected.
Name
signal_L
Units/Values
0 or 1
Description
Flashes if the left turn signal or hazards are turned on.
Name
signal_R
Units/Values
0 or 1
Description
Flashes if the right turn signal or hazards are turned on.
Name
signal_left_input
Units/Values
0 or 1
Description
Indicates the left indicator is selected.
Name
signal_right_input
Units/Values
0 or 1
Description
Indicates the right indicator is selected.
Name
turnsignal
Units/Values
0, 1 or -1
Description
Varies depending on which turn signal is selected (right is 1, left is -1)

Vehicle status

Name
Units/Values
Description
Name
airspeed
Units/Values
m/s (meters per second)
Description
Speed of the vehicle compared to the world.
Name
airflowspeed
Units/Values
m/s (meters per second)
Description
Speed of the vehicle compared to the airflow, taking into account wind.
Name
altitude
Units/Values
meters
Description
Altitude of the vehicle
Name
lowpressure
Units/Values
0 or 1
Description
Indicates a tire is deflated
Name
oil
Units/Values
0 or 1
Description
Indicates the oil temperature is greater than 130°C
Name
rpmTacho
Units/Values
rpm
Description
Smoothed engine speed value for use with tachometers
Name
rpmSpin
Units/Values
Degrees
Description
Spin function based on engine RPM. Used for spinning pulley props.
Name
wheelspeed
Units/Values
m/s (meters per second)
Description
Speed of the car measured at the wheels.
Last modified: January 7, 2022

Any further questions?

Join our discord
Our documentation is currently incomplete and undergoing active development. If you have any questions or feedback, please visit this forum thread.