- Joined
- Jan 11, 2009
- Messages
- 3,414
How do you really play sounds in warcraft?
It always seem to bug for me, if i do it it GUI with "play sound" then "destroy sound", the sound only plays the first time the trigger is fired, if even then.
I then tried to make a jass function to handle it, it looked like this:
And fired with:
But again, it doesn't play.
So how do you play sounds correctly?
EDIT: The error was in the rest of my trigger, the sound now plays well in the jass function.
Though i would like to know, does it leak?
Since i create the sound for all players, plays it for one, then deletes it once it's done playing for that player?
It always seem to bug for me, if i do it it GUI with "play sound" then "destroy sound", the sound only plays the first time the trigger is fired, if even then.
I then tried to make a jass function to handle it, it looked like this:
JASS:
function PlaySoundLocal takes player p, string path returns nothing
local sound snd = CreateSound(path, false, false, false, 10, 10, null)
call StartSoundForPlayerBJ(p, snd)
call KillSoundWhenDone(snd)
set snd = null
endfunction
And fired with:
JASS:
call PlaySoundLocal(GetOwningPlayer(GetBuyingUnit()), "Sound\\Interface\\ClanInvitation.wav")
But again, it doesn't play.
So how do you play sounds correctly?
EDIT: The error was in the rest of my trigger, the sound now plays well in the jass function.
Though i would like to know, does it leak?
Since i create the sound for all players, plays it for one, then deletes it once it's done playing for that player?
Last edited: