why this OR expression wo'nt work

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • using OR in the expression editor is different to the OR condition in the event editor (the working solution [MENTION=16146]Lukiester[/MENTION] posted)

    in the expression editor, OR uses logic operators, a special way of performing simple logic checks

    the OR operator checks to see if two values are at least a 1, that is:
    0 OR 0 = 0
    1 OR 0 = 1
    0 OR 1 = 1
    1 OR 1 = 1

    as far as I can tell, Fusion treats numbers >1 the same as a 1 in logic operations - meaning "Edit Value == 0 OR 1 OR 2" is the same as checking "Edit Value == 1"

    there are other operators as well, such as AND (which gives you a 1 if both numbers are a 1) and XOR (which gives you a 1 if one but *not* both are 1)
    eg.
    1 AND 1 = 0
    0 AND 1 = 0
    1 AND 0 = 0
    0 AND 0 = 1

    0 XOR 0 = 0
    1 XOR 0 = 1
    0 XOR 1 = 1
    1 XOR 1 = 0

    it's a bit confusing at first if you haven't come across them before, but they're very useful for comparing two flags in a single line in the expression editor. hope this provides a bit of an explanation

  • thanx Lukiester for the idea but i think ill try and shortcut it a bit and remove the ors
    at the end of day I've come up with this
    Please login to see this attachment.
    don't know if right because it plays up when putting in each entry into a list with "Only one action when event loops" for each event
    Please login to see this attachment.

    Life is a Duel.

  • As marbenx says, it's not that kind of "or". OR in an expression is a Bitwise OR (you can also do AND, XOR & I think NOT also). It just compares 2 values at a bit level to see if the bits at the corresponding positions of either value are set & returns the result.

    The best way to do what it looks like you're trying to do is to have the "Edit value ("edit box") = 1/2/4/whatever" each as separate conditions in one event, & use "or (logical)" between each one. It's in the same right click menu as the "negated" option.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!