[Solved]OR blocks are broken

Bugs will be moved here once resolved.

Post » Fri Jul 03, 2015 5:08 pm

Ah, I see.

In those situations I just add a subbed picking events with references to local variables or booleans
pick all wheels,
pick by evaluate wheels spinning = true


It seems that the OR block's wide, unrestricted options, leaves the manual with some grey areas
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Jul 03, 2015 5:27 pm

lennaert wrote:Ah, I see.

In those situations I just add a subbed picking events with references to local variables or booleans
pick all wheels,
pick by evaluate wheels spinning = true


It seems that the OR block's wide, unrestricted options, leaves the manual with some grey areas

Yes, in the original post i stated that if i repick all objects with Pick All in a sub-event of OR block everything works as i expect it to work. But, you know, it's just confusing that i need to repick everything after OR block with false-picking condition.
I still think that it's not quite right to don't pick any object's instances at all, and don't apply actions for that object, if in OR block the picking condition for this object is not True, even if other conditions is True.
Even if this won't be fixed, it should be stated in the manual, that if in OR block you got False-picking condition, the object from that condition won't be picked at all in the whole event and it's sub-events, and actions for that object will not apply before you re-pick it again.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Fri Jul 03, 2015 9:54 pm

I've read the manual again, it's by design. Guess i have to re-pick everything after the OR blocks.
Note that because OR blocks run if any condition is true, it's possible the event will still run if some conditions were false and did not pick any instances. In this case the actions will still run, but possibly with zero instances picked for any objects where no instances met the condition. If any actions are run for objects with no instances picked, nothing happens.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Jul 15, 2015 11:12 am

Closing as by design. One unexpected aspect of OR blocks is, in order for them to work correctly at all, they must be able to run with possibly zero instances selected for a type. "Layer 1" is invisible and it's in an OR block so the event is definitely going to run its actions based off that alone. The next condition tests for sprites which have var = 1, and none do. So the event engine picks zero of those instances and proceeds to run the actions. The actions run for all picked instances, so the Sprite action runs zero times and Sprite2 was not referenced so runs for all instances (once in this case).

Note if you saw Sprite rotating, it would contradict the fact you have a condition that says it should not rotate.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Previous

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests