- Joined
- Feb 3, 2012
- Messages
- 107
alright so i have a trigger like this:
Event
Every 1 second of game time
Conditions
skelenumber greater than skelemax
Actions
Unit Group - Pick every unit in (Random units from skelegroup) and do (Unit -Kill (Picked Unit))
skelenumber is the number of skeletons spawned: every time a skeleton is summoned, it adds +1 to skelenumber and if the skelenumber is over the skelemax, then a random unit in skelegroup will be killed.
when a skeletons is killed, he will be removed from the skelegroup and the skelenumber will decrease.
it looks solid in theory but when i tried it out: sometimes it worked, but sometimes i could have six skeletons at once! can any1 help me to fix the leak?
the ability spawns 3 skeletons but thats not the problem.
the ability is practically like this:
-use ability-
-1 skeleton spawned-
-added +1 to skelenumber
-wait 1 second-
-1 skeleton spawned-
-added +1 to skelenumber-
-wait 1 second-
-1 skeleton spawned-
-added +1 to skelenumber-
this shouldn't be a problem because the skeletons are spawning one at a time, not all at once.
the event is also every 1 second so even when there are 6 skeletons, the other 3 should have been killed every 1 second but that did not happen. so if any1 can help that would be great!
Event
Every 1 second of game time
Conditions
skelenumber greater than skelemax
Actions
Unit Group - Pick every unit in (Random units from skelegroup) and do (Unit -Kill (Picked Unit))
skelenumber is the number of skeletons spawned: every time a skeleton is summoned, it adds +1 to skelenumber and if the skelenumber is over the skelemax, then a random unit in skelegroup will be killed.
when a skeletons is killed, he will be removed from the skelegroup and the skelenumber will decrease.
it looks solid in theory but when i tried it out: sometimes it worked, but sometimes i could have six skeletons at once! can any1 help me to fix the leak?
the ability spawns 3 skeletons but thats not the problem.
the ability is practically like this:
-use ability-
-1 skeleton spawned-
-added +1 to skelenumber
-wait 1 second-
-1 skeleton spawned-
-added +1 to skelenumber-
-wait 1 second-
-1 skeleton spawned-
-added +1 to skelenumber-
this shouldn't be a problem because the skeletons are spawning one at a time, not all at once.
the event is also every 1 second so even when there are 6 skeletons, the other 3 should have been killed every 1 second but that did not happen. so if any1 can help that would be great!