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

Fixing Leak If Spell is Interrupted;

Status
Not open for further replies.
Level 2
Joined
Nov 3, 2018
Messages
12
I have created a working Mass Teleport ability out of Channel which requires no targets and teleports allies. I want to know how to clear the leaks in the second trigger if the spell is interrupted before it takes place. I have to use the variables that need cleared, which are setup in the first part, for the second part to work.

  • Mass Teleport Human Sorc
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport (Human Sorceress)
    • Actions
      • Set MassT_Caster = (Casting unit)
      • Set MassT_Point = (Target point of ability being cast)
      • Set MassT_CasterLoc = (Position of (Casting unit))
      • Special Effect - Create a special effect at MassT_CasterLoc using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
      • Set MassT_Effect = (Last created special effect)
      • Countdown Timer - Start MassT_EffectTimer as a One-shot timer that will expire in 5.00 seconds
      • Special Effect - Set Scale of (Last created special effect) to 5.00
      • Special Effect - Set Time Scale of MassT_Effect to 0.40
      • Trigger - Turn on Mass Teleport Human Sorc2 <gen>
      • Trigger - Turn on Mass Teleport Human Sorc3 <gen>
  • Mass Teleport Human Sorc2
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport (Human Sorceress)
    • Actions
      • Set MassT_Group = (Units within 500.00 of MassT_CasterLoc matching (((Matching unit) belongs to an ally of (Owner of MassT_Caster)) Equal to True))
      • Unit Group - Pick every unit in MassT_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
            • Then - Actions
              • Unit - Move (Picked unit) instantly to MassT_Point
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_MassT_Group)
      • Custom script: call RemoveLocation(udg_MassT_Point)
      • Custom script: call RemoveLocation(udg_MassT_CasterLoc)
      • Trigger - Turn off (This trigger)
  • Mass Teleport Human Sorc3
    • Events
      • Time - MassT_EffectTimer expires
    • Conditions
    • Actions
      • Special Effect - Destroy MassT_Effect
      • Trigger - Turn off (This trigger)
How do I setup a conditional for if the channeling is interrupted, so that I can destroy the leaks created in the first trigger?

Also, how do I make it so that in the second trigger, not only are structures ignored, but also wards are ignored?
 
Last edited:
Level 15
Joined
Jul 9, 2008
Messages
1,552
use another trigger with
  • Unit - A unit Stops casting an ability
as the event with the removal of your leaks

also i dont believe there is a unit classification check for wards might have to use unit type comparison for each ward in your map
 
Since this is an MUI you need indexing for this or use hashtables, correct me if I'm wrong.
but try this
  • Mass Teleport Human Sorc
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport (Human Sorceress)
    • Actions
      • Set MassT_Caster = (Casting unit)
      • Set MassT_Point = (Target point of ability being cast)
      • Set MassT_CasterLoc = (Position of (Casting unit))
      • Special Effect - Create a special effect at MassT_CasterLoc using Abilities\Spells\Undead\ReplenishMana\ReplenishManaCasterOverhead.mdl
      • Set MassT_Effect = (Last created special effect)
      • Countdown Timer - Start MassT_EffectTimer as a One-shot timer that will expire in 5.00 seconds
      • Special Effect - Set Scale of (Last created special effect) to 5.00
      • Special Effect - Set Time Scale of MassT_Effect to 0.40
      • Trigger - Turn on Mass Teleport Human Sorc2 <gen>
      • call RemoveLocation(udg_MassT_CasterLoc)
      • call RemoveLocation(udg_MassT_Point)
  • Mass Teleport Human Sorc2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set tmr = tmr + 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (tmr) Less than 3
        • Then - Actions
          • -----DO ACTIONS HERE----
        • Else - Actions
          • Trigger - Turn off (this trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true[/COLOR][/FONT][/LEFT]
            • Conditions
              • ((Triggering unit) is dead) Equal to True
              • ((Triggering unit) is Stunned) Equal to True
          • Then - Actions
            • Trigger - Turn off (this trigger)
            • -------- Remove Leaks here --------
        • Else - Actions
 
Last edited:
Level 2
Joined
Nov 3, 2018
Messages
12
  • Mass Teleport Human Sorc2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set tmr = tmr + 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (tmr) Less than 3
        • Then - Actions
          • -----DO ACTIONS HERE----
        • Else - Actions
          • Trigger - Turn off (this trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true[/COLOR][/FONT][/LEFT]
            • Conditions
              • ((Triggering unit) is dead) Equal to True
              • ((Triggering unit) is Stunned) Equal to True
          • Then - Actions
            • Trigger - Turn off (this trigger)
            • -------- Remove Leaks here --------
        • Else - Actions

1) On the first If/Then/Else, does the condition the integer 'tmr' being less than 3 stand for the cast time finishing the cast and the action following being the teleport?

2) On the second If/Then/Else, what what is the [/COLOR][/FONT][/LEFT]?

-Love the helpfulness guys, learning this editor is exciting and fun while preparing for the release of Reforged :)
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
On the first If/Then/Else, does the condition the integer 'tmr' being less than 3 stand for the cast time finishing the cast and the action following being the teleport?
It means that the the channel time is 3 seconds, so after 3 seconds, you put the actions you want to happen if it succeeds. Although, I must point out that there are a lot of flaws with the proposed trigger.

On the second If/Then/Else, what what is the [/COLOR][/FONT][/LEFT]?
Most likely a CnP mistake.
 
Level 2
Joined
Nov 3, 2018
Messages
12
  • Mass Teleport Cancel
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport (Human Sorceress)
    • Actions
      • Custom script: call DestroyGroup(udg_MassT_Group)
      • Custom script: call RemoveLocation(udg_MassT_Point)
      • Custom script: call RemoveLocation(udg_MassT_CasterLoc)
      • Trigger - Turn off Mass Teleport Human Sorc2 <gen>
      • Trigger - Turn off Mass Teleport Human Sorc3 <gen>
I added this for stopping (death or stun or silence). It seems to work, but what sort of flaws are you seeing @KILLCIDE?
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
The trigger Doomhammer wrote is also not MUI, and the flow for how it works is just not great. It uses things like Triggering Unit without having any events that would 'set' that response. The trigger you've written in your most recent post is the appropriate way to resolve the leaks. However, you should destroy the MassT_Effect special effect in your cancel trigger too, since you turn off the trigger that runs when the timer expires to clean up the effect.
 
Status
Not open for further replies.
Top