AceHart
Your Friendly Neighborhood Admin
- Reaction score
- 1,495
It's perfectly possible to put a "pick every unit" loop inside another "pick every unit" loop.
But, obviously, the "Picked unit" in the inner loop will be different from the "Picked unit" in the outer loop.
"Set <whatever>Group = units of type" isn't needed.
You already have two triggers that fill in those groups as the units are created.
The "player" loop is not needed.
Simply remember the position and the owner of the "picked unit" in the first loop,
and compare that player to the owner of the "picked unit" in the second loop.
If both are the same and the distances are "close enough" or not, then ... do something.
But, obviously, the "Picked unit" in the inner loop will be different from the "Picked unit" in the outer loop.
"Set <whatever>Group = units of type" isn't needed.
You already have two triggers that fill in those groups as the units are created.
The "player" loop is not needed.
Simply remember the position and the owner of the "picked unit" in the first loop,
and compare that player to the owner of the "picked unit" in the second loop.
If both are the same and the distances are "close enough" or not, then ... do something.