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

[Solved] Uncancelable Ability?

Status
Not open for further replies.
I have a spell where I want the caster to be "locked up" in an animation for 0.4 seconds or so, being unable to be cancelled by spamming move-orders and also not being cancelled by stuns and such. Is this achiveable?

Current setup is a channel-based ability with Follow Through Time = 0.4 and most other things standard
1653649020218.png

I set the animation after a 0.0 timer delay, like so:
  • HHNinjaStrike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ninja Strike (channel, Target point)
    • Actions
      • Custom script: local timer t = NewTimer()
      • Game - Display to (All players) the text: Begin
      • Custom script: call TimerStart(t, 0.00, false, function Trig_HHNinjaStrikeAnimation_Actions)
      • Custom script: set t = null
  • HHNinjaStrikeAnimation
    • Events
    • Conditions
    • Actions
      • Custom script: call SetUnitAnimationByIndex(udg_hh_hero, 8) // Play Attack 2

This works, but is cancellable by the player and by stuns.
Is it possible to prevent it from being cancelled?
 
Level 18
Joined
Mar 16, 2008
Messages
721
maybe something along the lines of:

  • casts
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Unit - Change ownership of (Casting unit) to Neutral Passive and Retain color
  • finish casts
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • Unit - Change ownership of (Casting unit) to Player 1 (Red) and Retain color
obviously add condition and maybe change the event, but something generally like this would be my idea. also consider neutral hostile or the alliance of what player assumes control.

edit: also add hero to selection of player b/c it will deselect when you change ownership
 
Last edited:
Cool, I'll try a few different solutions out and see how well they work :)

Edit:
So I Tried the easiest solution first: Disable other abilities=true.
This seems to work as I hoped, meaning that I cannot cancel the order and stuns during the animation does not cancel anything and the stun continues as expected after the animation finishes. Selection is not messed with (as an ownership change would).
Only known side-effect (so far) is the unit buttons (abilities + move, attack etc.) disappear during the cast, but that's fine.

Edit2: Other side effect maybe to be "Pause" unit, meaning buffs etc. does not count down?

Thanks :)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,496
Cool, I'll try a few different solutions out and see how well they work :)

Edit:
So I Tried the easiest solution first: Disable other abilities=true.
This seems to work as I hoped, meaning that I cannot cancel the order and stuns during the animation does not cancel anything and the stun continues as expected after the animation finishes. Selection is not messed with (as an ownership change would).
Only known side-effect (so far) is the unit buttons (abilities + move, attack etc.) disappear during the cast, but that's fine.

Thanks :)
Pausing units has a few unwanted side effects which you can read about here: [vJASS] - [Snippet] SuspendUnit

BlzPauseUnitEx() is different though and acts as a stun: [vJASS] - PauseUnitEx

But if you don't care about the side effects of Pause then by all means use it.
 
Status
Not open for further replies.
Top