• 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.

Need help with a variable slow effect

Status
Not open for further replies.
Level 3
Joined
Jan 15, 2010
Messages
47
Hey all,

I have a custom item and hero system in my map (just a bunch of structs holding data) and one of the things I would like to add to my map would be a system that slows you down if you are holding more weight than you can hold.

The formula I have determined is:

Amount Slowed = 0.02 x (WH - WA)

Where, WA is weight allowance, or how much the hero can hold. WH is weight held, or how much the hero is currently holding.
For example, if a hero can hold 150 pounds, and the gear he has weighs him down 165 pounds:

Amount Slowed = 0.02 x (165 - 150) = 0.3 = 30%

I have thought of a couple ways to do this, the most immediate being to use SetUnitMovementSpeed to 70% of the normal and use a system to do the same with attack speed. I tried this out with 100% slowed, and my unit could still move and attack.
Another way I was working on last night was to make 10 different spells based on slow, each at 10% increments, but I couldn't figure out how to get the dummy unit to cast a custom spell. I gave the dummy the spell, then ordered it to cast the spell that the custom spell is based on (slow) and then did some testing to see the movement speed. Each case would slow me by 50%, which i think is the standard slow spell rate.

Has anyone tried to do such a thing and get success?
 
Level 12
Joined
Sep 4, 2007
Messages
407
You can use an dummy slow ability to be cast in him. such ability has a really long period of time (object editor). Make a lot ot levels, simulating the diference of percentage. so instead of directly changing the move speed, make it create a dummy unit, give the dummy ability to it, set the level according to the WA - WH whatever and order it to cast it on the hero. well, you can make this an periodic even aswell but you gonna need to use hashtables or array if you are planing to have a multyplayer map. if you go the idea and agree i'll explain some more, just PM me. I've made similar stuff before (like a power item threshold).
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
As you've said,using custom ability based on "slow" that has 10 levels would work fine i think.

  • Slow
    • Events
    • Conditions
    • Actions
      • Unit - Add Slow to (Dummy)
      • Unit - Set level of Slow for (Dummy) to [here put a variable that will be based on your weight %]
      • Unit - Order (Dummy) to Human Sorceress - Slow (Target unit of ability being cast)
Also remember to remove mana needed to cast your custom "slow" spell and it should work. If you want,i can post sample map.

EDIT: Aw...didn't see lelyandra's post...
 
Level 3
Joined
Jan 15, 2010
Messages
47
oh wow XD didn't think about making the slow spell have 10 levels lol. I made 10 individual spells with 10%, 20%, 30%, etc! lol. Okay I will do some testing and return with results :) Thanks!


Edit: Hmm, sample map would be very appreciated. I tried this, and at level 10, it is still slowing by 50% instead of 100%.
 
Last edited:
you might have a look at the gameplay constants since the minimum movement speed of all units is locked there to 150

I'll make you a testmap
just wait a few seconds

edit:
done
however you will have to either trigger all spells influencing movement speed yourself or think of some workaround because this will remove every movement speed buff if the duration is over
but it should not be that hard to trigger everything and it will be much more flexible then the usual slow stuff warcraft uses anyway
 

Attachments

  • SetSpeed.w3x
    13.8 KB · Views: 47
Status
Not open for further replies.
Top