• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Still learning how to handle leaks..

Status
Not open for further replies.
Level 3
Joined
Dec 8, 2008
Messages
29
I have a spell that will be used a ton throughout the game.
It can be used by multiple players.
I want a specific sound to play when the spell is cast, but I don't want it to leak.

If in an initiation trigger I set a variable like this:

  • Set RushSound = DefendCaster <gen>
with DefendCaster <gen> being a sound that is uploaded into the map as a sound file, when I use it in the trigger as:

  • Sound - Play RushSound at 100.00% volume, attached to RushUnit[(Player number of (Triggering player))]
Does that create a leak every time I play the sound? Even if I am using the same variable set with the one sound? How do I destroy or clear the leak after I play it if this is the case?

Or do I not need to set the variable at all? Can I just have it be:

  • Sound - Play DefendCaster <gen> at 100.00% volume, attached to RushUnit[(Player number of (Triggering player))]
????

+rep for help!
 
Level 7
Joined
Jul 12, 2008
Messages
295
That is not leaked because as hawk said sounds don't leak... Only points, special effects and groups leak... Read some tutorials i think that isn't so hard
 
Level 3
Joined
Dec 8, 2008
Messages
29
I pulled this directly from the tutorial linked right above, the stickied post on this website:



"Sounds
Also sounds leak, they should be destroyed like this:

Sound

  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Some Spell
  • Actions
  • Sound - Play (Some Sound)
  • Sound - Destroy (Last played sound)
"

Says right there that sounds leak, yet two of you say they don't. Is this well respected thread wrong? Can someone please give me some valid input? Is it just sounds that are created from scratch each time they are used as opposed to when you set a specific variable to a specific sound and you plan on using it repeatedly?
 
Level 3
Joined
Dec 8, 2008
Messages
29
So do I need to set the sound variable, play the sound, and then destroy it over and over to prevent leaks?

  • Set RushSound = DefendCaster <gen>
  • Sound - Play RushSound at 100.00% volume, attached to RushUnit[(Player number of (Triggering player))]
  • Sound - Destroy RushSound
 
Status
Not open for further replies.
Top