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
brake_input
Units/Values
0 to 1
Description
Brake input.
Name
clutch
Units/Values
0 to 1
Description
Clutch output.
Name
clutch_input
Units/Values
0 to 1
Description
Clutch input.
Name
horn
Units/Values
0 or 1
Description
Indicates the horn is active.
Name
parkingbrake
Units/Values
0 to 1
Description
Parking brake output.
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 accounting for the in-game assists.
Name
steeringUnassisted
Units/Values
Degrees
Description
Angle of the steering wheel.
Name
steering_input
Units/Values
-1 to 1
Description
Steering input.
Name
throttle_input
Units/Values
0 to 1
Description
Throttle input.

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
brakelights
Units/Values
0 or 1
Description
Brake output with account for ABS flashing.
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
highbeam_wigwag_R
Units/Values
0 or 1
Description
Right police wigwag headlight. Controlled by normal highbeam values if lightbar is off, and if it’s on, only the wigwag signal has control.
Name
highbeam_wigwag_L
Units/Values
0 or 1
Description
Left police wigwag headlight. Controlled by normal highbeam values if lightbar is off, and if it’s on, only the wigwag signal has control.
Name
lightbar
Units/Values
0, 1 or 2
Description
Indicates the current police flashing/beacon lights mode (0 is off, 1 is lights, 2 is lights + siren).
Name
lights
Units/Values
0, 1 or 2
Description
index of the current light mode (0 is off, 1 is lowbeams, 2 is highbeams).
Name
lights_state
Units/Values
0, 1 or 2
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
parkingbrakelight
Units/Values
0 or 1
Description
Parking brake output with account for ABS flashing.
Name
reverse
Units/Values
0 or 1
Description
Indicates a reverse gear is selected.
Name
reverse_wigwag_R
Units/Values
0 or 1
Description
Right police wigwag reverse light. Controlled by wigwag signals in forward and neutral gears and reverse lights in reverse gears.
Name
reverse_wigwag_L
Units/Values
0 or 1
Description
Left police wigwag reverse light. Controlled by wigwag signals in forward and neutral gears and reverse lights in reverse gears.
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
accXSmooth
Units/Values
m/s^2 (meters per second squared)
Description
Acceleration of the vehicle on the X axis.
Name
accYSmooth
Units/Values
m/s^2 (meters per second squared)
Description
Acceleration of the vehicle on the Y axis.
Name
accZSmooth
Units/Values
m/s^2 (meters per second squared)
Description
Acceleration of the vehicle on the Z axis.
Name
airflowspeed
Units/Values
m/s (meters per second)
Description
Speed of the vehicle compared to the airflow, taking into account wind.
Name
airspeed
Units/Values
m/s (meters per second)
Description
Speed of the vehicle compared to the world.
Name
altitude
Units/Values
meters
Description
Altitude of the vehicle.
Name
avgWheelAV
Units/Values
rad/s (radians per second)
Description
Average angular velocity of the vehicle’s wheels.
Name
boost
Units/Values
PSI
Description
Current forced ignition boost.
Name
boostMax
Units/Values
PSI
Description
Maximum achievable forced ignition boost.
Name
electricalLoadCoef
Units/Values
0 to 1
Description
Electrical load used by things like the starter.
Name
fuel
Units/Values
0 to 1
Description
Ratio of fuel left to max fuel.
Name
gear
Units/Values
string
Description
Displayed gear.
Name
gearIndex
Units/Values
number
Description
Engaged gear, reverse gears are negative numbers and neutral is 0.
Name
gearboxMode
Units/Values
string
Description
Selected gearbox mode.
Name
hasABS
Units/Values
true or false
Description
Whether the vehicle is equipped with an anti-lock braking system.
Name
ignitionLevel
Units/Values
0, 1, 2 or 3
Description
0 = ignition off, 1 = accessory only, 2 = ignition on, 3 = engine fired up.
Name
lowfuel
Units/Values
0 or 1
Description
Indicates the vehicle is running on less than 10% of its max fuel.
Name
lowpressure
Units/Values
0 or 1
Description
Indicates a tire is deflated.
Name
odometer
Units/Values
meters
Description
Vehicle odometer level.
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
running
Units/Values
0, 1 or false
Description
0 = ignition off, 1 = ignition on, false = vehicle has no ignition system.
Name
trip
Units/Values
meters
Description
Vehicle trip counter level.
Name
wheelspeed
Units/Values
m/s (meters per second)
Description
Speed of the car measured at the wheels.

Other

Name
Units/Values
Description
Name
nop
Units/Values
0
Description
Always equals 0.
Last modified: December 10, 2024

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.