• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] SetUnitMovespeed

Status
Not open for further replies.
Level 25
Joined
Sep 26, 2009
Messages
2,387
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.
 
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