1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Channelling interruption detection?

Discussion in 'Triggers & Scripts' started by Moonman, Feb 13, 2020.

  1. Moonman

    Moonman

    Joined:
    Sep 8, 2008
    Messages:
    52
    Resources:
    0
    Resources:
    0
    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?
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,689
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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.
     
  3. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,427
    Resources:
    20
    Spells:
    20
    Resources:
    20
    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).
     
  4. Moonman

    Moonman

    Joined:
    Sep 8, 2008
    Messages:
    52
    Resources:
    0
    Resources:
    0
    Oh boy, isn't as simple as I thought.
    Thank you though, I'll try your ideas, and say what was the result.
     
  5. Moonman

    Moonman

    Joined:
    Sep 8, 2008
    Messages:
    52
    Resources:
    0
    Resources:
    0
    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
     
  6. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,427
    Resources:
    20
    Spells:
    20
    Resources:
    20
    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.
     
  7. Moonman

    Moonman

    Joined:
    Sep 8, 2008
    Messages:
    52
    Resources:
    0
    Resources:
    0
    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.