Sub events work the same. The for each object just picks 1 object at a time.
The conditions in 1 event of
A=1
B=2
C=3
Would be the same if they were all subevents.
A=1
---B=2
------C=3
I think your concept seems OK. It would just be more efficient to do the pieces since each piece is in a space but each space probably doesn’t have a piece.
Also, while blue is changing grey will be the same. So, until blue changes, there’s no need to check for grey. An vice-versa for the grey.
A slightly better strategy might be
For each tile
--for each grey
--for each blue
Say you had the following objects
a1 to a3
b1 to b3
C1 to c3
If the for each objects were all nested
For each a
–For each b
– --for each c
The sequence would be
a1, b1, c1 thru c3
a1, b2, c1 thru c3
a1, b3, c1 thru c3
a2, b1, c1 thru c3
And so on…
Each time one 1 of each object would be picked.
If it was
For each a
--for each b
--for each c
It would be
A1, b1 to b3
A1, c1 to c3
A2, b1 to b3
And so on. There wouldn’t be so much repetition. You would split the comparison conditions inside the related for each object.
Although, I still like my original idea. Although, I’m not sure if it meets your needs.
A more efficient way is to just update the tile names as you move the pieces.
I don’t know how you’re placing the pieces. Where are the origin points. Personally, I would put all the object origins to the center. Unless the piece and the tiles are the same exact size.
You need to make sure both the tile and pieces are in the exact same space. Even a variance of .00001 would throw things off. Because 10 is not equal to 10.000001
I’ve had times were the pesky floating point error caused issues.