- Joined
- Jul 26, 2010
- Messages
- 167
This works like this: if I type "create" it spawn a unit group of footman in a spot, after 5 secons they die. The problem is that the spawned units are added to the same unit group, and as result all the units die at the same time. Even worst, if I create them too fast they die but the next created units wont :/. How I remove the leaks and create different timers with different groups?. I would really apreciate the help.
-
hash ini
-
Events
- Map initialization
- Conditions
-
Actions
- Hash board - Create a hashtable
- Set hashable = (Last created hashtable)
-
Events
-
typed go
-
Events
- Player - Jugador 1 (rojo) types a chat message containing create as Una correspondencia exacta
- Conditions
-
Actions
-
For each (Integer A) from 1 to 5, do (Actions)
-
Do: Actions
- Unit - Create 1 Soldado raso for Jugador 1 (rojo) at (Random point in Región 000 <gen>) facing Vista edificio predeterminada degrees
- Unit group - Add (Last created unit) to victims
-
Do: Actions
- Custom script: set udg_Timer = CreateTimer()
- Custom script: set udg_Id = GetHandleId(udg_Timer)
- Time - Start Timer as a Un tiro timer that will expire in 5.00 seconds
- Trigger - Add to timer expired <gen> the event (Tiempo - Timer expires)
- Hash board - Save Handle Ofvictims as 0 of Id in hashable
-
For each (Integer A) from 1 to 5, do (Actions)
-
Events
-
timer expired
- Events
- Conditions
-
Actions
- Set Timer = (Expiring timer)
-
Unit group - Pick every unit in victims and do (Actions)
-
Do: Acciones
- Unit - Remove (Picked unit) from the game
-
Do: Acciones
- Set victims = (Load 0 of Id in hashable)
- Custom script: set udg_Id = GetHandleId(udg_Timer)
- Custom script: call DestroyTimer(udg_Timer)
- Hash board - Clear all child hashtables of child Id in hashable