- Joined
- Jul 2, 2008
- Messages
- 156
I did some searching around for how to play a sound for a single player, but I'm going to need to clarity on how to do that.
My situation: I'm converting GUI triggers into JASS, and I used to have a QuestMessageBJ to inform the player of stuff. I quickly changed that into a DisplayTimedTextToPlayer, but I need to know how to make and play the sound for the local player.
How should I go about creating the sound?
I'm not really sure what to put in the last parameter for the sound, or if I should be making the sound inside the function.
I searched around on the forum, and people were saying something about using GetLocalPlayer() is a bad idea.
My code:
Thanks in advance!
My situation: I'm converting GUI triggers into JASS, and I used to have a QuestMessageBJ to inform the player of stuff. I quickly changed that into a DisplayTimedTextToPlayer, but I need to know how to make and play the sound for the local player.
How should I go about creating the sound?
I'm not really sure what to put in the last parameter for the sound, or if I should be making the sound inside the function.
I searched around on the forum, and people were saying something about using GetLocalPlayer() is a bad idea.
My code:
JASS:
function Trig_Corrupt_Conversion_Towers_Actions takes nothing returns nothing
local unit u= GetDyingUnit()
local unit t
local player p= GetOwningPlayer(GetKillingUnit())
local sound s= CreateSound(gg_snd_ItemReceived, false, false, false, 10, 10, null)
if ( Trig_Corrupt_Conversion_Towers_Func002C() ) then
set t= CreateUnit(p, 'hatw', GetUnitX(u), GetUnitY(u), GetUnitFacing(u))
call SetUnitRallyPoint( t, GetRectCenter(GetTowerRally(t)) )
call DisplayTimedTextToPlayer(p, 0, 0, 4, "Tower Corrupted!")
call StartSound(s)
else
endif
if ( Trig_Corrupt_Conversion_Towers_Func003C() ) then
set t= CreateUnit(p, 'hatw', GetUnitX(u), GetUnitY(u), GetUnitFacing(u))
call SetUnitRallyPoint( t, GetRectCenter(GetTowerRally(t)) )
call DisplayTimedTextToPlayer(p, 0, 0, 4, "Tower Cleansed!")
call StartSound(s)
else
endif
endfunction
Thanks in advance!