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

[Trigger] How to cancel a custom ability trigger on cancelling/moving?

Status
Not open for further replies.
Level 8
Joined
Mar 17, 2016
Messages
133
I apologize if this has a million other threads solving this problem but I couldn't find them.

I was wondering how to cancel a triggers functions once a unit moves, eg. stops casting/channeling the ability.

Right now I have a custom "starfall" ability where if the unit casting cancels the spell early he will continuously have explosions on his position but be doing no damage.
I understand that the "wait" function is probably not the ideal thing to be using here, but I am unsure how to make a cleaner trigger that would work better, or even properly.
This one works, but it would be vastly superior to have one that does not have inconsistent special effects.






  • MG InfPillar
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Inferno Pillar (MG)
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set VariableSet UnitAbilPos[1] = (Position of (Triggering unit))
          • Special Effect - Create a special effect at UnitAbilPos[1] using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Set VariableSet SpecialEffectAbil[0] = (Last created special effect)
          • Special Effect - Set Scale of SpecialEffectAbil[0] to 1.25
          • Special Effect - Set Color of SpecialEffectAbil[0] to r: 175, g: 175, b: 55
          • Wait 1.50 seconds
          • Special Effect - Destroy SpecialEffectAbil[0]
      • Custom script: call RemoveLocation(udg_UnitAbilPos[1])


I'm also interested in this because I may have triggers that are not only special effects that will need to stop their functions when the ability is no longer channelled.
 
Status
Not open for further replies.
Top