Mallets's Forum Posts

  • The format is:

    System: Compare two values:

    health = 7 | health = 8

    = Equal to

    1

    Thank you for this simple explanation! One last thing, when you say "equal to 1" , is this a universal "construct 2" thing for being active (or in this case, that the condition is true)? Or is the 1 referring to some project component we need to define ourselves?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, thanks for reading my post! I'm wondering if anyone can shed some light on the OR expression using the pipe |.

    I know that we can make an or block inside of a condition, for example, using "health" as a global variable:

    [quote:z7vo2xe1]If health = 8

    OR

    If health = 7

    --> Display 4 hearts on HUD

    But I'm looking at the OR expression and trying to figure out what's different about it. Take the same instance as above, but with:

    [quote:z7vo2xe1]If health = 7|8

    --> Display 4 hearts on HUD

    This second expression, at least from what I'm reading, should return 4 hearts on the HUD if either condition is true, i.e., if hearts are 7 OR hearts are 8. However, I've found that this second example doesn't do anything, so I'm assuming that this pipe expression is actually different from using an OR block in the condition. The construct manual says

    [quote:z7vo2xe1]| is a logical OR operator. These are useful combined with the comparison operators, e.g. score < 0 | health < 0, which also return 1 if true and 0 if false.

    so it sounds like I can get this result using "compare 2 variables" in the system conditions as well, but not the way the second example is shown above.

    Thank you!