I have a map wherein every x seconds a Nydus Worm spawns randomly in a region. The idea is for the worm to spawn dudes at a given interval until it is killed.
Now, this isn't a problem if the player manages to kill the worm before the next spawns. However, the way I have it set right now, when the next worm spawns the first worm stops spawning units.
The way I am executing it is with 2 triggers, one spawns worms every x seconds, and one spawns dudes every y seconds at the location of the worm. Its fairly obvious that that wont work since the spawn dudes trigger only spawns at the most recently created worm. What I am wondering is: what is the easiest way to solve the problem. I expect I am going to have to use an array for the worms and then check each element in the array and spawn a unit at that. However I am relatively new to the editor and am not really sure of the capability of the array class. Can I dynamically allocate an array so that I can simply append new worms to the end and then delete them and resize it when a worm is killed?
If you want the animations to play when unloading, you need to change the cargo to be local rather than global. Not sure where, but i did it a while back. Basically what you then do is a trigger with a periodic event then 'pick each nydus worm' and 'create cargo unit for picked unit' then 'issue order unload' for the nydus (perhaps with an order to the spawning unit so they don't all spawn and stay there)
If the "dude" spawned is always the same unit, you can even make an effect of type "create unit", set the fields (very straightforward), then make a behavior, set the duration to -1, the period effect to the one you just made, and the period to the amount of time between spawns, and then just add that behavior to the worm :p
Or do what SgtFailure (who's not living up to his name) said if it's different types of units (together with what wolflisk said, who posted while i was writing). But maybe you can get it to display animations using triggers? Never tried forcing a unit to do an animation with triggers.
If the "dude" spawned is always the same unit, you can even make an effect of type "create unit", set the fields (very straightforward), then make a behavior, set the duration to -1, the period effect to the one you just made, and the period to the amount of time between spawns, and then just add that behavior to the worm :p
Or do what SgtFailure (who's not living up to his name) said if it's different types of units (together with what wolflisk said, who posted while i was writing). But maybe you can get it to display animations using triggers? Never tried forcing a unit to do an animation with triggers.
Firstly: :D Ninja'd!. Secondly: They will both work, although because my way creates the unit inside the cargo of the nydus and then unloads rather than just spawning next to it, it will probably look better. But i'm not good at data editing, so i don't know whether yours is any better or worse.
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Go to Pick each unit in unit group
Once there where it says last created change it to Units in region matching..
And youll get the top :]
Unit Group - Pick each unit in (Any units in Region 001 owned by player 4 matching (Convert Target Filter String "Nydus Worm" To Unit Filter), with at most Any Amount) and do (Actions)
That appears to half solve the problem. Now it is spawning units at the 2 most recent worms. Not sure why it wouldnt be spawning at all of them though.
Unit Group - Pick each unit in (Any units in Region 001 owned by player 4 matching (Convert Target Filter String "Nydus Worm" To Unit Filter), with at most Any Amount) and do (Actions)
Actions- Spawn units etc...
?
_ The devil's in the detail
make region 1 to entire map unless region is the whole are of which worms will appear
More then likely your nydus cannals are linked together, because thats why nydus cannals do. The units loaded in the nydus cannals are all the same units for every nydus canal. So what I think you should do is de-link the nydus cannals Cargo units. (not sure how to do that but you want them to act more like bunkers than nydus cannals.)
I assume your loading the nydus with units and forcing them to Unload the units after the nydus cannal is done spawning.
so it goes like this
Seperate the cargo holds of the nydus cannals (so they dont share cargo)
Spawn a nydus cannal (periodically)
Load nydus cannal with units(Im not really sure how to do this but im pretty sure you can create units in the cargo space with a trigger)
No actually, I am not loading the units into the worms at all. I am just spawning units at the location of the worm. You don't get the animations or anything then, but it's simpler to execute.
Basically I am using the worms as markers for where the units are going to spawn in.
The situation:
I have a map wherein every x seconds a Nydus Worm spawns randomly in a region. The idea is for the worm to spawn dudes at a given interval until it is killed.
Now, this isn't a problem if the player manages to kill the worm before the next spawns. However, the way I have it set right now, when the next worm spawns the first worm stops spawning units.
The way I am executing it is with 2 triggers, one spawns worms every x seconds, and one spawns dudes every y seconds at the location of the worm. Its fairly obvious that that wont work since the spawn dudes trigger only spawns at the most recently created worm. What I am wondering is: what is the easiest way to solve the problem. I expect I am going to have to use an array for the worms and then check each element in the array and spawn a unit at that. However I am relatively new to the editor and am not really sure of the capability of the array class. Can I dynamically allocate an array so that I can simply append new worms to the end and then delete them and resize it when a worm is killed?
Thanks
______________ The devil's in the detail
Pick all worms in region and make them spawn "dudes"? Use custom values.
@detail251: Go
If you want the animations to play when unloading, you need to change the cargo to be local rather than global. Not sure where, but i did it a while back. Basically what you then do is a trigger with a periodic event then 'pick each nydus worm' and 'create cargo unit for picked unit' then 'issue order unload' for the nydus (perhaps with an order to the spawning unit so they don't all spawn and stay there)
If the "dude" spawned is always the same unit, you can even make an effect of type "create unit", set the fields (very straightforward), then make a behavior, set the duration to -1, the period effect to the one you just made, and the period to the amount of time between spawns, and then just add that behavior to the worm :p
Or do what SgtFailure (who's not living up to his name) said if it's different types of units (together with what wolflisk said, who posted while i was writing). But maybe you can get it to display animations using triggers? Never tried forcing a unit to do an animation with triggers.
Firstly: :D Ninja'd!. Secondly: They will both work, although because my way creates the unit inside the cargo of the nydus and then unloads rather than just spawning next to it, it will probably look better. But i'm not good at data editing, so i don't know whether yours is any better or worse.
I can't find an action that will pick all units in a region.
And yes, they will be different units. A mix of zerglings and roaches and such.
________ The devil's in the detail
Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Go to Pick each unit in unit group Once there where it says last created change it to Units in region matching.. And youll get the top :]
So does this sound right then:
Unit Group - Pick each unit in (Any units in Region 001 owned by player 4 matching (Convert Target Filter String "Nydus Worm" To Unit Filter), with at most Any Amount) and do (Actions)
Actions- Spawn units etc...
?
_______ The devil's in the detail
Well i dont have a copy of your map so not sure lol, test it.
That appears to half solve the problem. Now it is spawning units at the 2 most recent worms. Not sure why it wouldnt be spawning at all of them though.
_______ The devil's in the detail
make region 1 to entire map unless region is the whole are of which worms will appear
@DarkFireDragoon: Go
More then likely your nydus cannals are linked together, because thats why nydus cannals do. The units loaded in the nydus cannals are all the same units for every nydus canal. So what I think you should do is de-link the nydus cannals Cargo units. (not sure how to do that but you want them to act more like bunkers than nydus cannals.)
I assume your loading the nydus with units and forcing them to Unload the units after the nydus cannal is done spawning.
so it goes like this
This should give you what your looking for
No actually, I am not loading the units into the worms at all. I am just spawning units at the location of the worm. You don't get the animations or anything then, but it's simpler to execute.
Basically I am using the worms as markers for where the units are going to spawn in.
Did you make 'Region 1' to entire map? And you have to make regions on the worms...
Region 1 basically is the whole map. excluding the players mining area.
________ The devil's in the detail