For as long as I've used Construct, I've assumed that "OR" works the same way as you'd expect an OR condition to work in any other programming language - i.e. the code runs if any of the provided conditions fire true.
However, I learned just recently that "OR" in Construct actually functions like an AND condition, because what it apparently does is that it fires true if any of the conditions are true, but it *also* picks 0 instances of the conditions that return false.
In other words, the following event:
IF playerA.Something
OR playerB.Something
Doesn't translate into:
Pick playerA.Something if true
Or pick playerB.Something if true
It actually translates into:
Pick playerA.Something if true, and pick 0 instances of playerB
Pick playerB.Something if true, and pick 0 instances of playerA
To me this doesn't make sense, because it's inconsistent with how the toolkit otherwise works. All object types are always available to the user even if they weren't explicitly picked as part of an event, so why should an "OR" condition suddenly negate them from being picked just because they didn't fire? "OR" means "either 1 or 2", not "1 and no instances of 2".
The reason why I'm bringing this up is because the way that the OR condition works prevents you from being able to utilize any object types inside of an event where those object types didn't fire as part of the event's OR conditions.
In other words, let's say that you want to change JSON1 if JSON1.foo returns true OR if JSON2.foo returns true. Now you can't do that, because if JSON2.foo fires true then 0 instances of JSON1 are picked.
I can't think of any use cases where Construct's way of doing "OR" is needed in order to be able to achieve effects that would otherwise be convoluted, but I can think of several use cases where Construct's way of doing "OR" makes it impossible to do certain types of events that are important to be able to do and which otherwise require complex workarounds.
I guess my questions at this point are:
- Has this been discussed before?
- Is there a reason why "OR" works the way it does?
- Has it always been like this?
- Are there any plans for adding a "True OR" condition? I'd love to see a "TOR".