I have created a custom unit which does not move (supposed to be a defense tower) and I gave it a weapon which links to the Hydralisk attack. If I control the unit and command it to attack it does so. However, if an enemy unit walks up to it my custom unit and attacks it, the unit will not fire back. My unit also has an ensnare ability set to auto-cast. For some reason the ensnare ability has no problem auto casting once attacked (though I would like it to do so any time an enemy walks in cast range as well, which does not happen) but even when the ensnare auto-casts, the attack still does not. I have also found that when I manually cast ensnare the tower starts to attack as well.
Any explanation as to what I can do to fix this? A defensive tower that does not auto attack is of little use to me while I am out adventuring.
1. It has the Acquire Behavior - Response
2. The ability arc is now 360, the acquire level is Offensive, and the auto cast range is 5, the ability seems to work now (Arc was 0)
3. The tower does not have a turret, just a weapon (hydra attack), and the stationary turning rate is 720, but under the flags turn able is unchecked.
All I did was change the arc of the ability to 360 and everything seems to work. Could you explain to me what the effect of your third point would be in case this stops working later?
You'll want your Hydralisk to be 'Turnable' under it's unit flags. The Hydralisk weapon has an arc of 0, which means the hydralisk must absolutely be facing the radius of whatever it wishes to fire at. You could alternatively give the Hydralisk weapon an arc of 360, but then the hydralisk won't turn to face whatever it needs to shoot.
Turrets operate as separate entities in some regards. For example, Siege Tanks, Hellions, Missile Turrets (and Diamond Backs) can all move and shoot simultaneously with no animation/model glitches/errors since their Turret can 'face' or 'aim' independently of where the unit is moving to, directionally.
I have created a custom unit which does not move (supposed to be a defense tower) and I gave it a weapon which links to the Hydralisk attack. If I control the unit and command it to attack it does so. However, if an enemy unit walks up to it my custom unit and attacks it, the unit will not fire back. My unit also has an ensnare ability set to auto-cast. For some reason the ensnare ability has no problem auto casting once attacked (though I would like it to do so any time an enemy walks in cast range as well, which does not happen) but even when the ensnare auto-casts, the attack still does not. I have also found that when I manually cast ensnare the tower starts to attack as well.
Any explanation as to what I can do to fix this? A defensive tower that does not auto attack is of little use to me while I am out adventuring.
1. Check the Behavior - Response field of the Units data type so it is not set to flee
2. Check the Ability - Arc, the Ability - Auto Cast Aquire Level and the Ability - Auto Cast Range fields of your ability
3. Does your tower have a turret and if not, then what is it's turning?
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
1. It has the Acquire Behavior - Response 2. The ability arc is now 360, the acquire level is Offensive, and the auto cast range is 5, the ability seems to work now (Arc was 0) 3. The tower does not have a turret, just a weapon (hydra attack), and the stationary turning rate is 720, but under the flags turn able is unchecked.
All I did was change the arc of the ability to 360 and everything seems to work. Could you explain to me what the effect of your third point would be in case this stops working later?
@DaBernMon: Go
You'll want your Hydralisk to be 'Turnable' under it's unit flags. The Hydralisk weapon has an arc of 0, which means the hydralisk must absolutely be facing the radius of whatever it wishes to fire at. You could alternatively give the Hydralisk weapon an arc of 360, but then the hydralisk won't turn to face whatever it needs to shoot.
Turrets operate as separate entities in some regards. For example, Siege Tanks, Hellions, Missile Turrets (and Diamond Backs) can all move and shoot simultaneously with no animation/model glitches/errors since their Turret can 'face' or 'aim' independently of where the unit is moving to, directionally.
Ah okay, that makes sense. Thanks to both of you!
If the model you are using lacks the TurretZ attachment point, here is a workaround.
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