Hello,
I'm trying to make a civil version of the Arado Ar-234 with the good ol' Jumo 004 engines but I'm trying to make an accurate flight model for it as well. That means, it's gonna be a bit of a pain to fly.
Does anyone know a variable that, if the engines are 95% or more power for longer than one minute, they overheat? Aka, health of the engines goes to 0%?
smooth(Throttle > 0.95, 0.017)
That's the basis of the code you want. The only flaw it has is the smooth keeps increasing or decreasing forever, so you'll want to clamp that in some way.
Well, the first thing is that there is no way to use guns except with FireGuns, so you cannot drop the health of engines
However, you can deactivate the engines.
Example code based on timer code:
sum(smooth(Throttle>=0.95?99:0, Throttle>=0.95?1:COOL_MUL) > 60 ?1:0) < 0.01
.
For cooling time multiplier COOL_MUL > 0
.
Smooth argument 2 is the max rate of change towards smooth argument 1.
Value inside sum() is 1 if the timer>60, 0 if timer<=60. This means sum() increases at 1/second only when timer>60.
Sum is compared against a small number 0.01. At first, sum() is 0. When timer>60, sum() will exceed 0.01 and deactivate your engine