Hello, I was wondering how to make a air brake deploy above 620 knots IAS. I tried using this "IAS>619" as the input for the air brake but it did not work. Any tips? I also was wondering how to make an engine that stops working above 40,000 feet from sea level.
Use a timer system for the airbrake
smooth(IAS>319 ? 3 : 0, IAS>319 ? 999 : 1) > 0.01
.
For the engine, you could use a hard cutoff
Throttle * clamp01(Altitude<12192)
.
But is usually better to create a smooth curve if you have one
@ItsMENightmare Technically yes, though it would be more complicated than probably necessary (assuming that the problem you're having is the airbrake flapping on and off several times per second to avoid exceeding 620 knots).
To fix the above issue I'd recommend using something like this:
(IAS>319) ? ((IAS-319) / 5.15) : 0
This will make the airbrake gradually deploy as the speed exceeds 620 knots (319 m/s), becoming fully deployed at 630 knots (319 + 5.15 m/s), creating a much smoother braking application. You can modify the values as you see fit and I can give a more detailed explanation of how that formula works if you want, but this should make a much smoother airbrake than what you're currently using.
If you specifically want the airbrake to snap open at 620 knots and then remain open for three seconds after slowing down below that speed (like, if that's a design element you're going for or something), I can probably figure that out too but it'll be a much more complex piece of code.
@HuskyDynamics01 Is there also a way to have it so once it's triggered it stays on for like around 3 seconds after the speed lowers.
@HuskyDynamics01 Ah right I forgot thank you.
Funky Trees reads in meters per second, so you'd need to convert knots to that first.