Tried to search on the forum but couldnt find appropriate threads,
Im making a map in which i would like to put buildings on a map and have a global timer that do -> every 30 seconds = spawn a single unit from every building owned. Each building would spawn a specific type of unit. Kind of like colonial line wars if anybody knows that map.
I already have a builder which can build the various types of building.
So my question is, what would be the best way to select all of your constructed buildings and fire up an action definition that would spawn a unit for each of these buildings every 30 seconds. Im currently having a hard time selecting all of the buildings for each player to fire up the action definition.
Thank you all and let me know if you need more specifications.
first of all, i would do it with data and just train a unit inside the building and set the rally point wherever the units shall go. with triggers you have select all units from unit group (buildings, alive) : switch unittype of selected unit, case (baracks) = create 1 marine at position of selected unit, issue order to move, case (hydralisk dent) = etc.
I actually have a setup like that with the data editor currently, where my unit train inside the building. The problem is that the precise time they spawn is different depending on when i build the structure. I want my units to pop all at the same time (wave like) but if i put a barrack with a unit to spawn in 30 sec and then 5 sec after i put another one, they will spawn with a 5 sec difference.
However, you are right, if i could find a way to spawn them at the same interval (every 30 second global time) directly from the data editor and the building itself, it would be great.
first of all, you have to decide on a synchronisation strategy. build one, then all new building are synchronised with the first building, the last one, or a general timer.
let's say you want a global timer. now each time the timer runs out you pick each new (!) building and add a behaviour which makes the building train the units (issue order with interval).
each time you build something you have to add the building to a unitgroup or you filter each building without behaviour.
I would suggest doing it with triggers, giving what your looking for, unless your map is going to do it often and has a ton of other stuff going on in terms of processing power. - it would just be a simple periodic event based trigger (or timer based) that picks each unit of the desired type and created the desired units - you'd need to do that action for each building type that spawns.
If you want to do it in the data editor, I think it would require a lot more work.
Here's what I"m thinking - Have an invisible unit owned by player 0 that has a behavior with a periodic effect (and you'd need a different behavior/effect for each different spawn time).
When the effect goes off, it searches the area for the desired building type (and you'd need to set each building type to a different attribute or validate each one).
From there, the search area effect would be 'create unit' - again you'd need a different create unit for each unit type created.
This is a ton of work though - You'd need to have a validator for each building type and a create unit effect for each unit. Again, you're probably better off just doing it in triggers, it shouldn't really cause much lag doing it that way unless you're spawning a shitton or have other laggy operations.
Hope this helps.
Rollback Post to RevisionRollBack
Starcraft2 mapping is an art. It is inspired by the soul and crafted from within and brought out, but not all artists have the skills to create it, which is why I need data/trigger editors. Come find me if you want to be part of something great.
First im not a senior mapper and just started learning about programation. TMmagic proposition looks interesting but since im still learning, im trying to keep things as simple as possible.
Second, and i think this will be a very important factor in my decisions, is that my map will not spawn a lot of units. The map will spawn actually very little units but those units will be very important in regards to the choices you make, it will focus more on controlling regions that will generate resources every 30 secs or so.
So ill try with the periodic timer and base myself on funkyuser synchronisation strategy.
One quick question: "each time you build something you have to add the building to a unitgroup"
can you tell me the best way to do that? im guessing that wouldnt be in the timer trigger but would that be an action in the map init that would fire every time i build a unit or would i be better to create a global action definition? pick that unit and then put it in unitgroup X? Then every 30 secs i pick that unitgroup and order them to do behavior Y?
Thanks, im still very new at this and trying to figure out all the processes
Hi all,
Tried to search on the forum but couldnt find appropriate threads,
Im making a map in which i would like to put buildings on a map and have a global timer that do -> every 30 seconds = spawn a single unit from every building owned. Each building would spawn a specific type of unit. Kind of like colonial line wars if anybody knows that map.
I already have a builder which can build the various types of building.
So my question is, what would be the best way to select all of your constructed buildings and fire up an action definition that would spawn a unit for each of these buildings every 30 seconds. Im currently having a hard time selecting all of the buildings for each player to fire up the action definition.
Thank you all and let me know if you need more specifications.
first of all, i would do it with data and just train a unit inside the building and set the rally point wherever the units shall go. with triggers you have select all units from unit group (buildings, alive) : switch unittype of selected unit, case (baracks) = create 1 marine at position of selected unit, issue order to move, case (hydralisk dent) = etc.
use the select all units from unit group action.
@FunkyUserName: Go
I actually have a setup like that with the data editor currently, where my unit train inside the building. The problem is that the precise time they spawn is different depending on when i build the structure. I want my units to pop all at the same time (wave like) but if i put a barrack with a unit to spawn in 30 sec and then 5 sec after i put another one, they will spawn with a 5 sec difference.
However, you are right, if i could find a way to spawn them at the same interval (every 30 second global time) directly from the data editor and the building itself, it would be great.
But how would i do that?
first of all, you have to decide on a synchronisation strategy. build one, then all new building are synchronised with the first building, the last one, or a general timer.
let's say you want a global timer. now each time the timer runs out you pick each new (!) building and add a behaviour which makes the building train the units (issue order with interval).
each time you build something you have to add the building to a unitgroup or you filter each building without behaviour.
that's how i would do it
I would suggest doing it with triggers, giving what your looking for, unless your map is going to do it often and has a ton of other stuff going on in terms of processing power. - it would just be a simple periodic event based trigger (or timer based) that picks each unit of the desired type and created the desired units - you'd need to do that action for each building type that spawns.
If you want to do it in the data editor, I think it would require a lot more work.
Here's what I"m thinking - Have an invisible unit owned by player 0 that has a behavior with a periodic effect (and you'd need a different behavior/effect for each different spawn time).
When the effect goes off, it searches the area for the desired building type (and you'd need to set each building type to a different attribute or validate each one).
From there, the search area effect would be 'create unit' - again you'd need a different create unit for each unit type created.
This is a ton of work though - You'd need to have a validator for each building type and a create unit effect for each unit. Again, you're probably better off just doing it in triggers, it shouldn't really cause much lag doing it that way unless you're spawning a shitton or have other laggy operations.
Hope this helps.
Thanks guys,
Im thinking of going at it through triggers.
2 reasons for that:
First im not a senior mapper and just started learning about programation. TMmagic proposition looks interesting but since im still learning, im trying to keep things as simple as possible.
Second, and i think this will be a very important factor in my decisions, is that my map will not spawn a lot of units. The map will spawn actually very little units but those units will be very important in regards to the choices you make, it will focus more on controlling regions that will generate resources every 30 secs or so.
So ill try with the periodic timer and base myself on funkyuser synchronisation strategy.
One quick question: "each time you build something you have to add the building to a unitgroup" can you tell me the best way to do that? im guessing that wouldnt be in the timer trigger but would that be an action in the map init that would fire every time i build a unit or would i be better to create a global action definition? pick that unit and then put it in unitgroup X? Then every 30 secs i pick that unitgroup and order them to do behavior Y?
Thanks, im still very new at this and trying to figure out all the processes
I typically use the "units in region matching condition" function for unit groups. Can use that at any time.