• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Cooldown Detect

Status
Not open for further replies.
I don't think you can detect cooldowns so easy.

What you could do is, create a boolean variable for the spells and everytime a spell is casted you set the boolean to true.
(for example: set BlizzardCooldown[PlayerNumber(GetTriggerPlayer) - 1] = true)
And wait x seconds and set it to false again.

So you just have to check if the boolean is true or false.

Another way is to work with dummys, make a dummy for every spell and everytime you want to know if the spell is on cooldown, try to cast the spell and check if something happens (damage or whatever).

Both took long, but I don't know other ways..
Hopefully it helps you anyway.
 
For me, I would save each spell that is used on map (not all spells in Object Editor), to be saved in a hashtable with Real values representing the cooldown for a certain spell.

Then, each time a spell is casted, I load up the value and start handle its timer.
When it reaches 0, the cooldown is over.
If not, the cooldown still goes on.
 
Status
Not open for further replies.
Back
Top