• 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.

Special Effects Destruction

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2008
Messages
233
Lets say i pick units within 300 range of casting hero, and make an special effect on them all. I can set variable only to last created special effect, and when i call function destroy ( myEffect) it will only destroy that last one..how can i destroy them all as a group of special effects?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
this will destroy all effect and avoid leaks
  • Unit Group - Pick every unit in (Units within 300.00 of loc)) and do (Actions)
    • Loop - Actions
      • Special Effect - Create a special effect attached to the overhead of (picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)
 
Level 6
Joined
Dec 9, 2008
Messages
233
U see I'm not using destroy special effect in the same trigger..and using waits screws up triggers totaly

  • Unholy Mist Cast First Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Unholy Mist
      • UMState Equal to (==) 0
    • Actions
      • Set UMState = 1
      • Countdown Timer - Start UMTimer as a One-shot timer that will expire in UMLast seconds
      • Set UMPoint1 = (Target point of ability being cast)
      • Set UMPoint2 = (UMPoint1 offset by UMAOE towards (Facing of UMCaster) degrees)
      • Set UMPoint3 = (UMPoint2 offset by UMAOE towards (Facing of UMCaster) degrees)
      • Set UMPoint4 = (UMPoint3 offset by UMAOE towards (Facing of UMCaster) degrees)
      • Set UMCaster = (Casting unit)
      • Special Effect - Create a special effect at UMPoint1 using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
      • Set UMEffect1 = (Last created special effect)
      • Wait 0.25 seconds
      • Special Effect - Create a special effect at UMPoint2 using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
      • Set UMEffect2 = (Last created special effect)
      • Wait 0.25 seconds
      • Special Effect - Create a special effect at UMPoint3 using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
      • Set UMEffect3 = (Last created special effect)
      • Wait 0.25 seconds
      • Special Effect - Create a special effect at UMPoint4 using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
      • Set UMEffect4 = (Last created special effect)
  • Unholy Mist Dmg Second Trigger
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
      • UMState Equal to (==) 1
    • Actions
      • Unit Group - Pick every unit in (Units within UMAOE of UMPoint1) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of UMCaster) is an enemy of (Owner of (Picked unit))) Equal to (==) True
            • Then - Actions
              • Unit - Cause UMCaster to damage circular area after 0.00 seconds of radius UMAOE at UMPoint1, dealing UMDmg damage of attack type Spells and damage type Normal
              • Unit - Cause UMCaster to damage circular area after 0.25 seconds of radius UMAOE at UMPoint2, dealing UMDmg damage of attack type Spells and damage type Normal
              • Unit - Cause UMCaster to damage circular area after 0.50 seconds of radius UMAOE at UMPoint3, dealing UMDmg damage of attack type Spells and damage type Normal
              • Unit - Cause UMCaster to damage circular area after 0.75 seconds of radius UMAOE at UMPoint4, dealing UMDmg damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
              • Set UMFireEffect = (Last created special effect)
            • Else - Actions

  • Unholy Mist End Third Trigger
    • Events
      • Time - UMTimer expires
    • Conditions
      • UMState Equal to (==) 1
    • Actions
      • Set UMState = 0
      • Special Effect - Destroy UMEffect1
      • Special Effect - Destroy UMEffect2
      • Special Effect - Destroy UMEffect3
      • Special Effect - Destroy UMEffect4
      • Special Effect - Destroy UMFireEffect
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
this will destroy all effect and avoid leaks
  • Unit Group - Pick every unit in (Units within 300.00 of loc)) and do (Actions)
    • Loop - Actions
      • Special Effect - Create a special effect attached to the overhead of (picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)

but then why somebody add a attachment if remove it in same moment?

(about wait, impossible save umfireeffect to harshtable then if skill is over destroy all? just a question)
 
Level 6
Joined
Dec 9, 2008
Messages
233
yeah ill try to play around with hashtables and see if i get it to work because i want my fire to last for like 6 seconds and not to be destroyed almost immediately
 
Status
Not open for further replies.
Top