Update added something to jbeam expressions

Discussion in 'Content Creation' started by R4NKING, Dec 10, 2019.

  1. R4NKING

    R4NKING
    Expand Collapse

    Joined:
    Oct 14, 2016
    Messages:
    558
    What exactly does that mean? It sounds very interesting but i don't understand how that should work :confused:
     
  2. Goosah

    Goosah
    Expand Collapse
    Global Moderator
    BeamNG Team

    Joined:
    Aug 30, 2013
    Messages:
    790
    An example of use is in our race brakes. Because we only want the brake bias to be tuneable with the full race brake setup, but the user can add only front or rear race brakes if they want, we used in the rear brake part:

    {"brakeTorque":"$=$brakebias == nil and $brakestrength*1000 or $brakestrength*4000*(1-$brakebias)"}

    This way, if the front race brakes (which initialize the $brakebias variable) are not present, it doesn't try and fail to do the math with that variable.

    Using these logic operators mean you could make basically any parameter of jbeam dependent on some conditions (within the variable system) rather than just a regular math operations.
     
    • Like Like x 4
    • Informative Informative x 3
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice