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

Destroying Effects / Points / Sounds

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi!

I'm not sure about destroying stuff to avoid leaks.

I've read that "Destroy Sound" hast to be used to avoid Leaks, and despite the trigger says "If the sound is already playing, it will be destroyed upon finishing" the sound never plays. Also... If I'm using a sound several times in the game, Should it be removed?

Same happens with Special Effects.. Placing a "Destroy Special Effect" results in no effect display =/ And the same, if I'm going to use the same special effect later, Should it be removed anyway?

Same with points. There's some positions that I'll use several times (Like revival points), should these also be removed?
 
Things that leak.

Destroying effects results in playing given effect's death animation, although if doesn't have any - there won't be any effect at all.

About sounds: destroying them immidiately sucks (similar situation like with effect that has no death animation) :S

You have to consider adding little delay before actually destroying sound (or effect if you want effect to play birth/stand animation)
JASS:
local effect e = AddSpecialEffect(...)
call TriggerSleepAction(1.)
call DestroyEffect(e)
set e = null
If you constantly use points - there is no need to remove them :p
Although if they become useless or you want to change the value (coordinates) of given location you have to consider using RemoveLocation() function.
 
Status
Not open for further replies.
Top