Solved RealTime Tyre pressure [Vehicle Lua]

Discussion in 'Mod Support' started by aljowen, Sep 16, 2019.

  1. aljowen

    aljowen
    Expand Collapse

    Joined:
    Oct 21, 2012
    Messages:
    1,677
    Does anyone know the stream to get realtime tyre pressures from?

    So far I have got to:
    Code:
    wheels.wheels[0].something
    Dumping lists ".pressurePSI" as a value, but dumping "wheels.wheels[0].pressurePSI" returns a nil value.

    However, with that said, wheels.lua doesn't seem to make any reference to tyre pressures. So I have no idea if I am heading in the right direction?

    The other issue I have had is that I can't view all of the outputs from the dump, because BeamNG culls the log too soon. So I have been having to try and guess my way along.

    Thanks for any help :)
     
    • Like Like x 1
  2. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    I don't know if this is of any help but have you seen this code in the advancedwheeldata.lua ?

    Code:
     local hasPressure = wd.pressureGroup and v.data.pressureGroups and v.data.pressureGroups[wd.pressureGroup]
        wheelData.pressure = hasPressure and obj:getGroupPressure(v.data.pressureGroups[wd.pressureGroup]) * 0.000145038 or 0
    After all it has a call on obj:getGroupPressure or am I wrong ?
     
    • Informative Informative x 1
  3. aljowen

    aljowen
    Expand Collapse

    Joined:
    Oct 21, 2012
    Messages:
    1,677
    I think you nailed it with that one.

    Yep, works perfectly
    screenshot_2019-09-17_13-55-14.png
     
    #3 aljowen, Sep 17, 2019
    Last edited: Sep 17, 2019
    • Like Like x 2
  4. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hey that's cool ! Nice work :)
     
    • Like Like x 1
  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