• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
Level 9
Joined
Mar 17, 2016
Messages
156
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.
Back
Top