• 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 Effect stays ono unit. Leak?

Status
Not open for further replies.
Level 2
Joined
Mar 27, 2020
Messages
16
Hey there, I got a Problem that sometimes a special effect doesn't get destroyed. In like 90% of the cases it works and it is destroyed, in like 10 it doesn't and the effects stack onto each other which is really annoying. I don't know why. But then, what do I know, I'm new to this. :) Anyone have an idea?

  • Lightning shield lvl 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Lightning Shield
      • (Level of Thunder Lightning Shield for (Triggering unit)) Equal to 1
    • Actions
      • Trigger - Turn on Lightning shield periodic lvl1 <gen>
      • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
      • Set VariableSet LightnigshieldEffect = (Last created special effect)
      • Wait 9.50 seconds
      • Trigger - Turn off Lightning shield periodic lvl1 <gen>
      • Special Effect - Destroy LightnigshieldEffect
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
Most likely, the issue lies in variable "LightnigshieldEffect" being overwritten by another instance of the spell.
Take this situation as example:
You cast the ability for first time - The variable LightnigshieldEffect references the special effect.
Now within the 9.5 second wait time, another unit (or even the same unit) casts the spell again. Now the LightnigshieldEffect references the special effect of the second instance of the spell.
So now nothing references the special effect of the first cast, hence the trigger does not remove the special effect from the first unit.
What you would need then is to set up the trigger in such a way, that it can safely handle multiple instances of the spell at the same time (making the spell "MUI"). Check this tutorial Visualize: Dynamic Indexing
 
Level 2
Joined
Mar 27, 2020
Messages
16
Most likely, the issue lies in variable "LightnigshieldEffect" being overwritten by another instance of the spell.
Take this situation as example:
You cast the ability for first time - The variable LightnigshieldEffect references the special effect.
Now within the 9.5 second wait time, another unit (or even the same unit) casts the spell again. Now the LightnigshieldEffect references the special effect of the second instance of the spell.
So now nothing references the special effect of the first cast, hence the trigger does not remove the special effect from the first unit.
What you would need then is to set up the trigger in such a way, that it can safely handle multiple instances of the spell at the same time (making the spell "MUI"). Check this tutorial Visualize: Dynamic Indexing

I don't think that's the reason because no other unit casts this spell and also the cooldown of the casted spell is at 30 seconds. so its not possible to cast it a second time in these 9.5 seconds. :(
 
Level 2
Joined
Mar 27, 2020
Messages
16
What does Lightning shield periodic lvl1 do exactly?

  • Lightning shield periodic lvl1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Jonathan
    • Actions
      • Unit - Create 1 DummyCopter Ground for (Owner of (Attacked unit)) at (Position of (Attacked unit)) facing Default building facing degrees
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • Unit - Add Chain Lightning cast by dummy when Lightning Shield is castet to (Last created unit)
      • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning (Attacking unit)
 
Level 29
Joined
Sep 26, 2009
Messages
2,596
Check your triggers if you don't use the LightnigshieldEffect variable anywhere else. The trigger you posted is very simple and if you don't have multiple active instances, it should work as intended. If you use the variable in other triggers, you may be replacing the referenced special effect there.

To quickly check where your variable is used, you could delete the variable in trigger editor, which will cause all affected triggers to be invalidated and have red triangle in the trigger icon. Then use the "Undo" option to return the variable and make your triggers work again.
 
Status
Not open for further replies.
Top