(Solved) Is it possible to set a JBeam variable via lua?

Discussion in 'Programming' started by DaddelZeit, Aug 6, 2021.

  1. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    3,085
    As the title says, I'd like to know if it's possible to set a jbeam variable via lua. I'm trying to make the brakes of a vehicle (the semi, specifically) "fail" by setting the overall brake strenght to 0.
    If not, how would I go about such an idea?
     
  2. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    7,118
    I've heard it is possible to get the value of the variable, maybe it's possible to set it too but no idea how.
     
  3. DaddelZeit

    DaddelZeit
    Expand Collapse

    Joined:
    Jul 17, 2019
    Messages:
    3,085
    Yeah, I've read a thread saying that it is possible which is where I got the idea to set a variable from :D
     
  4. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    No, that's not possible. These variables are handled as one of the first steps when parsing the vehicle, they have no meaning after initialization.
    You would have to instead adjust whatever the actual variables affect. In the brake example that would be the brakeTorque property of the relevant wheels.
     
    • Like Like x 2
  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