Edit: I misunderstand the question. To keep the post clean, I’m gonna “hide” the irrelevant part.
object picking info (click to open)
It took me a long time to understand object picking. The documentation on the subject is minimal.
The conditions are like filters. Without any conditions, an action will effect all of the instances of an object. Conditions take the list and keeps the objects that match the conditions. Each condition within an event or a subevent use the list which is referred to as pick list. Any additional conditions will filter the list further.
You might start with 50 instance.
The 1st condition could reduce it to 20.
The 2nd condition could keep it at 20 or reduce it to 5.
If any of the conditions have zero matches then nothing else will happen. The actions won’t be triggered.
There are at least 2 conditions that will reduce the list to always a maximum of 1 instance. Pick the nearest object and pick a random object.
Even conditions like cursor is on object or point is inside an object can pick more than 1 object if someone touches multiple objects or the objects overlap.
There are times when the last condition should be either pick a random object or pick the nearest to the cursor X, Y
I need to go. I’ll try to post more later.
I did a lot of testing to understand the concept. The expressions number or count of picked objects really helped to understand how many objects were picked. I also used the tint action and effects like outline to add visual feedback as to which objects were picked.
As far as when to use for each object. That’s difficult for me. GD object lists already have a sort of built in for each object. Now, if you assign a fixed number to say an animation, it will apply it to objects. So, for each object isn’t needed.
But, if the action relies on specific data that might come from a linked object or a calculation then you’ll probably going to need a for each object. It’s easy to set all objects to the same value. It takes more to set them to different values.
That’s not always the case. If an action references to itself then you might not need a for each object.
Example. If you had a bunch of text objects with the object variable caption. You could set the text to the object variable without using a for each object.
Set NewText text to NewText.Caption
The same is true with random numbers.
Set X of object to random(100)
I would assume that all of the objects would be set to the same random number but GD does it’s own internal for each and gives each object it’s own random number.
Again, I got to go. More later if I can.
I think I touched a little on both sides, actions and conditions. If you have something specific. Let us know.