Profile image

Is there a easy way to check if a value is increasing or equal to 1?

11.6k JesusChrist  2.7 years ago

Something like: Value <increasing> | Value = 1 ? Value : OtherValue

The correct code probably involves some function i don't understand.

  • Log in to leave a comment
  • Profile image

    rate(input) > 0 | input = 1

    Just in case anyone stumbles across this on the future.

    1.8 years ago
  • Profile image
    11.6k JesusChrist

    @V lol

    2.7 years ago
  • Profile image
    37.2k V

    @Korzalerke I'm blind

    +1 2.7 years ago
  • Profile image
    11.6k JesusChrist

    @V What problem? I literally just showed you the code i used to fix it.

    2.7 years ago
  • Profile image
    37.2k V

    @Korzalerke I'm not knowledgeable enough to solve your problem. The FT lab discord server would be able to help more. The invite is in the pinned forum post

    2.7 years ago
  • Profile image
    11.6k JesusChrist

    @V Here's the code i used, it's a bit more complicated than just "Brake+VTOL".

    2.7 years ago
  • Profile image
    37.2k V

    @Korzalerke just do
    Brake+VTOL as the input

    2.7 years ago
  • Profile image
    11.6k JesusChrist

    @V The reason i wanted that code is so i could try using the flaps on my plane as the airbrakes but it didn't work out so i did it a different (and very complicated) way involving adding a extra variable and modifying two existing ones.

    2.7 years ago
  • Profile image
    37.2k V

    @Korzalerke try something like this

     sum(X) >= 0 ? Y : Z
    

    I have it equal to 0 as (im pretty sure anyway) sum(X) will be treated as a 0 if there is no change in the value

    The value will not have to equal 1 if your just trying to see if it is changing or not

    2.7 years ago
  • Profile image
    11.6k JesusChrist

    @V I know that part, the problem is that i also need to check if the value is increasing or not.

    2.7 years ago
  • Profile image
    37.2k V

    X = 1 ? Y : Z

    If X equal 1, the output will be Y. If it is not 1, the output will be Z

    Though if you just want to see the value, you could open up the dev console and type in: DebugExpression (Value)

    2.7 years ago