Unsolved "scaleOutputTorque" in engine lua permanent?

Discussion in 'Mod Support' started by ItsTheLittleAcura!, May 21, 2022.

  1. ItsTheLittleAcura!

    ItsTheLittleAcura!
    Expand Collapse

    Joined:
    Feb 9, 2018
    Messages:
    113
    I'm developing a cylinder deactivation system for the 4.4 V8 Wendover based on a custom engine lua file. While trying to figure out how to simulate cutting off half the engine, I stumbled across the "scaleOutputTorque" function. Added a call to that function in my lua, and it partially works. During low-load cruising, half of the engine will shut off. However, stepping hard on the accelerator doesn't reactivate all 8 cylinders as it should. The Wendover is extremely sluggish accelerating, as it is essentially a 2.2-liter inline-4.
    In addition, cylinder deactivation doesn't cause the horrible exhaust boom that I expected to hear (I coded a muffling reduction in as well)

    Uploaded the file, can someone take a look?
     

    Attached Files:

  2. angelo234

    angelo234
    Expand Collapse
    Junior Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    433
    Sorry for the late solution but instead of using that scaleOutputTorque function, use this instead to scale the torque:
    Code:
    -- 100% torque
    device.outputTorqueState = 1.0
    
    -- 50% torque
    device.outputTorqueState = 0.5
    And in terms of cylinder deactivation, well BeamNG doesn't simulate that yet so yeah that's why you don't get any realistic sound effects. The only thing this code does is scale the output torque.
     
  3. ItsTheLittleAcura!

    ItsTheLittleAcura!
    Expand Collapse

    Joined:
    Feb 9, 2018
    Messages:
    113
    I understand that, that's exactly what I'm trying to ADD. Proper cylinder deactivation, plus the annoying exhaust boom. I reworked my code, now it works right. I need to figure out how to dynamically reduce the exhaust muffling to introduce a droning exhaust note.
     
  4. TMccanna

    TMccanna
    Expand Collapse

    Joined:
    Jan 16, 2022
    Messages:
    341
    its even more realistic if you make it not work like the v864 irl
     
  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