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

A way to stop casting of ability?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
Is there an action to cancel a Hero's casting of an ability?


Basically I've got my Hero unit, he has an ability that spawns a minion unit to attack. While this minion is alive (Has 5 second expiry time) I don't want the player to have access to his Hero.

The spawned minion unit has an ability (Cancel) when used kills the spawned unit. Basically allows the player at any time to kill the spawned unit and go back to his Hero.

But the ability has 'Data follow through time' It's set at 5 seconds. So if the triggering unit dies the hero is still in a casting/summoning animation and can't be moved.

Thanks.
 
Level 11
Joined
Jul 4, 2016
Messages
627
Or, you can temporally disable or remove the ability to remove the following up time pause effect then put it back afterwards.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,511
Is there an action to cancel a Hero's casting of an ability?


Basically I've got my Hero unit, he has an ability that spawns a minion unit to attack. While this minion is alive (Has 5 second expiry time) I don't want the player to have access to his Hero.

The spawned minion unit has an ability (Cancel) when used kills the spawned unit. Basically allows the player at any time to kill the spawned unit and go back to his Hero.

But the ability has 'Data follow through time' It's set at 5 seconds. So if the triggering unit dies the hero is still in a casting/summoning animation and can't be moved.

Thanks.

Since you're using the "Disable Other Abilities" option on Channel this makes your hero immune to stuns/silences/disables and makes it unusable. I wonder, is this your actual desired effect? It sounds like you want to turn Disable Other Abilities off and make this ability work like any normal channel ability (like blizzard for example).

If you turn off "Disable Other Abilities", then you can just order the Hero to Stop.

Here's the triggers. You'll need to store the Hero and Summon as variables:

When your summon dies we order the hero to stop channeling.
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to YourSummon
    • Actions
      • Unit - Order YourHero to Stop
When you stop channeling the ability we check if your summon is alive, and if it is we kill it.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to YourSummonAbility
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (YourSummon is alive) Equal to True
        • Then - Actions
          • Unit - Kill YourSummon
        • Else - Actions
///////////////////////////////////////////////////////

Otherwise, if you want the Hero to be "paused" aka "Disable Other Abilities = True", which I advise against as pausing units seems to cause a lot of undesired outcomes, you will want to instead pause/unpause your Hero through triggers.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourSummonAbility
    • Actions
      • Unit - Pause (Triggering unit)
Then unpause your hero instead of ordering it to stop in the first trigger. If you choose this pause/unpause option make sure to set "Disable Other Abilities" to false, since the triggers already do this for us.
 
Last edited:
Status
Not open for further replies.
Top