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

Am I supposed to destroy every spec effect i make?

Status
Not open for further replies.
Level 8
Joined
Oct 19, 2008
Messages
168
i read somewhere about memory leaks or w/e and im wondering if i am supposed to destroy EVERY special effect i make? Even for thunder clap?

Explain why I need to destroy them to plz.
btw i dont use JASS

-thank you :thumbs_up:
 
Level 12
Joined
Dec 10, 2008
Messages
850
Basicly, things only need to be destroyed for triggers, object editor stuff (like thunder clap) dont need any attention.

Now, for things like creating special effects, you'd need basic JASS knowlege that anybody into GUI spells can teach you. Basicly, when you create an effect (or sevevral other things) The game needs to refrence it, and if you dont have your own way of doing so (using variables) it will "leak" memory and slow the game down over time. You can avoid this by using a global variable, and once your done with it, you use a custom script code (JASS) to remove refrence to it, and destroying the effect at the same time. For effects, the line is
JASS:
Call DestroyEffect(udg_YOUREFFECTVAR)
And that will destroy it.
 
Ok, here's the deal.
When you create special effects, they play their birth animation, followed by their stand animation if they have one.
The thing is, if they do not have a stand animation, it will be shown as nothing, but the special effect remains. Therefore, you would have to remove it to prevent many "invisible" effects from stacking up in game memory, causing lag.

The way to do this is simple. If you use an instant effect (Thunder Clap) that doesn't have a Death Animation, you can just use
  • Special Effect - Destroy (Last created special effect)
This will make the special effect play its death animation and get removed. If it doesn't have a Death Animation (you can check if they have it using the little model viewer on the left hand side of WE), it will play its only effect (those without death animations only have 1 animation).

In the case of Thunderclap, it will show the slam effect and remove itself immediately, so its cleaned.

So basically:
Special Effects always remain, unless you destroy them. Even if you can't see them, it remains in the game's memory. If you don't destroy them, it will start lagging. Simple

Simply use Destroy Last created Special effect to destroy them :D
Alternatively, you could use:
  • Custom script: call DestroyEffect(bj_lastCreatedEffect)
It does the same thing, but its better xD
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Your map sounds boring, I mean destroy special effects, what the hell kind of map is that?
(Wrong section, should be moved to Triggers and scripts).

Basically, special effects are permant till destroyed. This means that they will always be at a place, until you destroy them. What you and many people seem not to understand well as that just because you can not see something, does not mean that it is not there. The model for the special effects still remains when it comes to clipping and rendering, even though it has no visual influence on the rendered image it still undergoes graphical processes like everything else, so will increase the system requirements for the game to run. It also uses a handle index up which increases the CPU use when asigning objects and destroying them as well as memory.
 
Status
Not open for further replies.
Top