Ok, here is the skinny everyone, I would like a building that once built will build 1 of a certain unit, and 14 of another, with a small interval between spawns. Once spawned, sending them all to a waypoint is easy as it is a default function for buildings such as a barracks. However, I want them to hold ground at this point, leave the point to engage enemies, but return to it afterwards. If the location of the point is changed, I need them to go there as well. I also need to set a maximum range on how far away they can set a point, as well as make an apparent range circle. If I can get them to muster in a formation, all the better. Once any units die, I need the building to fill their spot 1 by one just as they did when spawning initially.
Would this be configured inside the building's data, or would this be done via triggers?
You can keep track of how many of each unit the building has spawned by setting the custom values on the source building.....
You can then on the spawned units set the custom value on them to reference the source building.. so that when they die you know which building spawned them so that you can que up a replacement unit.
custom values hold "reals" so you need some kind of Unit array... when you create a new source building you add this building to the UnitArray of source buildings..... stop the building index in this array to lets say custom value 0 of its self.
then when the building spawns a unit... it stores custom value 0 of the source unit to custom value 0 of the spawned unit....
custom value 1 of the source unit can be... how many heros it has currently spawned.. custom value 2 of the source unit can be how many marines it has spawned.
since your trying to do a bit more then just spawn units and forgot ... doing this through triggers makes more sense to me..
I would do it via a Create Persistent effect that orders the units to the point unless there is an enemy within a certain range of a buff on the unit. The Train and Arm Magazine type abilities or the Spawn type behaviour can be given requirements limiting the number of each spawned in a mothership requirement like fashion and automatically spawn units. I would use the train effect to apply a buff that uses an Issue Order effect to tell them to hold position when not moving.
Ok, here is the skinny everyone, I would like a building that once built will build 1 of a certain unit, and 14 of another, with a small interval between spawns. Once spawned, sending them all to a waypoint is easy as it is a default function for buildings such as a barracks. However, I want them to hold ground at this point, leave the point to engage enemies, but return to it afterwards. If the location of the point is changed, I need them to go there as well. I also need to set a maximum range on how far away they can set a point, as well as make an apparent range circle. If I can get them to muster in a formation, all the better. Once any units die, I need the building to fill their spot 1 by one just as they did when spawning initially.
Would this be configured inside the building's data, or would this be done via triggers?
@elitegoliath: Go
You can keep track of how many of each unit the building has spawned by setting the custom values on the source building.....
You can then on the spawned units set the custom value on them to reference the source building.. so that when they die you know which building spawned them so that you can que up a replacement unit.
custom values hold "reals" so you need some kind of Unit array... when you create a new source building you add this building to the UnitArray of source buildings..... stop the building index in this array to lets say custom value 0 of its self. then when the building spawns a unit... it stores custom value 0 of the source unit to custom value 0 of the spawned unit....
custom value 1 of the source unit can be... how many heros it has currently spawned.. custom value 2 of the source unit can be how many marines it has spawned.
since your trying to do a bit more then just spawn units and forgot ... doing this through triggers makes more sense to me..
I would do it via a Create Persistent effect that orders the units to the point unless there is an enemy within a certain range of a buff on the unit. The Train and Arm Magazine type abilities or the Spawn type behaviour can be given requirements limiting the number of each spawned in a mothership requirement like fashion and automatically spawn units. I would use the train effect to apply a buff that uses an Issue Order effect to tell them to hold position when not moving.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg