I know that title probably doesn't make a ton of sense (but I'm not really sure what to call this), but regardless...
I've been developing a map for a while now and one major goal for this map is to have waves of enemies spawn periodically that go attack the players. Now I've got spawning down and issuing the attack down. However my problem now is trying to figure out how to have every say 200 seconds (I'm not setting this as final, merely a number to use while I test things) have it spawn a different wave. So for example:
- At 200 seconds it would spawn a group of 60 zerglings.
- At 400 seconds it would spawn a group of 60 zerglings and 20 Hydralisks.
- At 600 seconds it would spawn 40 Hydralisks and 40 Roaches.
And so on... And each of these waves is a separate trigger that follow the name scheme "Mass" + the number it is. (So 200 seconds would be Mass 0, 400 seconds would be Mass 1, etc...)
At present I have my triggers set up so that one trigger is my timer:
Event
Timer - Every 200 seconds of real time.
Action
UI - Display "Attack imminent" for Active Players to Directive area
Trigger - Run "Launcher" (Check Conditions, Don't wait until it finishes)
Now my issue is how do I set up a launcher to call each mass attack once (and only once) then when the timer fires again to call the next one. I'm sure there is a relatively simple solution so that I can have a string like "Mass" + convert int to string (Variable - Mass number) but it's just not coming to me.
I would rather not have to make a bunch of timer triggers if I don't have to. I could probably do something like one timer for 200 seconds would launch one attack, then at it's completion it'd start the timer for another attack. But that seems somewhat more complicated and seems like it would defeat the purpose of having a periodic event trigger.
A switch or an if-then-else-if action should work well. You could set up a global integer variable that counts the waves. And have the launcher do a modify variable action of +1 to the variable. Alternatively you could also use the Trigger execution count condition. The first time will be 0 (since from my experience it only counts a trigger as executed once it has gone through all its actions).
Hello MaskedImposter,
Thanks for replying so quickly.
I do have a global variable (named "Mass number") set up to count the masses. (My thought process was that it gets increased as part of the trigger being executed. So when Mass 0 finishes, it increases the global variable Mass number by 1. Which would then be used to tell the game to run Mass 1 instead. Mass 1 then would increase that variable to tell it to run Mass 2.)
Though that switch option may work. (I'll have to experiment with it.) I hadn't considered using it. (Still a relative newb to SC2's coding...)
But if that fails I'll try Trigger execution count condition and see if that works.
I'll report back in after I try that out.
EDIT -
Switch case did exactly what I needed. Thanks for your help MaskedImposter.
If you find yourself needing to do something like this, but have something more variable than time (if, for example, you're basing on score), you can use a pile of Wait Until Conditions, as well.
LucidIguana, I didn't realise that "wait until condition" could do that. (I'll have to keep that in mind for later.) So thanks for the heads up.
OutsiderXE, I thought about that but at the same time I felt it'd be more somewhat more complicated than I wanted to get. (It wouldn't be bad for like 1-3 though, but once up to like 7-10 then it's kinda a lot more trouble to deal with. Especially if I had to go in and make changes to the timing later on... Unless I used one global variable for the time in each one. That would work right?)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I know that title probably doesn't make a ton of sense (but I'm not really sure what to call this), but regardless...
I've been developing a map for a while now and one major goal for this map is to have waves of enemies spawn periodically that go attack the players. Now I've got spawning down and issuing the attack down. However my problem now is trying to figure out how to have every say 200 seconds (I'm not setting this as final, merely a number to use while I test things) have it spawn a different wave. So for example:
- At 200 seconds it would spawn a group of 60 zerglings.
- At 400 seconds it would spawn a group of 60 zerglings and 20 Hydralisks.
- At 600 seconds it would spawn 40 Hydralisks and 40 Roaches.
And so on... And each of these waves is a separate trigger that follow the name scheme "Mass" + the number it is. (So 200 seconds would be Mass 0, 400 seconds would be Mass 1, etc...)
At present I have my triggers set up so that one trigger is my timer:
Event
Timer - Every 200 seconds of real time.
Action
UI - Display "Attack imminent" for Active Players to Directive area
Trigger - Run "Launcher" (Check Conditions, Don't wait until it finishes)
Now my issue is how do I set up a launcher to call each mass attack once (and only once) then when the timer fires again to call the next one. I'm sure there is a relatively simple solution so that I can have a string like "Mass" + convert int to string (Variable - Mass number) but it's just not coming to me.
I would rather not have to make a bunch of timer triggers if I don't have to. I could probably do something like one timer for 200 seconds would launch one attack, then at it's completion it'd start the timer for another attack. But that seems somewhat more complicated and seems like it would defeat the purpose of having a periodic event trigger.
Help would be greatly appreciated.
A switch or an if-then-else-if action should work well. You could set up a global integer variable that counts the waves. And have the launcher do a modify variable action of +1 to the variable. Alternatively you could also use the Trigger execution count condition. The first time will be 0 (since from my experience it only counts a trigger as executed once it has gone through all its actions).
Hello MaskedImposter, Thanks for replying so quickly.
I do have a global variable (named "Mass number") set up to count the masses. (My thought process was that it gets increased as part of the trigger being executed. So when Mass 0 finishes, it increases the global variable Mass number by 1. Which would then be used to tell the game to run Mass 1 instead. Mass 1 then would increase that variable to tell it to run Mass 2.)
Though that switch option may work. (I'll have to experiment with it.) I hadn't considered using it. (Still a relative newb to SC2's coding...) But if that fails I'll try Trigger execution count condition and see if that works.
I'll report back in after I try that out.
EDIT - Switch case did exactly what I needed. Thanks for your help MaskedImposter.
If you find yourself needing to do something like this, but have something more variable than time (if, for example, you're basing on score), you can use a pile of Wait Until Conditions, as well.
Not as clean but you can have trigger 0 run trigger 1 after x amount of time and then trigger 1 runs trigger 2 after y amount of time.
LucidIguana, I didn't realise that "wait until condition" could do that. (I'll have to keep that in mind for later.) So thanks for the heads up.
OutsiderXE, I thought about that but at the same time I felt it'd be more somewhat more complicated than I wanted to get. (It wouldn't be bad for like 1-3 though, but once up to like 7-10 then it's kinda a lot more trouble to deal with. Especially if I had to go in and make changes to the timing later on... Unless I used one global variable for the time in each one. That would work right?)