How do I use mathematical "or" | operator?

0 favourites
  • 10 posts
  • I red the manual. The "|" should act as "or" statement, but for some reason I can not get this to work.

    Example CapX: https://drive.google.com/open?id=0B5xC9 ... 0VqMncwclU

    I know you can add "or" statements to whole block, but this is not suitable for me because I need to check multiple chunks of conditions. If one of the chunks is true (all conditions met in that chunk of conditions) then do the action.

    Help appreciated, am I doing something wrong or is it a bug?

  • Add both (or more) if you're doing multiple and then right click on the far left of the conditions and select "Make 'or' block"

  • Add both (or more) if you're doing multiple and then right click on the far left of the conditions and select "Make 'or' block"

    As I stated in my post this is not the case I am looking for, it simply won't work for what I am trying to do. The capx file is just a simple example of how | operator is used (just like in the manual), not the project itself.

    How do I do this?

  • Sorry, should have read the whole thing. I'll download it and take a look

  • You 'should' be able to achieve the same result using an else-if and then putting the code into a function to save duplication.

  • Yeah I could add another "else" statement or mess around with nesting, its getting rather complicated this way. Why does the | not work? What am I missing?

  • Ok as I understand it the "|" operator is basically an if-else statement that returns 0 or 1. It does not work with just pure numbers, it only works with conditions? How I implement this to check an array value I have no idea.

    Did it your way, can't use array because there is no way of checking the array value in expression like you could do it with tilemap. So I used tilemap and came up with this:

    This is quite insane in my opinion, all because "or" could not be defined correctly.

    I would like to do the floor calculation beforehand and keep it in an array to save computation time since there is a lot to check like this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How I implement this to check an array value I have no idea..

  • *sigh* I overlooked the "At" function. Thank you!

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