Bug or feature? The way OR conditions are processed

I tried doing a simple action but it didn’t work. When I released the space key, the timer wasn’t being deleted but when the time was over 6 seconds it did.

I added a play sound and the sound was being played both times. So, the actions were being executed. I divided the conditions into separate events and it worked. But combined it didn’t.

It came to me. Both of the OR conditions are being evaluated. Since the timer was less than 6 seconds, it made that condition false. So, the NewSprite object was no longer “picked” and the timer couldn’t be deleted because the app didn’t “see” it anymore. I confirmed it by setting a text object to the number of picked instances. It showed 0 until the time elapsed.

I can sort of see the logic but it’s an OR condition not an and. It seems to defeat the purpose of an or but also, it’s inefficient. Once you find a true condition, it makes little sense to use processing time evaluating anything else. I realize making any changes now could break existing projects. I also don’t understand the way events are processed in all formats.

There are 2 “work arounds” Either use separate lines (preferable) or use the pick all instances action. That could cause problems depending on your actions and whether there are other instances.

I’m posting this to ask if the app logic is the best way but also to explain why it works or doesn’t work.

My understanding is that this is as intended. Filtering the object list always happens (today). Feel free to comment on this github issue on which method you’d prefer if they were to split it out (or add another OR condition)

1 Like

Yeah, that’s an interesting example. I’m still getting used to the concept that using a condition changes the instances the actions affect. It’s basically a filter. I have a pretty good grasp of the concept but some of the “peculiar” behaviors still confuse me and I have to assume it’s even worse for new users especially ones who don’t have experience with other languages. I need to think about it.

I’m reminded of the joke:

A wife sends her programmer husband to the grocery store for a loaf of bread. On his way out she says “and if they have eggs, get a dozen”. The programmer husband returns home with 12 loaves of bread.


I’m trying to process this. My best solution would be a special type of event sort of like while but just a one-time comparison like a switch. None of the conditions would affect any of the picked instances. The actions would either happen or not using the current picked status. It’s more a comparison instead of a filter.

I realize there’s a balancing act between making it advanced and keeping it simple to learn.