So I wanted to have a "Master Caution" lamp light up when the Gear is down at a speed above 400KM/H (111m/s). Since Funky Trees doesn't quite support comparison operators I had to do a bit of a work around:
upcoming plane cockpit teaser~
Notice: The above will either output 0 or itself. For beacons this is fine because they activate when input=/=0
.
There's probably easier ways to do this (I often overcomplicate things), so feel free to leave suggestions/correct me in the comments.
EDIT: The "-0.5" part is not actually needed for the intended functionality. It is there for the case that GS=111m/s (exactly), but even so the value returned is still > 0.
UPDATE: This code is obsolete now since the newer version of SP and hence "upgraded" FT code came out. Inequality symbols are now a thing.
@SnoWFLakE0s The point is to have a warning if you take off and forget the gear down. All aircraft have this in real life.
@FlipposMC
.
If you wanted, you could also make it such that gear just wont deploy above a certain speed- that might be more useful.
@JohnnyBoythePilot
.
Any part with an
inputController
class, under the attributeinput
.@FlipposMC
K but where exactly in the input section & what part(s)?
Nice. Good work!
@JohnnyBoythePilot In Overload, under the "input" section.
@spefyjerbf Rotators that moved wing sections that are themselves also a control surface.
Awesome! I knew it would be nice for a VTOL engine, but I’m assuming that you made it work for control surfaces too?
So how does this "funky trees" thing exactly work? I get its code but where do I conduct all this coding?
@spefyjerbf Believe it or not the Autoland code I was working on looks very similar to your descend code if not identical, with the exception that I'm trying to use "AltitudeAgl" to make my aircraft flare at the end.
@Type2volkswagen Yes as the "AltitudeAgl" data is...well the altitude above ground level. I tested it out and 100m is indeed a little too low so you definitely want to bump that up. One important thing to note is that the Final approach for Yeager and Bandit spawn you above water. This means that if you set the gear to come down at a threshold of say 200m Agl it will only come down once you are above the terrain. There is no way around this airport-specific problem, other than bumping up the Agl threshold or just using "Altitude" in place of "AltitudeAgl" and setting it to always come down at like 700m.
Very nice. I had a slightly different approach to comparison. The inclusion of the xor operator is really useful!
@FlipposMC will this account for the different heights of runways ? (Wright vs Yeager)
@FlipposMC yeah that's the problem currently.
.
the funky tree in SR2 looks nicer imo. Wonder when they're going to implement it to SP
@CrashFighter05 Here is the code you require:
clamp((AltitudeAgl / 2) * (1 - sign(AltitudeAgl - 100 - 0.5)), 0, 1)
This will output "1" if the height above ground is < 100m and 0 otherwise. (Change it to your desire).
@exosuit edited my response, was in a hurry so I didn't clarify stuff.
Yes you can use v<x
No, it seems you can't use it in addition to FunkyTrees (in the same input field).
@FlipposMC didn't dllama made the autoflap on his cropduster plane using v< (speed) in the input?
.
afaik it has existed before 1.9 was out
@exosuit To detect the speed being above a certain number as you say, of you plan on using FunkyTrees I believe you still need to do something similar to what I did, because FunkyTrees doesn't really support comparison operators (>,<) as of yet.
If something like "v<300" IS your ONLY input it will work, yes. But as you said it requires two pistons.
TLDR; The v<x Feature seems to not be compatible with FunkyTrees as part of an equation, but on its own it is.
@FlipposMC now I feel stupid i had no clue what you were talking about.
i hate it when i have to think (i haven't learned or experimented with it anyways) so what i'd do would be attaching the beacons to two pistons. one piston will extend by half if a condition is met (let's say it's the landing gear input), and another one if the speed is above certain number).
.
If both conditions are met, then the piston would extend fully and make the warning to go off.
.
it surely requires alot more parts but i think it sounds simpler for me
@CrashFighter05 If you used AltitudeAgl you'ld just have to add something that will change the output data from AltitudeAgl to 1 if the input is =/= 0. I believe a clamp should work?
You could probably make it to where the landing gear automatically extends below 500 feet or something like that. I'm gonna try to make this now.
funky