Variables

Variables are used for all the settings that you’d like the user to have access to in the “Tuning” setting.

It typically includes things like fuel volume, multipliers for braking force and force feedback, as well as wheel alignement and suspension settings.

Using variables

Variables can either be used by themselves, or as part of a function. They can be used pretty much anywhere in the jbeam that uses a number as it’s entry value.

When using the variable by itself, simply put it’s full name in place of the number, making sure that it’s inside quotation marks like the example below.

"beamLimitDampRebound":"$desert_damp_rebound_IFS",

When using the variable inside a function, it will once again replace the number you’d use there usually. The function should start with $=. The entire function should be in quotation marks. See the example bellow for a case of using a function to adjust the Y coordinate of a node.

["fh2r", -0.65, "$=$caster_F*0.00175-1.2", 0.32],

It is very important to use the “$=Function” syntax, or else the parser won’t calculate the function correctly.

Required arguments

string
type
The internal name of the variable, that will be used when refering to your variable in the rest of your jbeam.
string
type
The type of variable.
“range” is the only supported type.
string
type
The units that will be shown in the tuning menu
Leaving this blank will result in the slider being from 0% to 100%, and won’t show the min and max values in the tuning menu.
string
type
The category under which the variable will appear in the tuning menu
This can be anything you want. When loading the car, the game will take all variables with the same category and group them together.
number
type
The default value of the variable
number
type
The minimum value of the variable
number
type
The maximum value of the variable
number
type
The name of the variable that will be shown in the tuning screen
string
type
A description that will be shown if the user hovers his mouse above the variable

Optional arguments

string
type
The sub-category under which the variable will appear in the tuning menu

This can be anything you want. When loading the car, the game will take all variables with the same category and sub-category and group them together.

This is often used to split Front and Rear variables.

number
type
The size of the steps on the slider
Leaving the Unit argument blank will result in the step being 1% which cannot be changed here.
number
type
Changes the visible minimum on the slider
Changes the minimum value displayed on the slider. The actual minimum used inside of jbeam will still be the one defined by “min”.
number
type
Changes the visible maximum on the slider
Changes the maximum value displayed on the slider. The actual maximum used inside of jbeam will still be the one defined by “max”.
boolean
type
false
default
Makes the variable invisible in the Tuning section
Useful for passing a value to be used in a function in another part of the vehicle. Said value can be a variable with “default”, “min” and “max” the same.

Simple Example

"variables": [
    ["name", "type", "unit", "category", "default", "min", "max", "title", "description"],
    ["$springheight_R", "range", "+m", "Suspension",  0, -0.04, 0.06, "Spring Height", "Raise or lower the suspension height"]
],

Advanced Example

"variables": [
    ["name", "type", "unit", "category", "default", "min", "max", "title", "description"],
    ["$damp_bump", "range", "N/m/s", "Shocks", 14000, 500, 20000, "Bump Damping", "Damper rate", {"stepDis":100, "subCategory":"Front"}]
    ["$damp_rebound", "range", "N/m/s", "Shocks", 6000, 500, 20000, "Rebound Damping", "Damper rate", {"stepDis":100,"subCategory":"Front"}]
    ["$bypass_reb", "range", "", "Shocks", 0.5, 0, 1, "Rebound Bypass", "Bypass", {"minDis":0, "maxDis":100, "stepDis":1, "subCategory":"Front"}],
    ["$bypass_bump", "range", "", "Shocks", 0.5, 0, 1, "Bump Bypass", "Bypass", {"minDis":0, "maxDis":100, "stepDis":1, "subCategory":"Front"}],
],
Last modified: 19/12/2023 19:35

Any further questions?

Join our discord