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

Check Movement Speed?

Level 5
Joined
May 8, 2020
Messages
78
Check MS
Events
Player - Player 1 (Red) types a chat message containing -ms as An exact match
Conditions
Actions
Set CurrentMovementSpeed = (Integer((Current movement speed of (Triggering unit))))
Set DefaultMovementSpeed = (Integer((Default movement speed of (Triggering unit))))
Game - Display to (All players) the text: (String((Current movement speed of (Triggering unit))))
Game - Display to (All players) the text: (String((Default movement speed of (Triggering unit))))

how to check current speed of unit when i click , like dota ? Running speed can be increased
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,548
Replace (Triggering unit) with an Event Response or Variable related to the Unit you have selected.

Here we can get our unit using an Integer and Unit array variable:
  • Events
    • Player - Player 1 (red) selects a unit
  • Conditions
  • Actions
    • Set PN = (Player number of (Triggering player))
    • Set SelectedUnit[PN] = (Triggering unit)
Then here we can reference said unit:
  • Check MS
    • Events
      • Player - Player 1 (Red) types a chat message containing -ms as An exact match
    • Conditions
    • Actions
      • Set PN = (Player number of (Triggering player))
      • Set CurrentMovementSpeed = (Integer((Current movement speed of SelectedUnit[PN])))
      • Set DefaultMovementSpeed = (Integer((Default movement speed of SelectedUnit[PN])))
      • Game - Display to (All players) the text: (String(CurrentMovementSpeed))
      • Game - Display to (All players) the text: (String(DefaultMovementSpeed))
You can also use this method to store your player's hero:
  • // The player's Hero is created
  • Set PN = (Player number of the owner of the hero)
  • Set PlayerHero[PN] = the hero that was created
Now as long as you have access to a Player you can also get access to their Hero.
 
Top