HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Issue with modifying unit movement speed.

08-17-2008, 07:56 PM#1
burningice95
For the olympic spell contest, I have a spell that constantly increases/decreases a unit's movement speed based on whether it is moving or not. This is the code:
Collapse JASS:
call SetUnitMoveSpeed(u, GetUnitMoveSpeed(u) + MovespeedPerInt(level)

However, the problem is that if a unit is slowed, GetUnitMoveSpeed(u) returns the value of the units current movespeed, not the actual movespeed of the unit. So when this function is called on a slowed unit, it might cuase its ms to go from 400 to 175.

I have thought about using a +Movement speed ability, but these dont stack, so binary adding is impossible.

My current solution is have one movespeed ability with 100 levels that gives 1-100 ms, another that gives 101-200 ms, and a third for 201-300 ms, and use those to control movement speed adition. However, this is a pretty lame solution.
08-17-2008, 08:13 PM#2
rulerofiron99
Maybe use Unit - Custom Value?

If the problem is simply the returning of a unit's current movespeed, there is a function for Default movespeed.
08-17-2008, 08:22 PM#3
Anitarf
There are a ton of ways to attach data to units; just use one of them to attach what the current move speed of the unit is supposed to be.