How do I use both "And" and "Or" in the same condition box?

0 favourites
  • 7 posts
From the Asset Store
Punch the boxes as hard as you can and crush them all!
  • When selecting/deselecting the "or" block with conditions in an event block, you end up with either this:

    • On pressed Enter
    • Variable = 1
    • On Touched Object
      • Do stuff

    or this:

    • On pressed Enter Or
    • Variable = 1 Or
    • On Touched Object
      • Do stuff

    Is there any possible way to get this?:

    • On pressed Enter
    • Variable = 1 Or
    • On Touched Object
      • Do stuff
  • I use a local variable to achieve this i.e:

    On pressed Enter -and- Variable = 1 | LocalVar = 1

    On Touched Object -or- LocalVar = 1 | Do stuff

  • Use sub event to add an And block

    + On pressed Enter

    -- +Variable = 1

    -- Or

    -- +On Touched Object

  • rexrainbow can't put triggers on sub-events..

    I wouldn't use a local variable, either though. Best I can figure, just do it in two events.

    you could put the triggers together with the OR and then subevent the variable plus a check for which-- yeah, see.. just use two events..

  • ErekT Okay, that's a pretty simple workaround. Thanks! ^_^

    I hope Ashley adds some sort of "Condition Bracket" in a later update, to bypass the need for extra variables. Is there a way, or place where, I can suggest a feature request for this?

    rexrainbow What you're suggesting, mathematically, is:

    "On pressed Enter AND (Variable = 1 OR On Touched Object)"

    I'm looking for "(On pressed Enter AND Variable = 1) OR On Touched Object"

  • spacedoubt

    Uh, you are right. I miss it.

    Then I will split these two trigger and add another function trigger:

    + On pressed Enter

    + Variable = 1

    • call function "xx"

    + On Touched Object

    • call function "xx"
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • + On pressed Enter

    + Variable = 1

    - call function "xx"

    + On Touched Object

    - call function "xx"

    Even better! Just implemented this and it works great!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)