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

[Solved] Is it possible to ensure minimal movement speed with differentiation?

Status
Not open for further replies.
Level 3
Joined
Nov 11, 2021
Messages
28
Is it possible to ensure different minimal movement speed for different units?
The problem is wc3 -% speed modifier is additive, and easily accumulate to zero.

Game constants is bad because it is same for all units.
+% Speed modifier is bad because it strongly negates slowing effects.
SetUnitMoveSpeed() alone is useless because it does not help with -% modifier.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
You'd have to use your own movespeed system. It shouldn't be that hard if you're familiar with coding. You'd probably rely on SetUnitMoveSpeed() and have some variables to track each unit's +/- movespeed values. Tie that into some functions like:
vJASS:
function ModifySpeed takes unit u, real ms returns nothing
      // pass a negative value to slow the unit
      if GetUnitMoveSpeed(u) + ms >= GetUnitMinimumSpeed(u) then
           // apply ms to the unit's movement speed
      else
           // set movement speed to minimum value
      endif
      // this will adjust movement speed without going
      // below this unit's minimum movement speed
endfunction
Edit: Nevermind, apparently this mechanic exists already. What a pleasant surprise.
 
Last edited:
One can set max/min movespeed for an unitcode inside object editor.
Unit - Movement - Speed Max
Unit - Movement - Speed Min
if you use 0 for one of these (default), then the cap from gameconstants is used. But if you write a different number into this field, than this unit's movespeed caps are different. If you set Speed Min to Speed Base than a unit is kinda immune to movespeed slows. Slows could only cancel out speed boni.
 
Level 3
Joined
Nov 11, 2021
Messages
28
One can set max/min movespeed for an unitcode inside object editor.
Unit - Movement - Speed Max
Unit - Movement - Speed Min
if you use 0 for one of these (default), then the cap from gameconstants is used. But if you write a different number into this field, than this unit's movespeed caps are different. If you set Speed Min to Speed Base than a unit is kinda immune to movespeed slows. Slows could only cancel out speed boni.
I'm wondering if I am blind, or human auto ignore zero😅
 
Status
Not open for further replies.
Top