[Solved] Actual turbo rpm not streamable ?

Discussion in 'Programming' started by NOCARGO, Jun 3, 2020.

  1. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hi,
    So here's my latest problem :
    1.png

    I am trying to send a value to that needle to get a readout of the actual turbo rpm. I thought this would be simple like : just assign "turboRPM" or "TurboRpmSpin" or "TurboSpin" to the prop being used to reflect it?
    Seems not possible, I have tried every value and code argument possible (the fore meantioned, curTurboAV, turbo whine values, turbo spin values, you name it) in the turbocharger lua file to get an actual turbo rpm readout but all they return is a value related to turbo pressure. I can literally see the gauge behaving similar to the turbo boost gauge, which is the volts gauge in this screenshot. Thus, so far I found none in the turbocharger lua. I also noticed that the updateSounds(dt) function isn't utilized (marked as 'nop' below) and that sound arguments sit the updateGFX function. The mysterious side to me is that I can hear the turbo whine when I keep my foot on the gas while the gauge drops down along with the boost. I don't see where the connection between turbo whine sound and the turbocharger lua file is, I mean, the vars are there (in initSounds) but those values reflect in boost behavior on my gauge. I'm determined to get it working by necessarily write my own code but this would be a waste if there is a logical explanation. I understand that the rpm and spin related values and (code arguments) don't have to be directly related to an actual readout but then I would love to know how the turbo whine sound knows how to behave. Am I wrong if I think that actual live turbo revolutions are not streamable ?
     
  2. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Hey,

    a few quick notes. The electrics value you need to use for your prop is simply "turboRPM". I know you already tried that, but believe me, it's the correct one ;)
    There might be a confusion though, you say that RPM is related to turbo pressure, now, why wouldn't it? I think you are looking at the correct thing without realizing it.

    As for the sounds, you also found that one, hiss and whine are indeed controlled by the updateSounds method. In this case you missed that while the public interface for this method starts out nop'ed it isn't anymore after successful init. Take a look at the last lines of the init method and you'll understand. :)
     
  3. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hey !! Well, in the meantime I found the solution, I was wrong about the whole case ! I screwed up inertia and whine pitch settings in the jbeam. (hence a false readout)

    This I still need to figure out indeed, thanks a bunch for explaining :)

    edit OH ! I see now !
    init()
    M.updateGFX = updateGFX
    M.updateFixedStep = updateFixedStep
    M.updateSounds = updateSounds

    Very clever :D :D :D
     
    #3 NOCARGO, Jun 4, 2020
    Last edited: Jun 4, 2020
  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