I'm working on a new map.
I've seen this a few times before but I was wondering how to do this - make units constantly spawn, of course not just a simple create and preserve trigger, but also with a pause inbetween. How to do this perfect?
Do this:
Method 1)
Death counters:
Trigger 1)
Players: Whatever you want here
Conditions: Whatever you want here... I.E. Switch 'level 2' is set
Actions: Set deaths for player 6 add one kakaru. Preserve Trigger
11.88 deaths of kakaru would be equal to one second real time.
Trigger 2)
Players: Whatever you want here
Conditions: Whatever you want here... I.E. Switch 'level 2' is set
AND: Player 6 has suffered at least 12 deaths of kakaru
Actions: Set deaths for player 6 set to 0 for kakaru. Create one 'level 2' at location 'level spawner' Preserve Trigger
Using these two triggers would create a level 2 every second. You can also change how long you want the interval to be by taking 11.88 and multiplying it by however many seconds you want. Round up if the decimal is above .7 to create a perfect cycle. Also you need hyper triggers to make this work in time (view tutorials)
Method 2)
Waits
Trigger 1)
Players: Whatever you want here
Conditions: Whatever you want here... I.E. Switch 'level 2' is set
Actions: Create one 'level 2' at 'level 2 spawn area' wait for 1000 milliseconds Preserve Trigger
1000 milliseconds = 1 second
While this method is simpler, it involves waits which can slow the game down, and death counters do not use waits, so it is highly suggested to use death counters, however if you do not fully understand them, then use method 2.
Or if you are not using hypertriggers, waits, or death counters, you
CAN simply say always create preserve trigger
Triggers run once very 2 seconds without waits or hypertriggers, waits won't affect it that much, so basically they run every 2 seconds without hypertriggers, so you would only get one unit every 2 seconds.
For longer pauses, especially if you're doing more than 1 at a time, it's recommended to use dcs. Make sure to use hyper triggers.
THE DCS method spawns new units after the first ones are killed, but that's not really what I want. Is there any thing I can do except that?
no it doesn't, we're using the DCs as a timer, not as a kill tracker. whenever the DC reaches a certain amount(due to triggers causing this, not units dying), you reset it to 0. then it will count up to w/e number, spawn a new wave, reset itself to 0 and voila you have a working spawning system.
Oh, now I get it! Thx a lot
To clarify, people use death counters not for actually keeping track of deaths of a unit, but just as a variable. Other variables such as score and resources are all practically used, whereas the death counters of many unused units would never be used. However long you want your wait to be, multiply it by 12 (or 11.88), count up to that number, and then once you reach that number, create the units and reset the counter to 0.
Lets suggest a Wraith is an unused unit in your game. Rename it Counter-----Spawn Timer
Trigger 1
Conditions:
If deaths of Counter-----Spawn Timer is at most 11
Actions:
Add 1 death for Counter-----Spawn Timer
Preserve Trigger
Conditions:
If deaths of Counter-----Spawn Timer is at least 12
Actions:
Set deaths for Counter-----Spawn Timer to 0
Create units at wherever
Preserve Trigger