• 🏆 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!

[JASS] SetUnitMovespeed

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,378
I had an issue with the GUI version of this function. If I did for example "Set movement speed to (200 + 30)" it didn't work for me, yet if I do "Set x = 200 + 30" and then "Set movement speed to x" it works fine.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
I had an issue with the GUI version of this function. If I did for example "Set movement speed to (200 + 30)" it didn't work for me, yet if I do "Set x = 200 + 30" and then "Set movement speed to x" it works fine.

The two do exactly the same thing, there mist have been something else that changed the outcome.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
In gameplay constants, there is a field for minimum unit speed and maximum unit speed.
The maximum is capped at 522 and the minimum is (downwards)capped at 0.
When you set a unit's movement speed using this function, you will set it to the minimum if the given value is lower than that.

So if the value in gameplay constants is 0, you can set the movement speed to 0 (which also removes the buttons in the UI).
 
Status
Not open for further replies.
Top