I think this should work:
Have Array width set to 0 before beginning.
On start of layout:
For each (ordered) X.UID ascending
X is Overlapping Y - Push X.UID front of Array
If you're not doing something at the start of the layout you can try:
- For each X
-
- ----- X is Overlapping Y - Push X.UID front of Array
- ----- Once While True
------------------------------------
- ----- X is not Overlapping Y - Call function ("Check for X.UID"(X.UID)
- ----- Once While True
On function "Check for X.UID" (X.UID) -
Repeat Array.width times
System compare Array.at(loopindex) = function.param(0) --> Array Delete (loopindex)
I'm away from home but I hope that works!