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

[General] Mathematical Probrem

Status
Not open for further replies.
Level 13
Joined
Jul 16, 2012
Messages
679
Hi Hivers!

You know Boots of Speed :)

Boots of Speed (Add +60 ms)

You know Endurance Aura or Unholy Aura or etc have bonus movement speed

Let say i have boots of speed
in one hero have 260 default movement speed
then he have boots of speed so the current movement speed of the hero is 320

So, in some bonus movement speed auras
i want to know how many bonus movement speed add in the hero or all allied units

In Object Editor
Boots of Speed Ability
only Integer value allowed

but in bonus movement speed ability
you can put decimal value


Thank You!
 
Level 10
Joined
Apr 18, 2009
Messages
576
The reason why those auras use a decimal value is because their movement speed bonuses are percent based. For Unholy Aura or Encurance Aura, a value of 0.10 means "10% movement speed bonus".

Any hero carrying boots of speed would gain an extra 60 movement speed, regardless of its base movement speed.

The bonus movment speed gained from a percent based aura such a Unholy or Endurance Aura can vary. A faster unit gains more movement speed than a slower one affected by the same aura.

A hero with 250 base movement speed and no other movement speed modifications would gain 25 extra movement speed from level 1 Unholy or Endurance Aura. This is because 10% of 250 is 25 or in mathematical terms 250 * 0.1 = 25. However if the same hero was carrying boots of speed then its static movement speed would be 250 + 60 = 310. Then Unholy or Endurance Aura would give 31 bonus movement speed because 10% of 310 is 31.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Uh, it's hard to understand what you want when you're writing the whole thing like poem.

You can put integer in movement speed-affecting abilities like Boots of Speed, because it adds movement speed to the unit -- like how you wrote. 260 base movement speed + 60 boots of speed MS = 320 total MS.
Auras like Unholy Aura increase MS as well, but they give a bonus % to movement speed.
Percents are usually converted to real number with 100% being 1.00 real, 90% being 0.90, etc. which is the reason why real number is allowed for those abilities.

How they stack?
Well, in case of Unholy Aura, it takes ( [base movement speed] + [items] ) * [% bonus from aura].

Example: Aura gives 10/20/30% bonus movement speed. Base movement speed is 150 and speed from item is 60.
Movement Speed = (150 + 60) * 1,1 => 231
Movement Speed = (150 + 60) * 1,2 => 252
Movement Speed = (150 + 60) * 1,3 => 273

I have no idea how abilities stack between themselves, however you can easily check it yourself.
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Current speed: + (String((Current movement speed of *Your unit*))))
This shows the current movement speed of *your unit* (buffs and items included). Tho be aware that this function seem to show only speed between 150.00 to 400.00, even if the current unit's speed is lesser or higher.
 
Status
Not open for further replies.
Top