• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make an ability have cooldown before used?

Status
Not open for further replies.
Level 1
Joined
Dec 3, 2015
Messages
1
I want to add initial cooldown to an ability so it can't be immediately used. How do I do this? Sorry if this question is too noobish, and thanks in advance.
 
That is an interesting problem. The easiest way is to just disable or remove the ability and replace it with a "dummy" ability. That dummy ability will have the same mana, cooldown, description, etc. Give the unit enough mana to cast the spell, and order the spell to be cast, start a short timer, and give the unit his mana back. Start a timer for the cooldown of the spell, and when the timer expires, replace the dummy ability with the real ability.

However, the big problem with this is that this will trigger the unit's cast animation/cast backswing. Softmints proposed a pretty clever solution a while back:
http://www.hiveworkshop.com/forums/2075311-post5.html
Again, this is a really specific method and a bit convoluted, but cooldowns are actually quite hard to manipulate!

A third solution would be to use the first method, but make the dummy ability have the order ID of one of the abilities that does not interrupt order: (e.g. Berserk, and some activated abilities) (guide). Give the unit a similar ability of the same order ID and when that one is ordered, it'll trigger the cooldown of spells with the same base order ID.

Overall, I apologize. I haven't given much information beyond some untested ideas--perhaps someone can give you a test map that illustrates these solutions (or give an even better solution!). If you want to run your own tests and experiments, I recommend that you first acquaint yourself with the "Channel" ability:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=14972
It is the only spell that allows you to choose the base order ID. You can try fiddling and running experiments with spells of the same order ID and see if you get a good solution.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Maybe kind of weird, and I have by no means tested this before suggesting it, but you could probably make dummy units or items instead of abilities (Though you wouldn't see the mana cost the same way) and add either one to the unit as an item or unit to be sold with 0 stock and then remove it when it's recharged.

The only advantage with using this over dummy abilities is probably that you never have to make the unit use any ability, but that really shouldn't be that big of a problem, while I've got no idea what kind of drawbacks it's going to have instead (Besides not showing the mana cost).

Personally I would have maybe tested this (my suggestion) for fun but otherwise I'd most likely use the dummy ability solution, unless that somehow doesn't work.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Status
Not open for further replies.
Top