HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Playing Sounds...

03-04-2005, 04:57 AM#1
pappi.chullo
More than one at a time, unlike the regular function. I took a look at Azeroth Grand Prix, and saw it was done through JASS. I haven't looked into JASS yet, so can anyone display a simple trigger that will function like the Azeroth Grand Prix. If it is done through JASS, can you simply explain the functions?
03-04-2005, 05:04 AM#2
Raptor--
Quote:
Originally Posted by pappi.chullo
More than one at a time, unlike the regular function. I took a look at Azeroth Grand Prix, and saw it was done through JASS. I haven't looked into JASS yet, so can anyone display a simple trigger that will function like the Azeroth Grand Prix. If it is done through JASS, can you simply explain the functions?

this is what i made myself a while ago for playing gunshot sounds

Code:
function createWeaponSound takes string soundfile, location point3d returns nothing
    local sound gunshot = CreateSound( soundfile, false, true, false, 10, 10, "")
    
    call SetSoundPositionLocBJ( gunshot, point3d, 0 )
    call SetSoundDistanceCutoff( gunshot, 4096.0 )
    call SetSoundChannel( gunshot, 8 )
    call StartSound( gunshot )
    call KillSoundWhenDone( gunshot )
    call RemoveLocation( point3d )
    set gunshot=null
endfunction

just called with
call createWeaponSound( "sound", place to sound from )
03-04-2005, 05:10 AM#3
pappi.chullo
"gunshot" would be the name of the sound variable correct?
03-04-2005, 07:31 AM#4
Raptor--
gunshot is just local, i just called it that cause i used it for gun sounds... its name is arbitrary, it can be replaced by anything and really it doesn't matter cause you never have to deal with it, its contained in the function

basically what the function does is create a temporary sound called gunshot, assigns it to whatever you want, plays it, and then destroys it when its done

btw i forgot to mention this function is used for 3d sounds, since it makes the sound come from a spot that fades away at call SetSoundDistanceCutoff( gunshot, 4096.0 ) distance