• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Slow Auras

Status
Not open for further replies.
I'm writing a system that allows you to slow units given any percentage, and any duration,
but I'm facing several problems;

First, I thought that I could go about adding aura abilities with negative movement speed
bonuses to a unit (I'll make sure those auras are based on different abilities (One ability for
-1% movespeed, another for -2%, -4%, -8, -16, -32, and -64) so that they could stack),
but then I realized that the Warcraft III engine handles these auras with a low-frequency
timer, so I scrapped that idea.

Second, I thought I could simply cast slow abilities on units, but those don't stack!
I'd have to have 100 different abilities for percentages between 1 and 100, which
isn't worth it at all.

My only other option is to use one of those Movement speed libraries, but that
would force the mapmaker to use custom movement speeds with that library
for every unit! (Registry and shit)

What else can I do?
I can always write a system that only supports slows if the percentage is a multiple
of 5 (Not bad), but I want to know if there's another method for this.
 
Just set the unit movement speed. All speeds modifications should be based off of the default unit movement speed.

Then you just store the reduction % into a variable. (either assigned to the unit's index if you are using an indexer, or just into a hashtable)

It depends on how you want it to stack, though. Two -10% reductions can either be -20% (additive) or it can be one -10% reduction, and then reducing that result speed by -10%. (well, there is a third way to treat it, but it is prioritized movement reduction rather than stacking, used in WoW)

The first method is simpler. The second is a bit more complicated but it is easy nonetheless. I recommend that you just look at MoveSpeedX for an idea on how to do it:
http://www.thehelper.net/forums/showthread.php/133708-MoveSpeedX
 
Status
Not open for further replies.
Top