Profile image

Funky tree list of elements

1,426 Huax  3.4 years ago

How can I create a list of element such that when the input condition is part of the list, theoutput is x and otherwise the output is y?

I can’t create a full condition each time I employ a boolean operator, since that makes my codes hundred lines long.

  • Log in to leave a comment
  • Profile image
    4,287 Formula350

    @Sadboye12 hah Nopers. Huax had kindly answered (and solved) my question that I --albeit mistakenly-- thought was similar to his own... So I wanted to return the favor by trying to find some folk who may be able to answer their question... ^_^
    .
    Hopefully, then, your A ? B = C comment is indeed in relation to Huax's situation and not mine. lol
    Thanks for responding!

    3.4 years ago
  • Profile image
    67.1k SnoWFLakE0s

    @Formula350
    .
    GearDown is a lot more intuitive.
    Quite simply, if the gear is down, GearDown = true, and if the gear is up, GearDown = false.
    .
    The same applies for Activation Groups.
    To take an example with AG1, if the AG1 is on, Activate1 = true, and if AG1 is off, Activate1 = false.
    .
    Basic Funky Trees documentation and guides are available at the FT guide page.

    +1 3.4 years ago
  • Profile image
    52.8k Sadboye12

    @Formula350 i legit thought this was your post lmao

    3.4 years ago
  • Profile image
    52.8k Sadboye12

    you can use ternary operator which is A ? B = C
    if A true then B else C
    i hope this is what you are truly lookin for or i may have miss understood your question

    soo you can put conditions in A, and in B will be the Input if the conditions are met, if the conditions are not met the input will be C

    +3 3.4 years ago
  • Profile image
    4,287 Formula350

    @edensk or @Sadboye12 Do either of you gurus happen to know the answer to Huax's question/issue? :}

    +1 3.4 years ago
  • Profile image
    4,287 Formula350

    @Huax Either I'm a complete idiot, or the Input entry was definitely NOT there when I originally added them... O_O
    I went to add your code just now, and lo and behold, there was "Input" already there, with None set....
    I feel like I'm losing my mind lol
    .
    Either way... Thank you! :)

    3.4 years ago
  • Profile image
    1,426 Huax

    @Formula350 Use input=
    1-LandingGear for you beacon, the code is simple, when enabled it’s 1, disabled is -1

    The only reasonI asked this simple question is because my code is getting 100 lines long

    +1 3.4 years ago
  • Profile image
    4,287 Formula350

    *grumbles* Note to Self: do not upvote before submitting comments, as said typed text will be lost due to the page freshing... :\


    This kind of sounds like the question I was asking myself yesterday!
    In my case I was needing to have it so performing an action would toggle a Beacon. Specifically, if the Landing Gear is down the beacon is On, and if the gear is up the beacon is Off. (whether it's relevant, I was specifically using LandingGear input, not GearUp or GearDown since that's beyond me currently.)
    .
    My only worry is that FunkyTrees may not even be able to define whether an AG is Enabled or Disabled... <_>

    3.4 years ago