I'm trying to make a base defence, or at least a rough one to figure everything out, but I'm having trouble with the "wave" part of the triggers. It makes 20 Zerglings, and I think they're all in a wave, but I can't find how to start the wave =(. Anyone know how to?
One way you can do it is by making an integer variable called Wave or whatever you want. Make a trigger that begins the first wave, which would basically be spawning units and picking those units to move somewhere or attack something or whatever, depending on how you want it to go. Have another trigger that checks when all those units are dead, or a periodic event, again depending on how you want it to work. Have the actions set Wave as Wave + 1, and spawn whatever you want next.
For efficiency you can make a few more variables such as a Unit Type variable and another integer variable for the number of units spawned. So you can have a single trigger go off when units die or as a periodic event, and simply have something changing those variables. Using variables would make UI displays of the next wave or current wave and so forth be much easier.
As a side note, an easy way to check if all the units have died is to have a trigger that checks when a unit dies, with a condition that it is hostile, with the action setting another variable (something like Remaining Units) to Remaining Units - 1, and if it <= 0 then set the next wave and so forth.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to make a base defence, or at least a rough one to figure everything out, but I'm having trouble with the "wave" part of the triggers. It makes 20 Zerglings, and I think they're all in a wave, but I can't find how to start the wave =(. Anyone know how to?
elaborate plz
It's all kind of an illusion.
One way you can do it is by making an integer variable called Wave or whatever you want. Make a trigger that begins the first wave, which would basically be spawning units and picking those units to move somewhere or attack something or whatever, depending on how you want it to go. Have another trigger that checks when all those units are dead, or a periodic event, again depending on how you want it to work. Have the actions set Wave as Wave + 1, and spawn whatever you want next.
For efficiency you can make a few more variables such as a Unit Type variable and another integer variable for the number of units spawned. So you can have a single trigger go off when units die or as a periodic event, and simply have something changing those variables. Using variables would make UI displays of the next wave or current wave and so forth be much easier.
As a side note, an easy way to check if all the units have died is to have a trigger that checks when a unit dies, with a condition that it is hostile, with the action setting another variable (something like Remaining Units) to Remaining Units - 1, and if it <= 0 then set the next wave and so forth.