Whenever a unit is killed a "copy" of it is created in a region. It is then added to a unit group variable with an array of the level of the unit.
Later I want to move the units in the unit group to the field to fight. However I want to start with the highest level creeps which is why I grouped them by level.
The problem is that they some why don't even get moved at all!!!
This is the trigger that creates a copy of the units killed and groups them :
(I have changed it to polo2005's version since it is a lot better but it still don't work)
And uhm this is the trigger that moved the units in the field (which it some why don't, only for lvl 10 creeps)
And btw, it worked before I grouped them in levels, however there I just sent a random unit from the region to the field
Help is needed !
EDIT: I have made a the attached map that polo2005 posted instead of the old one but with the same problem ...
Later I want to move the units in the unit group to the field to fight. However I want to start with the highest level creeps which is why I grouped them by level.
The problem is that they some why don't even get moved at all!!!
This is the trigger that creates a copy of the units killed and groups them :
(I have changed it to polo2005's version since it is a lot better but it still don't work)
Code:
Creep collecting
Events
Unit - A unit owned by Neutral Hostile Dies
Conditions
((Dying unit) is Summoned) Equal to False
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Killing unit) belongs to an ally of Player 1 (Red)) Equal to True
Then - Actions
Unit - Create 1 (Unit-type of (Dying unit)) for Player 6 (Orange) at (Center of Team1units <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to Battle_unitgroups_by_lvl_team1[(11 - (Level of (Dying unit)))]
Unit - Pause (Last created unit)
Unit - Make (Last created unit) Invulnerable
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Killing unit) belongs to an ally of Player 7 (Green)) Equal to True
Then - Actions
Unit - Create 1 (Unit-type of (Dying unit)) for Player 12 (Brown) at (Center of Team2units <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to Battle_unitgroups_by_lvl_team2[(11 - (Level of (Dying unit)))]
Unit - Pause (Last created unit)
Unit - Make (Last created unit) Invulnerable
Else - Actions
Do nothing
And uhm this is the trigger that moved the units in the field (which it some why don't, only for lvl 10 creeps)
Code:
Creeps attack from team 1
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Battle_unitgroups_by_lvl_team1[(Integer A)]) Greater than 0
Then - Actions
Set Battle_unit_team1 = (Random unit from Battle_unitgroups_by_lvl_team1[(Integer A)])
Unit - Move Battle_unit_team1 instantly to (Center of Team1battlespawn <gen>)
Unit - Unpause Battle_unit_team1
Unit - Make Battle_unit_team1 Vulnerable
Unit - Order Battle_unit_team1 to Attack-Move To Team2_home
Skip remaining actions
Else - Actions
And btw, it worked before I grouped them in levels, however there I just sent a random unit from the region to the field
Help is needed !
EDIT: I have made a the attached map that polo2005 posted instead of the old one but with the same problem ...