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

[Trigger] can this leak?

Status
Not open for further replies.
Level 5
Joined
Nov 25, 2004
Messages
65
i have trigger that look like this:

trigger1
event:map initialization
action:Set lightning_bzz = bfg_fire <gen>

trigger2
event:time - every 1 second of game time
action: Sound - Play lightning_bzz at 100.00% volume, attached to (Last created unit)

is there any leak with my trigger?
 
Level 6
Joined
Oct 4, 2008
Messages
263
well.... i dont see any, at least. but im not very good at detecting leaks.
edit: why not just make it
every 1 second of game time
play bfg_fire <gen> at 100.00% volume, attached to last created uni?

why store the sound in a variable first?
 
Level 5
Joined
Nov 25, 2004
Messages
65
well.... i dont see any, at least. but im not very good at detecting leaks.
edit: why not just make it
every 1 second of game time
play bfg_fire <gen> at 100.00% volume, attached to last created uni?

why store the sound in a variable first?

well i thought the trigger will not cause leak if i use variable.
 
Level 6
Joined
Oct 4, 2008
Messages
263
yes, you must Destroy the sound

  • PLay Sound
  • Destroy Sound

wouldnt that mean he cant acess the sound the next second? sorry if i sound noobish, im not very experienced in this stuff about removing leaks.
 
Level 8
Joined
Feb 15, 2009
Messages
463
Also playing a sound every second is highly imperformant rather go for a soundloop ( dont know if this possible but dont all sounds have a loop argument) so u can go for something like if sound finished then play sound (if its possible =d)
 
Status
Not open for further replies.
Top