• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Enemy Wave

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
so i set the enemy wave to
  • Ashenvale Level 0
    • Events
    • Conditions
    • Actions
      • Set Monster[1] = Chicken
      • Set Monster[2] = Frog
      • Set Monster[3] = Rabbit
      • Set Monster[4] = Raccoon
      • Set Monster[5] = Stag
      • Unit - Create 4 Monster[(Random integer number between 1 and 5)] for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
      • Game - Display to (All players) the text: (Level 0 - + (Name of (Last created unit)))
then, what trigger should i use to check if all enemies in wave 0 are dead to start the next wave?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
You could periodically poll the player's food to see if it is 0 (or some other number representing no wave units), in which case, start the next wave. Same would work for checking the number of living units owned by the player.

Another way would be to use a counter to keep track of living wave units. When a wave starts you set the counter to the number of wave units. Every time one of the wave units is killed you decrement the counter. If the counter becomes 0 (check after decrementing) you know all units are dead and can spawn the next wave.

Center of (Playable map area)
This leaks a location. You create a location but never remove it after use.
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
Use a unit group variable,assign the units in said wave to the unit group and check periodically if the number of units present in that unit group is 0. If so, then allow for the next wave to start (via timer or w/e). Whenever a creep in that group dies, remove it from the group via trigger.

Crabby_Spider and I have used this to help run two 9-unit groups of creeps that patrol our map randomly (and separate of each other). In our case, if a unit dies it's removed from its group, then a new one is spawned and assigned to that group.

This has worked well for us (note: we used GUI to do this).

//\\oo//\\
 
Status
Not open for further replies.
Top