Removing a Special effect after X seconds?

sabatadark

New Member
Reaction score
0
I have an issue in my map. After a unit is hit, a special effect is supposed to appear, attached to the attacked unit's overhead. This special effect is supposed to disappear after 3 seconds. However, the way I have it set up now, it only deletes the last created special effect. This is an issue because multiple of the special effect can occur within this 3 second period. How can I make it so only the special effect I want to delete (the one that spawned and started the 3-second timer to start) be the one that's deleted?
 

Juggernaut

I don't know what to change it to
Reaction score
33
You could use a buff. (apply a 3 second buff with the desired sfx and it will remove automatically)
- Where you would cast an ability on that unit and it would get a buff

You could use local variables
- Using local variables also allows the usage of waits without problem

Or some complicated timing system, where you use indexing and each SFX has its own index and has its own timer, and they will all be removed one after another.
- All you need is a timer variable with arrays, special effect variable with arrays and an integer variable to use as an index. Every time this unit attacks you increase the index, set the newly created SFX to the SFX variable, set timer[index] to expire in 3 seconds, and when this timer expires you remove the sfx.
 

Necrolytie

Member
Reaction score
0
Make a variable named "EspecialEffects()" and make this to be the last created special effect, and just put a "Wait" of 3 seconds, and call to destroy effect.
 

sabatadark

New Member
Reaction score
0
Nercolytie, I've tried that, and while I can figure out timers, unit groups, and simple things like that, variables for Special Effects has me stumped. I'm going to try Juggernaut's idea, and if it fails to work I'll look into yours, perhaps there's a simpler way to do it that I've overlooked.

EDIT: To be more specific, I'm lost at how to set the special effect to be stored into the variable. This is simple for me when it comes to things like units, but special effects is more difficult.

EDIT: Never mind, I figured it out. Thanks for your help, both of you.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top