• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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?
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
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