Ok, so I want 12 units to line up in a vertical line. Here is what I have, why doesn't it work (Ignore memory leaks atm).
As of right now, they simply move to some far off point without lining up at all. The only thing that does work is that they move south (270 degrees).
But it's still not perfect. The problem here is that it picks random units, thus does not exclude units it already picked.
I got about 9 footmen to line up once.
Here's a better trigger than the last two. I'll draw a Diagram (horizontally) of how they lined up.
XX XXXX XX X
The other three didn't move at all because they weren't "randomly" selected.
As of right now, they simply move to some far off point without lining up at all. The only thing that does work is that they move south (270 degrees).
Trigger:
- Verticle Line
- Events
- Player - Player 1 (Red) types a chat message containing -v as An exact match
- Conditions
- Actions
- Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
- Loop - Actions
- For each (Integer A) from 1 to 12, do (Actions)
- Loop - Actions
- Set FormVertRed[(Integer A)] = (Picked unit)
- Unit - Turn collision for FormVertRed[(Integer A)] Off
- Unit - Move FormVertRed[(Integer A)] instantly to ((Position of FormVertRed[1]) offset by (75.00 x (Real((Integer A)))) towards 270.00 degrees), facing 0.00 degrees
- Loop - Actions
- For each (Integer A) from 1 to 12, do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
- Events
But it's still not perfect. The problem here is that it picks random units, thus does not exclude units it already picked.
I got about 9 footmen to line up once.
Trigger:
- Verticle Line
- Events
- Player - Player 1 (Red) types a chat message containing -v as An exact match
- Conditions
- Actions
- Set FormVertRedGroup = (Units currently selected by Player 1 (Red))
- For each (Integer A) from 1 to 12, do (Actions)
- Loop - Actions
- Set FormVertRed[(Integer A)] = (Random unit from FormVertRedGroup)
- Unit - Turn collision for FormVertRed[(Integer A)] Off
- Unit - Move FormVertRed[(Integer A)] instantly to ((Position of FormVertRed[1]) offset by (75.00 x (Real((Integer A)))) towards 270.00 degrees), facing 0.00 degrees
- Loop - Actions
- Events
Here's a better trigger than the last two. I'll draw a Diagram (horizontally) of how they lined up.
XX XXXX XX X
The other three didn't move at all because they weren't "randomly" selected.
Trigger:
- Verticle Line
- Events
- Player - Player 1 (Red) types a chat message containing -v as An exact match
- Conditions
- Actions
- Set FormVertRedGroup = (Units currently selected by Player 1 (Red))
- Set FormVertRedFulcrum = (Random unit from FormVertRedGroup)
- For each (Integer A) from 1 to 12, do (Actions)
- Loop - Actions
- Set FormVertRed[(Integer A)] = (Random unit from FormVertRedGroup)
- Unit - Turn collision for FormVertRed[(Integer A)] Off
- Unit - Move FormVertRed[(Integer A)] instantly to ((Position of FormVertRedFulcrum) offset by (75.00 x (Real((Integer A)))) towards 270.00 degrees), facing 0.00 degrees
- Loop - Actions
- Events