I am making a creep system. The actions:
The creeps are added and before new creeps are added, it checks if the old ones exist. The thing is, I dont have any kind of trigger to "remove unit from unit group". However, it seems after the bones decay, the Text message reports the unit group = 0, and therefore new units are created. 2 questions.
1.) Are the units in this unit group leaking?
2.) How can I make it so the unit is removed from the unit group after it dies (rather then after it's bones decay). I preferabely don't want to remove decay animations.
-
Creep System
-
Events
- Time - Every 6.00 seconds of game time
- Conditions
-
Actions
- Set CreepCounter = 1
- Game - Display to (All players) for 5.00 seconds the text: (Creep Count: + (String(CreepCounter)))
- Game - Display to (All players) for 5.00 seconds the text: (Number of Creeps: + (String((Number of units in CreepGroup[CreepCounter]))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in CreepGroup[CreepCounter]) Equal to 0
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Less than or equal to 50
-
Then - Actions
- Game - Display to (All players) for 5.00 seconds the text: Conditions Passed
- Unit - Create 2 Forest Troll for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Forest Troll Berserker for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Greater than or equal to 50
-
Then - Actions
- Game - Display to (All players) for 5.00 seconds the text: Conditions Passed
- Unit - Create 2 Razormane Scout for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Quillboar for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Razormane Brute for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
Else - Actions
- Game - Display to (All players) for 5.00 seconds the text: Conditions Passed
- Unit - Create 2 Satyr for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Satyr Soulstealer for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- Wait 0.66 seconds
- Set CreepCounter = (CreepCounter + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in CreepGroup[CreepCounter]) Equal to 0
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Less than or equal to 50
-
Then - Actions
- Unit - Create 2 Forest Troll for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Forest Troll Berserker for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 100) Greater than or equal to 50
-
Then - Actions
- Unit - Create 2 Razormane Scout for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Quillboar for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Razormane Brute for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
Else - Actions
- Unit - Create 2 Satyr for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
- Unit - Create 1 Satyr Soulstealer for Neutral Hostile at CreepSpawns[CreepCounter] facing Default building facing degrees
- Unit Group - Add all units of (Last created unit group) to CreepGroup[CreepCounter]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
Events
1.) Are the units in this unit group leaking?
2.) How can I make it so the unit is removed from the unit group after it dies (rather then after it's bones decay). I preferabely don't want to remove decay animations.