Staredit Network

Staredit Network -> UMS Assistance -> [SOLVED] Constant attacks
Report, edit, etc...Posted by Saox on 2007-01-06 at 14:37:01
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?
Report, edit, etc...Posted by xmrxsiegecopx on 2007-01-06 at 14:38:16
Use waits/DC timers.
Report, edit, etc...Posted by n0b0dy- on 2007-01-06 at 16:02:02
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.
Report, edit, etc...Posted by Falkoner on 2007-01-06 at 16:47:40
Or if you are not using hypertriggers, waits, or death counters, you CAN simply say always create preserve trigger wink.gif

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.
Report, edit, etc...Posted by fritfrat(U) on 2007-01-06 at 18:47:03
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.
Report, edit, etc...Posted by Saox on 2007-01-07 at 02:44:09
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?
Report, edit, etc...Posted by Zeratul_101 on 2007-01-07 at 03:26:44
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.
Report, edit, etc...Posted by Saox on 2007-01-07 at 10:26:40
Oh, now I get it! Thx a lot smile.gif
Report, edit, etc...Posted by fritfrat(U) on 2007-01-07 at 10:57:21
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.
Report, edit, etc...Posted by T-a-r-g-e-t on 2007-01-10 at 08:16:20
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
Next Page (1)