[Solved] GDevelop 5 beta 66 bug?


#1

Hello guys,

im wondering if this is a bug or am i just thinking wrong?

In the screenshot, i want to change the background color depending on the mouse is over the sprite or not.
When the mouse is over the sprite, the color should change to black, if it is not then it should be white.
However, both expressions get executed (what means both are true at the same time), what results in the background stays white all the time.
But how can be both statements true at the same time when they check for their corresponding opposite case?


#2

Is there multiple instances of Sprite object in the scene?
If yes, that’s how For one its true and for other its false and GDevelop get confused which one you refer to.
It is a common problem with the way GDevelop handle objects.
In similar cases you can try to use either For each event to loop through each instance one by one, the NOT operator instead of reversing the condition and object variables to flag objects that you refer to depends on the use case and circumstances.
For selecting objects, an example is included with GDevelop called “Object Selection”. Take a look.


#3

I have multiple instances and was not looping through them. With a “not” expression it is working. Was expecting that both are doing the same (the button to negate an expression, and the not operator)
I really like GD but the more im working with it, the more im getting confused :sweat_smile:

Why is there no “ELSE”-statement? If i want the game behave differently if a condition is met and not met, and the condition is really complicated, its kind of awkward to create an “opposite” condition to act like an “ELSE” block.

Other thing is, are these 3 situations producing the exact same result?

Next question: are expressions by default ANDed? If yes, why the AND operator?
Like in this pic above:

Are the two condition in one block ANDed or ORed?

A lot of queston marks…


#4

Ok i am really confused by now, so i have made a screenshot of the part that is not working as intended:

The red marked block gets NEVER executed even though the green ones do:

The “Repeat for each Card_Slot object” loop (red marked box) does not even start (background doesnt change) even though there are Card_Slot objects in the scene… . The statement right above this one (smaller green box) gets executed though .

The “Repeat for each Card_Slot object” in the big green box on the top gets executed and work fine however.
I dont get it… nothing has changed the “Card_Slots” in the meantime…

Why does the above loop run fine and the bottom doesnt even start…?

Im a software developer for over a decade… but GDevelope is really complicated to me :stuck_out_tongue:


#5

hi
conditions on the same block ara ANDed
I used AND them removed and had the same effect
Maybe AND is for joining OR or other operands!?


#6

In the example video player you can see a use of case
image


#7

Thank you guys, now it works :slight_smile: