- Joined
- May 15, 2009
- Messages
- 192
Hello Hive, and welcome to another session of "Battlehound's a noob"
In short, I tried to make a 'smart' system to add several indexed units into different Unit Group Arrays.
I need 14 units to be divided into 7 different groups (sometimes these groups consist of just one individual).
The trigger should be fairly self-explanatory, so I won't drown it (but ask questions if anything is unclear!).
The first group of 3 indexed units gets added to a group well enough, but it doesn't work for the remaining 6 groups in the trigger.
Edit: Hid the trigger in some nice tags to appease the Great Forum Gods/admins.
In short, I tried to make a 'smart' system to add several indexed units into different Unit Group Arrays.
I need 14 units to be divided into 7 different groups (sometimes these groups consist of just one individual).
The trigger should be fairly self-explanatory, so I won't drown it (but ask questions if anything is unclear!).
The first group of 3 indexed units gets added to a group well enough, but it doesn't work for the remaining 6 groups in the trigger.
-
Unit Variables
-
Events
- Map initialization
- Conditions
-
Actions
- -------- Group1=[1,2,3] --------
- Set VerdantCounter_i2 = 1
- Set VerdantSpiritUnits_uArray[1] = Verdant Spirit 1234 <gen>
- Set VerdantSpiritUnits_uArray[2] = Verdant Spirit 1235 <gen>
- Set VerdantSpiritUnits_uArray[3] = Verdant Spirit 1236 <gen>
-
For each (Integer VerdantCounter_i) from 1 to 3, do (Actions)
-
Loop - Actions
- Unit Group - Add VerdantSpiritUnits_uArray[VerdantCounter_i] to VerdantUnits_ugArray[VerdantCounter_i2]
- Game - Display to (All players) the text: ((String((Number of units in VerdantUnits_ugArray[VerdantCounter_i2]))) + units in Counter Group)
- Game - Display to (All players) the text: ((String((Number of units in VerdantUnits_ugArray[1]))) + units in Value=1 Group)
-
Loop - Actions
- -------- Group2=[4,5,6] --------
- Set VerdantCounter_i2 = 2
- Set VerdantSpiritUnits_uArray[4] = Verdant Spirit 1246 <gen>
- Set VerdantSpiritUnits_uArray[5] = Verdant Spirit 1247 <gen>
- Set VerdantSpiritUnits_uArray[6] = Verdant Spirit 1248 <gen>
-
For each (Integer VerdantCounter_i) from 4 to 6, do (Actions)
-
Loop - Actions
- Unit Group - Add VerdantSpiritUnits_uArray[VerdantCounter_i] to VerdantUnits_ugArray[VerdantCounter_i2]
- Game - Display to (All players) the text: ((String((Number of units in VerdantUnits_ugArray[VerdantCounter_i2]))) + units in Counter Group)
- Game - Display to (All players) the text: ((String((Number of units in VerdantUnits_ugArray[2]))) + units in Value=2 Group)
-
Loop - Actions
- -------- Group3=[7] + patrol --------
- Set VerdantCounter_i2 = 3
- Set VerdantSpiritUnits_uArray[7] = Verdant Ancient 1249 <gen>
- Unit Group - Add VerdantSpiritUnits_uArray[7] to VerdantUnits_ugArray[VerdantCounter_i2]
- Set VerdantPatrolPoint_Tempp1 = (Center of PrimalLushPatrol p1 <gen>)
- Unit - Order VerdantSpiritUnits_uArray[7] to Patrol To VerdantPatrolPoint_Tempp1
- Custom script: call RemoveLocation(udg_VerdantPatrolPoint_Tempp1)
- -------- Group4=[8,9,10] --------
- Set VerdantCounter_i2 = 4
- Set VerdantSpiritUnits_uArray[8] = Verdant Ancient 1237 <gen>
- Set VerdantSpiritUnits_uArray[9] = Verdant Spirit 1238 <gen>
- Set VerdantSpiritUnits_uArray[10] = Verdant Spirit 1239 <gen>
-
For each (Integer VerdantCounter_i) from 8 to 10, do (Actions)
-
Loop - Actions
- Unit Group - Add VerdantSpiritUnits_uArray[VerdantCounter_i] to VerdantUnits_ugArray[VerdantCounter_i2]
-
Loop - Actions
- -------- Groupp5=[11,12] --------
- Set VerdantCounter_i2 = 5
- Set VerdantSpiritUnits_uArray[11] = Verdant Spirit 1250 <gen>
- Set VerdantSpiritUnits_uArray[12] = Verdant Spirit 1251 <gen>
-
For each (Integer VerdantCounter_i) from 11 to 12, do (Actions)
-
Loop - Actions
- Unit Group - Add VerdantSpiritUnits_uArray[VerdantCounter_i] to VerdantUnits_ugArray[VerdantCounter_i2]
-
Loop - Actions
- -------- Groupp6=[13] --------
- Set VerdantCounter_i2 = 6
- Set VerdantSpiritUnits_uArray[13] = Verdant Ancient 1252 <gen>
- Unit Group - Add VerdantSpiritUnits_uArray[13] to VerdantUnits_ugArray[VerdantCounter_i2]
- -------- Groupp7=[14] --------
- Set VerdantCounter_i2 = 7
- Set VerdantSpiritUnits_uArray[14] = Verdant Spirit 1253 <gen>
- Unit Group - Add VerdantSpiritUnits_uArray[14] to VerdantUnits_ugArray[VerdantCounter_i2]
- Game - Display to (All players) the text: Ran Unit Variables
-
Events