| 04-04-2005, 01:39 AM | #1 |
Okay, I have a trigger that calls playsoundbj. It works fine. The problem is that the sound only works part of the time. I am assuming the reason is that the trigger can fire again before the sound is done playing. So... is it possible to somehow have multiple copies of the same sound playing? Or do I have to wait for the sound to finish playing before I can call it again? |
| 04-04-2005, 01:45 AM | #2 |
I believe it is finish before you can use it again. |
| 04-04-2005, 04:22 AM | #3 |
this is the code i made for a 3d sound coming from a specific position, call this function to repeat sounds it can only play i think about 8 instances of the sound at once though, then the channels are filled, i think, not too sure Code:
//Note 4096 is the distance it can be heard, it can be changed or turned into a variable
//soundfile = the path of the sound, use '//' for a single slash
//point3d = point where sound originates from, since its a 3d sound
//============================================================================================================
function createGameSound takes string soundfile, location point3d returns nothing
local sound gamesound = CreateSound( soundfile, false, true, false, 10, 10, "")
call SetSoundPositionLocBJ( gamesound, point3d, 0 )
call SetSoundDistanceCutoff( gamesound, 4096.0 )
call SetSoundChannel( gamesound, 8 )
call StartSound( gamesound )
call KillSoundWhenDone( gamesound )
call RemoveLocation( point3d )
set gamesound=null
endfunction |
