HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Do all Fx created through trigger need to be destroy?

01-11-2004, 08:50 AM#1
AZN-Enigma
I have triggers that create fx like cripple over a unit if they have a certain item but after they die, the fx dissappears. I was wondering if they still take memory and resource or do they automatically destroy them selves so you dont have to use triggers to destroy them..)
01-11-2004, 10:11 AM#2
Phil_123
Yes, you need to manually destroy them.
01-11-2004, 11:32 AM#3
raejin
On a similar note, does creating a new variable to store every sfx in so as to be able to delete them later slow down your computer more or less than leaving them alone?
01-11-2004, 02:20 PM#4
curi
new vars are fine, and a zillion times better than leaving sfx sitting around forever. but reusing wouldn't hurt. also using an array wouldn't hurt.

btw a dozen sfx left around isn't a big deal. it's if you have functions that make them over and over (like every 10 seconds, or everytime a certain spell is used). it's important to clean that up. a single array will suffice though.
01-11-2004, 03:50 PM#5
Cacodemon
If you are JASS scriptwriter or just use UMSWE you should destroy value returned by function which creates your effect just after creation! This completely solves that problem for non-periodic effects (for example, explosions or something alike, fire is periodic effect so i should be destroyed after period of time since it was created)

Code:
 call DestroyEffect(AddSpecialEffectLocBJ(sploc, "Units\\Demon\\Infernal\\InfernalBirth.mdl"))

This code destroys new effect just after its creation, but... You can test this code to ensure that effect IS VISIBLE UNTIL IT ENDS!

When using UMSWE you can do following in trigger actions:

Special Effect - Remove( Special Effect - Create At {Unit / Point} ...)

This is easy way to take care of all non-periodic effects... When you create periodic effects (which use animation in cycle, fire for example), this method couldn't be applied.
01-11-2004, 07:15 PM#6
Xinlitik
Ahhh, I had been wondering this too. I was hoping all of the Mark of Chaos FX I was making went away by themselves. :nono: Well, now I can get rid of some lag, hopefully. Thx guys.
01-11-2004, 07:20 PM#7
Vexorian
no problem
If you won't use UMSWE at all you can:

Special effect: create special effect at blah b
special effect: Destroy (last created special effec)