• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Setting unit's movement speed to 0 but can still turn. How?

Status
Not open for further replies.
Level 2
Joined
Jan 13, 2019
Messages
8
Hey guys! This is my first time posting

I am working on a new map which is a moba just like dota. I have some few knowledge already with
GUI but nothing on Jass.

Anyway, I made a unit which is a neutral monster. I want it to stand still in a zone so I changed its
movement speed amount to 0 but at the same time, I also still want it to turn. Having 0
movement speed loses the ability to turn.
I also dont want to change the game constant to 0 minimum speed and give it a 1 speed because
it's a moba game and if a unit's speed gets reduced to 0 by spamming slowing spells, that will be
imbalance for the game.

TLDR: I want my unit to be able to turn to its attack target without moving away from its position. Any tips, guys?
Thanks in advance
 

~El

Level 17
Joined
Jun 13, 2016
Messages
556
One of the easiest ways to accomplish this I can think of is to turn the unit into a building, and then use triggers to manually set the facing angle of the unit whenever it starts an attack.

Alternatively, it may also be worth trying to remove the "Move" ability from the unit via triggers as well.
 
Level 14
Joined
Sep 28, 2011
Messages
968
When an unit does not have the move ability it will probably still move when it wants to attack an unit out of range.
so for example a footmen gets close enough to a move speed 1 tower without the move ability for the tower to shoot at it then the footmen flees the tower will probably pursue with its move speed of 1.
 
Last edited:
Level 2
Joined
Jan 13, 2019
Messages
8
thanks you guys, i will try these suggestions when I get back to work, just a little busy lately
will update this thread as soon as I did these
i hope thats okay with this site.
thanks everyone!
 
Level 2
Joined
Jan 13, 2019
Messages
8
or you permanently cast an ensnare spell on the unit.

I'm really not that good with JASS, at least for now.
But the ensnaring the unit works great, they aint moving, they still attack, they're turning
problem solve. thanks man!

also, thanks to those who replied, i appreciate it

how do I mark this solved? im new here lol
 
Level 2
Joined
Jan 13, 2019
Messages
8
I think my solution is better, since Ensnare will leave a permanent buff in the status indicator.
I tried that and it didn't work but thanks anyways. In the mean time, the ensnaring thing will do. I customized the buff, instead, the tooltip there tells info about the unit so it doesnt look like it's ensnared. I also removed the ensnare art effect so yeah, it's good. I also added a trigger that works periodically that when there's a scenario that the ensnare buff got purged or removed in any way from the unit. It will be ensnared again.
 
Level 21
Joined
May 29, 2013
Messages
1,567
I tried that and it didn't work
Trust me, it works. I used this trick many times and even tested it again just to make sure.

You only need to change the propulsion window to 0; don't change any other field. You probably mistakenly changed the unit's movement speed and/or turn rate to 0; they should NOT be 0 in order for this to work.
 
Last edited:
Level 2
Joined
Jan 13, 2019
Messages
8
Trust me, it works. I used this trick many times and even tested it again just to make sure.

You only need to change the propulsion window to 0; don't change any other field. You probably mistakenly changed the unit's movement speed and/or turn rate to 0; they should NOT be 0 in order for this to work.

But that's my aim, I gotta make a unit that doesn't move but turns. If the movement speed is not 0. It will move at a slowest 75 speed. I cannot change the game constant's minimum speed lower than 75 because it's a MOBA game and having a minimum speed lower than 75 will be imbalance for the game.
 
Level 21
Joined
May 29, 2013
Messages
1,567
But that's my aim, I gotta make a unit that doesn't move but turns. If the movement speed is not 0. It will move at a slowest 75 speed. I cannot change the game constant's minimum speed lower than 75 because it's a MOBA game and having a minimum speed lower than 75 will be imbalance for the game.
I know it seems counterintuitive to set the movement speed to anything larger than 0, but I know what I'm talking about; the unit will NOT be able to move, only turn.

If you still don't believe me, select any standard unit in the Object Editor (e.g. Footman, Ghoul, Archer, etc.), change its propulsion window to 0, (without changing anything else); place the unit somewhere on the map and test it.
 
Last edited:
Level 2
Joined
Jan 13, 2019
Messages
8
I know it seems counterintuitive to set the movement speed to anything larger than 0, but I know what I'm talking about; the unit will NOT be able to move, only turn.

If you still don't believe me, select any standard unit in the Object Editor (e.g. Footman, Ghoul, Archer, etc.), change its propulsion window to 0, (without changing anything else); place the unit somewhere on the map and test it.

It worked and you were right! The reason why it didn't work for me before is because the unit's speed was 0. How come no one used or said this very simple solution before? Except you. Lol Both the ensnaring and this are good solutions. I will both take note of these for future use. But in my situation right now, I am definitely using your method Hermit. Thank you so much and apologize for taking a while for me to get it.
 
Level 2
Joined
Jan 13, 2019
Messages
8
Tasyen mentioned 'SetUnitPropWindow', which is the exact same thing, but done with triggers.

yeah i noticed, but i mean, no one suggested to do it like what you said. even in other sites/forums. this is the first time I saw this being suggested by someone. or maybe i jst missed theirs. thanks again Hermit. Do I have to mark this thread solved or something?
 
Level 12
Joined
Nov 3, 2013
Messages
989
Footman 'Defend' ability works the same as ensnare without showing any buff, it can be quite useful if you want something like a Siege tank's Siege mode where the unit can move or only stay stationary depending on the toggle.

Though this appears to already be solved.
 
Level 2
Joined
Jan 13, 2019
Messages
8
yeah but thanks anyway, that's another method, can be useful, ya never know
 
Status
Not open for further replies.
Top