• 🏆 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!

Stopping unit from casting instant abilities

Status
Not open for further replies.
Level 3
Joined
May 17, 2012
Messages
15
Hello again. Is there a way to prevent a unit from casting instant abilities (e.g. berserk, channel no target)?

For solutions I've tried:
- ordering the unit to stop when it begins channeling. This does not interrupt instant abilities like berserk, so it does not work. I have attached a testmap which shows an example of this problem.
- removing the ability, then adding it again. This does interrupt instant abilities, but it also drains mana. I would prefer not having to store the mana cost of each level of every ability, so I do not want to do this if it is not necessary.
 

Attachments

  • onChannel.w3x
    18.2 KB · Views: 81
Level 3
Joined
May 17, 2012
Messages
15
It's because using requirements for spells takes a short time for the command card to update. In my map it's possible to have two or more instant cast abilities. In that short time where I modify spell requirements, I could cast all of my instant cast spells at that moment and they would go through. Disabling abilities also removes them from command card which also looks ugly and hides cooldowns (I'm trying to implement a global cooldown).
 
Level 12
Joined
May 9, 2009
Messages
735
Hello again. Is there a way to prevent a unit from casting instant abilities (e.g. berserk, channel no target)?

For solutions I've tried:
- ordering the unit to stop when it begins channeling. This does not interrupt instant abilities like berserk, so it does not work. I have attached a testmap which shows an example of this problem.
- removing the ability, then adding it again. This does interrupt instant abilities, but it also drains mana. I would prefer not having to store the mana cost of each level of every ability, so I do not want to do this if it is not necessary.

I don't really understand what you mean :vw_wtf:

You have to manually click the berserk ability (the one jungle troll berserkers have) in order to use. I don't get what you mean by instant abilities...
 
Level 3
Joined
May 17, 2012
Messages
15
Never mind, I figured out a solution. I decided to remove and add the cast ability, order the unit to stop, then set the unit's mana back to its original amount with a 0 second timer. I can't believe I didn't think of that earlier.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Make a trigger with the event "a unit is issued an order with no target" and issue the unit to stop.
to re-order units you must wait until the original order has been given.
this can be achieved by either having a 0 seconds wait timer or disabling the trigger.
i have a snippet for the first solution but cannot upload it.
some people including jonbon has got it and can give it to you.
icemanbo showed me the second solution and i am not familiar with it so he might explain it.

once you did that. you must make the instant cast abilities "non-instant cast".
just add 0.01 seconds casting time in the object editor
 
Status
Not open for further replies.
Top