So, my question is as follows. if I want a tuning option that creates a specific value, but I want an option which adds a modifier to said value when toggled on, how would I do that? I basically need "$=$value1 + 0.25 * $value2" so if we call Value1 "A" and Value2 "B" I need A = A +(0.25 x B) so if B = 1 then it'll add 0.25 to A but if B = 0 then the Value of A = A unchanged. I want to do this without accidently making A = 0 How can I self contain that in Json/Jbeam? Please ignore the odd use of uppercase on the "$Tuning" variable.
according to https://documentation.beamng.com/modding/vehicle/sections/variables/ : 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. ---however it doesn't say anything about multiple operations in a single $=Function call. I cannot test atm, but you might try creating a temp variable: $valueTemp:"$=value1 + 0.25" $value1:"$=valueTemp * value2"
"$=case(($value1 + 0.25 * $value2)==0, $value1 + 0.25 * $value2, $value1)" I believe this will work but the way you worded the message is very confusing so idk if that is what you need
- Another question. I cannot find this in BeamNG's documentation on Jbeam But if you don't specify a value for "dampCutoffHz" does it just default to 2000hz? (physics engine max?) Or what is the default value? 1000hz?