I've been trying to solve this forever and I feel like I'm going to call myself an idiot once someone points it out to me, but I have to ask. I've tried so many different things and none of them worked.
I have a unit with an ability that I want to cause the unit to not be able to move, but still be able to attack. Essentially it roots them in place and gives them armor.
The ability that I have currently adds a behavior. The behavior disables move ability and sets the units movement speed to 0. Additionally as a backup I have a trigger action that also does those 2 things. I even tried making a periodic trigger that picks units with that behavior and issues them a hold position command. None of that worked.
What happens is that the units move very very very slowly, but sure enough they are moving. I'm pretty sure its because they can A-move. When I test the map, units can't A-move, it gives an error message, but in the actual game on b.net they can. Its infuriating.
I can't use the stun flag, because I need the units to be able to attack. I tried making the behavior disable scan ability types but that didn't do anything. Haven't found anything else. So, how do you make a unit be rooted in place and unable to move or A-move at all, but still attack targets that come within its range?
Hey thanks for your reply. I forgot to mention it, but I actually DID try that idea with adding requirements to attack. I went to the attack commands field and added a requirement that the unit does NOT have the buff to be able to attack towards. It didn't seem to do anything.
What happens is that the units (im 99% sure when A-moved) will start moving really really really slowly. Its almost not noticeable, but after a few minutes the units will have moved a noticeable amount. I'm not even sure how that's possible since their movement speed is set to 0.
So, if I give the buff the stun flag but also the enable attack flag, it could be able to attack?
There is a good chance there is a minimum speed defined as 1 machine epsilon for the fixed point type StarCraft II uses per frame. Basically a unit has to move some amount.
One way would be to morph the unit to a form which cannot move. This would mimic the Siege Tank.
You could also try root, or any of the methods Heroes of the Storm used to prevent unit movement but still allow them to attack.
I've been trying to solve this forever and I feel like I'm going to call myself an idiot once someone points it out to me, but I have to ask. I've tried so many different things and none of them worked.
I have a unit with an ability that I want to cause the unit to not be able to move, but still be able to attack. Essentially it roots them in place and gives them armor.
The ability that I have currently adds a behavior. The behavior disables move ability and sets the units movement speed to 0. Additionally as a backup I have a trigger action that also does those 2 things. I even tried making a periodic trigger that picks units with that behavior and issues them a hold position command. None of that worked.
What happens is that the units move very very very slowly, but sure enough they are moving. I'm pretty sure its because they can A-move. When I test the map, units can't A-move, it gives an error message, but in the actual game on b.net they can. Its infuriating.
I can't use the stun flag, because I need the units to be able to attack. I tried making the behavior disable scan ability types but that didn't do anything. Haven't found anything else. So, how do you make a unit be rooted in place and unable to move or A-move at all, but still attack targets that come within its range?
So you use a Buff behaviour that supresses movement with the one Behavior: Modification - Modify Flags flag and boosts armor?
Even if the unit cannot move they will try to queue the move for a later time.
You can stun units but you then need to enable the Attack ability with the same buff.
Tried adding requirements to the Attack ability? There is the Attack Towards button which might be the problem.
Could you give more details as to how the unit is not behaving correctly/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
Hey thanks for your reply. I forgot to mention it, but I actually DID try that idea with adding requirements to attack. I went to the attack commands field and added a requirement that the unit does NOT have the buff to be able to attack towards. It didn't seem to do anything.
What happens is that the units (im 99% sure when A-moved) will start moving really really really slowly. Its almost not noticeable, but after a few minutes the units will have moved a noticeable amount. I'm not even sure how that's possible since their movement speed is set to 0.
So, if I give the buff the stun flag but also the enable attack flag, it could be able to attack?
There is a good chance there is a minimum speed defined as 1 machine epsilon for the fixed point type StarCraft II uses per frame. Basically a unit has to move some amount.
One way would be to morph the unit to a form which cannot move. This would mimic the Siege Tank.
You could also try root, or any of the methods Heroes of the Storm used to prevent unit movement but still allow them to attack.
Oh, that makes sense about the movement speed minimum. Thanks, I'll look into using root. I'm guessing its a behavior flag?
These are located in a Behavior
(Basic) Movement: Movement Speed Maximum^ 160
set this to 0.
Ability: Abilities Disabled^ + (Move)
(Basic) Behavior: Suppress Movement Disabled <- Enable This.
As for the armor added
(Basic) Unit: Life Armor Bonus^ 0
(Basic) Unit: Life Armor Multiplier^ 1
just adjust the numbers to your preference.
I just set the movement multiplier to the lowest above 0 speed possible as a precaution.
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