[Solved] Inversion of 2 conditions bugs

Very simple example here. When run it shows error

I tested it and the results also vary by the order of the conditions. I don’t fully understand [NOT]. I don’t think you can use multiple values within a single [NOT] I’m not sure what logic Gdevelop is using.

The method to get what you and I expect is using [NOT] with the values in an [AND]
image

1 Like

what is the use for “if all these conditions are true” ? Isn’t it already implied ? All this doesn’t make sense at all.

actually I’m guessing the use of “all these conditions are true” is within a OR condition.
Anyway, I would like to know why my simple example gives “error”. The inversion of 2 conditions is not working. It’s weird because many codes use that. I wouldn’t be the first to have had this bug…

“Not” behaves different than some would expect, because it’s looking for the inverted “logical” result, not the inverted “result”.

It’s in the wiki somewhere but I don’t have availability to look right now. Just know that it isn’t exactly the same as a “NOT” in a programming language. In most cases you would want to just right-click and invert the condition instead for the equivalent of that.

I agree with youri. The NOT expression or condition doesn’t work correctly. Why would the order of the conditions matter? Either it’s broken or it’s using some other criteria. The only reliable way to check for multiple conditions seems to be either use NOT on an AND or separate NOTs for each one. The invert works as a replacement sometimes but not always. (especial when used for instances)

Using these lines, the first 2 events should both either be true or both be false.

result:
image

Edit: I’ve tried understanding the NOT, AND and OR. When using multiple instances, it sometimes gets weird but there usually is a method to the madness. Sometimes, you’ll get the same true vs false result but the instnces thenselves aren’t always “picked” and you need a pick all

Apologies, I was reading this late last night and somehow misread it was object variables, not global variables.

Order shouldn’t matter in this case. I’m unclear why it does.

1 Like

The issue is reproduced with automatic tests and this PR fixes it. The fix will probably be in the next release.
Thank you all for investigating this.

2 Likes

My conditions weren’t even yours. Mine were 1=1 and 2=2 , both true.