I am looking for an effecient way of attaching an attack to a building. When you have the building selected and right click on an enemy unit it then creates some units (eg. scvs) and orders them to attack. Preferably I would like to run a trigger when used, so I can control how many units are spawned and change the variables accordingly.
If you want a trigger, shouldn't this question be in the trigger forums? Or are you asking just how to realize the data portion, until you actually run the trigger?
I would just give the building a weapon starting a dummy effect. Specify your desired range and cooldown etc and possibly disable auto-attacking for the building, if you want. This effect starts a trigger; there is an event detecting the execution of a specific effect. You have access to the attacking unit and the target in the trigger, so you spawn your desired amount of units and order them to attack the target via trigger.
Giving the weapon to the building is as easy as for any other unit; you might just want to set the arc of the weapon to 360°, because buildings usually cannot turn.
Hi World,
I am looking for an effecient way of attaching an attack to a building. When you have the building selected and right click on an enemy unit it then creates some units (eg. scvs) and orders them to attack. Preferably I would like to run a trigger when used, so I can control how many units are spawned and change the variables accordingly.
If you want a trigger, shouldn't this question be in the trigger forums? Or are you asking just how to realize the data portion, until you actually run the trigger?
I would just give the building a weapon starting a dummy effect. Specify your desired range and cooldown etc and possibly disable auto-attacking for the building, if you want. This effect starts a trigger; there is an event detecting the execution of a specific effect. You have access to the attacking unit and the target in the trigger, so you spawn your desired amount of units and order them to attack the target via trigger.
Giving the weapon to the building is as easy as for any other unit; you might just want to set the arc of the weapon to 360°, because buildings usually cannot turn.
You might need to attach a model with a turret to it can turn to fire.
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