Profile image

Coding for a Two-Stage afterburner?

1,063 Conjure76  19 hours ago

Hello.

The question lies within the name. What I am trying to do is creating an engine piece that activates at one throttle percent and turns off at another.

The code which I am working with is: .5<Throttle<.89

This has proven a disaster, the engine parts works, uh, not well. I have managed to make an engine start on a certain throttle, but turning off is an impossible task. This code is for the first stage of the afterburner, as the second with be a simple task.

Any and all help will be appreciated.

  • Log in to leave a comment
  • Profile image
    743 griges

    try
    if 50% : 50%
    in the 1st engine input

    Throttle<0.5? clamp(Throttle,0,0.5) : 0

    2nd engine

    Throttle>0.5? clamp(Throttle,0.5,1) : 0

    thats if each input from 50%, 1st engine will start at 0% power to 50% and 2nd engine will start at 50%power to 50%

    if you want both engine to start at 0% power and ends in 100% power but still 50:50 Throttle input, change the clamp(Throttle) to
    1st engine invereselerp(0,0.5,Throttle)
    2nd engine inverselerp(0.5,1,Throttle)
    with the rest of the FT same

    Pinned 17 hours ago
  • Profile image
    743 griges

    awesome 😁 i dont mind credit or not
    i just like learning FT.
    i wanna see what you make, whaTever it is 😂

    +2 16 hours ago
  • Profile image
    1,063 Conjure76

    @griges works flawlessly. Thank you, I shall credit you on aircraft that use your method. As an aside, I need to sit down one day and let funky trees. Once again, thank you. Oh, yes, one more thing, the code was only ever intended for visual effects, I'll use a completely different engine internally to create the last 10 percent of thrust.

    +2 16 hours ago
  • Profile image
    743 griges

    ah i see, first afterburner is from 0.5 to 0.89 , and second afterburner is 0.9 to 1?
    i prefer the one with inverselerp so the engine didnt start from high power suddenly but the second afterburner will be quite high power since it work only with the 10% of the throttle
    but try it
    and lmk if it work or not

    +2 16 hours ago