Im building a map where the player(s) will get attacked by the enemy at certain times, so ive chosen the Create Units trigger, with the condition "elapsed time: x seconds" and the action "create x zerglings at location y". But instead of x zerglings being created (in my case 5) there is like 20 or 30 zerglings being created... and Ive tried to bypass this in any way I can think of but it just doesnt work. Anyone know a way of making this happen?
None.
Well, if you have the elapsed time being x seconds, and you have a Preserve Trigger, then as soon as it hits the X seconds, it will keep running that trigger over and over, since the condition is always true.
You probably want to use
Death Count Timers
None.
But Ive tried using a switch like this:
CONDITIONS:
Switch 1 is set
ACTIONS:
Create 5 zerg at location 2
Clear Switch 1
It still doesnt work though it should... shouldnt it?
None.
it's not going to work unless that first switch is set.
i suggest you read the tutorial on death count timers, and hyper triggers.
also, it probably makes extra zerglings if that trigger is for more than 1 player. Therefore the conditions will be met for all those players and create extra units. Make the spawning trigger only for one player or for a whole force (without a Current Player condition).
None.
Haha! I fixed it now. It was pretty simple too, I just did this:
Trigger 1
CONDITIONS
Elapsed time is 30 seconds
Switch 1 is cleared
ACTIONS
Set switch 1
Trigger 2
CONDITIONS
Switch 1 is set
ACTIONS
Create 5 zerglings at location 2
-
Thanks for the tip though, Ill look through that tutorial when I have the time!
None.
Um.... That really won't work, unless you only want it to spawn once, 30 seconds into the game...
None.
Well all I need to do to activate that script again is to clear switch 1, which I have other triggers for
Post has been edited 1 time(s), last time on Jan 22 2008, 6:54 am by Caprianders.
None.
No... Because if you activate it again, then it will immediately run, since 30 seconds has already passed.
The Elapsed Time condition is constant throughout the entire game, it never resets.
None.
countdown timer is at most 0 seconds
set CDT to 30s
create some units
preserve.
None.
Couldn't he just go:
Conditions:
30 Seconds has passed
Actions:
Create 5 zerglings.
That does what he wants, doesnt it?
None.
Yes, but he wants it to happen every 30 seconds I believe, so rather than have to make a trigger for every thirty seconds, he can use a Death Count Timer to make it loop over and over on its own.
None.
or he could use a countdown timer like y10k said which would also work.
None.
Yes, and now he has a pretty little timer at the top of his screen that resets every thirty seconds. Countdown timers are usually used for at least 3-5 minutes, otherwise they just look very unprofessional.
None.