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

Channelling interruption detection?

Status
Not open for further replies.
I hope this is the right place to ask a trigger/spell related question.

I had a simple idea for a spell.
Hero casts Tranquillity.
Roots surround him and a dummy summons locust spell.
But I wish to unsummon this dummy if the hero is interrupted from channelling.

Trigger was rearranged many ways none have worked:

upload_2020-2-13_18-16-33.png


Any ideas how to fix it?
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
The “unit stops casting” event will fire when channeling is interrupted or fully completes. You’ll need to store the casting unit in some way. Either use a hashtable with the caster as a key or make a set of parallel arrays to store caster and dummy.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
The reason why your trigger doesn't work the way you wanted is because it lacks a detection event... conditions inside of it will only execute once the caster starts channeling because of the said event. So you must create another trigger for detecting channel interruptions. Remember to store those data or units into variable for referencing purposes. However, this may force you to make it MUI to avoid such multi casting complications (depends on you).
 
So... not sure if this is what you meant, but it seems to work:

Trigger for creating the unit, putting it in a group, then ordering it to do whatever...

  • Emerald Nightmare
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Emerald Nightmare
    • Actions
      • Unit - Create 1 Heart of Nightmare for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
      • Unit Group - Add (Last created unit) to EmerNightGRP
      • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Undead Crypt Lord - Locust Swarm.
Trigger for picking the created unit group, checking if it's owned by the caster, and removing if the caster is stopped.

  • Emerald Nightmare Stop
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Emerald Nightmare
    • Actions
      • Unit Group - Pick every unit in EmerNightGRP and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Casting unit)) controller) Equal to ((Owner of (Picked unit)) controller)
            • Then - Actions
              • Unit - Remove (Picked unit) from the game
            • Else - Actions
              • Do nothing
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Yeah that works but beware that once the ability is casted simultaneously by another caster and the other one gets interrupted... there will be complications. As it is not MUI but it's up to your case. You may also remove the do nothing line in else block as it is not that beneficial. You should learn variables too.
 
Yeah that works but beware that once the ability is casted simultaneously by another caster and the other one gets interrupted... there will be complications. As it is not MUI but it's up to your case. You may also remove the do nothing line in else block as it is not that beneficial. You should learn variables too.

I see, so "do nothing" is simply useless?

Also, shouldn't the owned of picked unit remove the simultaneous casting issue?

I tested it with two of heros under my control, it got interrupted. But you won't have 2 of the same heroes under your control.

But then I had a neutral hostile owned hero cast it. My hero interrupted his channel, hostile still cast(ed?) it.
 
Status
Not open for further replies.
Top