HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Waves

08-19-2004, 03:42 PM#1
Progniss
Im trying to make a trigger where Rounds start after (20 seconds). I know it's possible to do this in 3 triggers or less. In my map Inital trigg I set the Unit Types to an array variable. The first array being 0, and 0 = The first type of unit that will spawn in the four corners and attack to the middle. So I have a some of it worked out but I am stuck.

Seperate Trigger, Unit Waves.
In this I have
Level Starter
Events
Time - Timer expires
Conditions
Actions
Unit - Create 5 Units[0] for Player 11 (Dark Green) at (Center of Unit Spawn 01 <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to (Last created unit group)
Unit - Create 5 Units[0] for Player 11 (Dark Green) at (Center of Unit Spawn 02 <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to (Last created unit group)
Unit - Create 5 Units[0] for Player 11 (Dark Green) at (Center of Unit Spawn 03 <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to (Last created unit group)
Unit - Create 5 Units[0] for Player 11 (Dark Green) at (Center of Unit Spawn 04 <gen>) facing Default building facing degrees
Unit Group - Add (Last created unit) to (Last created unit group)
Unit Group - Order (Last created unit group) to Attack-Move To (Center of Middle <gen>)


Now i am confused at to when and where I should start the trigger because at the begining I want the players to vote on the Difficulty Easy, Medium, or Hard. Then after they choose the timer to start and let them pick their heros. Also I need some way for the timer to restart after all the units are dead. Plus setting up the next level making array [0] +1. If someone can please help I would appriciate it a lot
08-19-2004, 05:20 PM#2
Anitarf
That trigger will need to be remade a bit. Here's the easiest way to do it:

This is your first trigger that sets which monsters are going to come at which level. Add the following lines to this trigger:
Code:
set pointVariableArray[0] = (Center of Unit Spawn 01 <gen>)
set pointVariableArray[1] = (Center of Unit Spawn 02 <gen>)
set pointVariableArray[2] = (Center of Unit Spawn 03 <gen>)
set pointVariableArray[3] = (Center of Unit Spawn 04 <gen>)

Then, you'll need one more variable named "currentLevel". it should be an integer variable and should be 0 by default.

Then, the wave spawning trigger would look like this:

Code:
Events:
    Time - Timer expires
Conditions:
Actions:
    For each Integer A from 0 to 3 do actions
        loop - actions:
            For each Integer B from 0 to 4, do actions
                loop - actions:
                    unit - create 1 Units[(currentLevel)] at pointVariableArray[(Integer A)] facing default bilding degrees
                    unit - order (last created unit) to attack-move to center of middle
    set currentLevel = currentLevel + 1

This trigger, the way it's done now, runs whenever a timer expires, and then it spawns a new wave; at the end of the trigger, the number of the wave is increased by one, so the next time this trigger runs, it will spawn the next wave.
08-19-2004, 06:39 PM#3
Progniss
Quote:
Originally Posted by Anitarf
That trigger will need to be remade a bit. Here's the easiest way to do it:

This is your first trigger that sets which monsters are going to come at which
level. Add the following lines to this trigger:
Code:
set pointVariableArray[0] = (Center of Unit Spawn 01 <gen>)
set pointVariableArray[1] = (Center of Unit Spawn 02 <gen>)
set pointVariableArray[2] = (Center of Unit Spawn 03 <gen>)
set pointVariableArray[3] = (Center of Unit Spawn 04 <gen>)

Um what kind of variable is this Unit-Type like the current one I had? if so you have each area spawning different Units which I dont want so Im just double checking here.



Quote:
Originally Posted by Anitarf
Then, you'll need one more variable named "currentLevel". it should be an integer variable and should be 0 by default.

Then, the wave spawning trigger would look like this:

Code:
Events:
    Time - Timer expires
Conditions:
Actions:
    For each Integer A from 0 to 3 do actions
        loop - actions:
            For each Integer B from 0 to 4, do actions
                loop - actions:
                    unit - create 1 Units[(currentLevel)] at pointVariableArray[(Integer A)] facing default bilding degrees
                    unit - order (last created unit) to attack-move to center of middle
    set currentLevel = currentLevel + 1

This trigger, the way it's done now, runs whenever a timer expires, and then it spawns a new wave; at the end of the trigger, the number of the wave is increased by one, so the next time this trigger runs, it will spawn the next wave.

Great thanks but, than I also am confused on how to set-up another the trigger so that it knows what the Unit-Type Array is each time and when all those units are to start up the next timer so that the hero's have time to get items and stuff. Because the first timer is set off by the difficulty vote.
I really appriciate your help
08-19-2004, 09:07 PM#4
Anitarf
Quote:
Originally Posted by Progniss
Um what kind of variable is this Unit-Type like the current one I had? if so you have each area spawning different Units which I dont want so Im just double checking here.

Those are point variables, as their name (and the value they are being set to) suggests. The point is that instead of copying the spawn code for every spawn position, you just store those spawn positions in an array and then loop through them when spawning units (integer A loop does that. Integer B takes care of the ammount of units you want to spawn per each spawn point).

Quote:
Originally Posted by Progniss
Great thanks but, than I also am confused on how to set-up another the trigger so that it knows what the Unit-Type Array is each time and when all those units are to start up the next timer so that the hero's have time to get items and stuff. Because the first timer is set off by the difficulty vote.
I really appriciate your help

Well, the easiest (and not so bad) way to do this would be to set off the next timer after you spawn the creeps. That way, the faster the heroes kill the creeps, the more time they'll have to go shopping. If the players are really slow at killing the creep, this kind ow doing things could lead to the next wave spawning before the first wave is finished off.

An alternative is to start the timer after a wave is finished. To do that, you would need a new integer variable, numberOfMonstersRemaining. Then, at the end of the wave spawn trigger, put this:

Code:
  set numberOfMonstersRemaining = 20 (this is the number of monsters in a wave, 5x4, change this if you change the number of monsters)
  trigger - turn on numberOfMonstersCheckingTrigger

Code:
numberOfMonstersCheckingTrigger (this trigger needs to be turned off first in the editor, it is turned on later by the spawn trigger)
  Evens:
    Player owned unit event - a unit owned by Player 11 dies
  Conditions:
    integer comparison - numberOfMonstersRemaining = 0
  Actions:
    create the coundown timer
    trigger - turn off this trigger
08-20-2004, 05:19 PM#5
Progniss
Thanks a lot for your help I appriciate it.