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
Optional arguments
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.
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"}],
],