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!
Basically store the cooldown number into a variable (real). When the ability is cast for the first time, run a timer using the variable you created. After that timer expires (cooldown) the ability is ready to be used again and it will keep doing this everytime you cast that ability.
If that function returns true, you are able to cast it.
Units that can cast those abilities instantly (0 cast time, 0 cast point, 0 rotation delay, etc) will have cast it before you can order them to stop casting it.
Then you also have abilities like berserk, defend, etc.
But that is not the only thing...
When it returns false, the reason may be from many different things.
It could be the ability is on cooldown, but it could also be that the unit hasnt got enough mana, the target that is used is untargetable, the caster is stunned/silenced/whatever, etc.
So keeping track of the cooldowns and stuff is the best thing to do.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.