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

Do you hear the voices too ?

Status
Not open for further replies.
Level 19
Joined
Aug 24, 2007
Messages
2,888
Ive a nice question about sounds
Well the tests I made showed
JASS:
local sound snd = CreateSoundFromLabel(and the story goes)
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null

Doesnt destroy the sound
I tested it with a trigger like
Player 1 presses left key
do these actions 1000 times

And I noticed memory war3.exe uses increased by a cool number
Also after X times of I press
ID for new objects increased by a great ammount

Since there is no DestroySound
What do you suggest ?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I tried with global variable first actually same results

if you mean global sound, no I need to run it while its running

I had this idea (with a textmacro thing but never used textmacro so I dont know how2use for now)
JASS:
scope Soundownz0r
//! textmacro Soundownz0rs takes S,Label
globals
private sound array $S$
endglobals

function Play$S$ takes real x,real y returns nothing
local integer a = 0
local boolean did = false
loop
exitwhen $S$[a] == null or did
       if not IsSoundPlaying( $S$[a])
       call SetSoundPosition($S$[a],x,y)
       call PlaySound($S$[a])
       set did = true
       endif
set i = i+1
endloop
if not did then
set $S$[a] = CreateSoundFromLabel($Label$,many things)
call SetSoundPosition($S$[a],x,y)
call StartSound($S$[a])
endif
endfunction
//! endtextmacro
endscope
WOW IM PWNAGE
 
Status
Not open for further replies.
Top