nabbig2
New Member
- Reaction score
- 43
What do I replace GetOwningPlayer with?
What do I replace GetOwningPlayer with?
playmusic1
Events
Player - Player 1 (Red) types a chat message containing -song1 as An exact match
Conditions
Actions
Set Player1music = Player 1 (Red)
Custom script: call StartSoundForPlayerBJ(GetOwningPlayer(GetTriggerUnit()),gg_snd_PH1)
Custom script: call StartSoundForPlayerBJ(GetOwningPlayer(GetTriggerUnit()),[B]gg_snd_PH1[/B])
Melee Initialization
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Custom script: call StartSoundForPlayerBJ (GetTriggerPlayer(), gg_snd_[B]RainOfFireLoop1[/B])
Code:Custom script: call StartSoundForPlayerBJ(GetOwningPlayer(GetTriggerUnit()),[B]gg_snd_PH1[/B])
That's because the bolded sound doesn't exist in the sound editor. (Edit: Actually I'm not sure about this. Probably it's because it's considered as 3D sound).
Try this:
Code:Melee Initialization Events Player - Player 1 (Red) skips a cinematic sequence Conditions Actions Custom script: call StartSoundForPlayerBJ (GetTriggerPlayer(), gg_snd_[B]RainOfFireLoop1[/B])
Copy the exact trigger above. (For the custom script, just copy and paste, MAKE SURE it's exact =.=). Then, go to the SOUND EDITOR.
1. Go to the Abilities folder.
2. Then Spells folder.
3. Then Demon folder.
4. Then select RainOfFireLoop1.
5. Right-click then select Use as Sound.
6. You will see something is created on your right hand side panel named RainOfFireLoop1.wav. Now double-click this and unselect 3D Sound.
7. Test the game. Press Escape. See if the sound plays.
If it still doesn't play or show an error script, paste your CURRENT trigger here again. Don't quote my trigger. I want your trigger.
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\bgm.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\bgm.mp3, you have to use "war3mapImported\\bgm.mp3"
endfunction
function InitTrig_Test takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
function LocalMusic takes nothing returns nothing
local sound s //just for test it points to no string
call StartSoundForPlayerBJ(GetTriggerPlayer(),s)
//put the variable that handles the sound "s"
endfunction
function InitTrig_Test takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
remove the udg_
udg_ stands for "user defined variable". It's so that the variables you create in the globals area can't interfere syntax-wise with the globals in the game.
thats confusing, I assume UDG is user definined globalvariable? or something?
Do you want it as a music or a sound.
MUSIC :
JASS:function StartMusicLocal takes player p,string s returns nothing if p==GetLocalPlayer() then call PlayMusic(s) endif endfunction function LocalMusic takes nothing returns nothing call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\bgm.mp3") //for 1 "\" you must use "\\", ex: path is war3mapImported\bgm.mp3, you have to use "war3mapImported\\bgm.mp3" endfunction function InitTrig_Test takes nothing returns nothing local trigger t=CreateTrigger() call TriggerRegisterPlayerEventEndCinematic(t,Player(0)) call TriggerAddAction(t,function LocalMusic) endfunction
SOUND :
JASS:function LocalMusic takes nothing returns nothing local sound s //just for test it points to no string call StartSoundForPlayerBJ(GetTriggerPlayer(),s) //put the variable that handles the sound "s" endfunction function InitTrig_Test takes nothing returns nothing local trigger t=CreateTrigger() call TriggerRegisterPlayerEventEndCinematic(t,Player(0)) call TriggerAddAction(t,function LocalMusic) endfunction
function Trig_g_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_g takes nothing returns nothing
set gg_trg_g = CreateTrigger( )
call TriggerAddAction( gg_trg_g, function Trig_g_Actions )
endfunction
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\bgm.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
//===========================================================================
function InitTrig_g takes nothing returns nothing
set gg_trg_g = CreateTrigger( )
call TriggerAddAction( gg_trg_g, function Trig_g_Actions )
endfunction
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\bgm.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
function Trig_g_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_g takes nothing returns nothing
set gg_trg_g = CreateTrigger( )
call TriggerAddAction( gg_trg_g, function Trig_g_Actions )
endfunction
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\bgm.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
So it would look like this? It says error again...:banghead:
Code://=========================================================================== function InitTrig_g takes nothing returns nothing set gg_trg_g = CreateTrigger( ) call TriggerAddAction( gg_trg_g, function Trig_g_Actions ) endfunction function StartMusicLocal takes player p,string s returns nothing if p==GetLocalPlayer() then call PlayMusic(s) endif endfunction function LocalMusic takes nothing returns nothing call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3") //for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\bgm.mp3" endfunction function InitTrig_g takes nothing returns nothing local trigger t=CreateTrigger() call TriggerRegisterPlayerEventEndCinematic(t,Player(0)) call TriggerAddAction(t,function LocalMusic) endfunction
(Thanks for helping by the way.......)
delete the first InitTrig_g function
function Trig_g_Actions takes nothing returns nothing
endfunction
function Trig_g_Actions takes nothing returns nothing
endfunction
//===========================================================================
[COLOR="Red"]function InitTrig_g takes nothing returns nothing
set gg_trg_g = CreateTrigger( )
call TriggerAddAction( gg_trg_g, function Trig_g_Actions )
endfunction[/COLOR]
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\bgm.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\PH1.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t,Player(0))
call TriggerAddAction(t,function LocalMusic)
endfunction
function StartMusicLocal takes player p,string s returns nothing
if p==GetLocalPlayer() then
call PlayMusic(s)
endif
endfunction
function LocalMusic takes nothing returns nothing
call StartMusicLocal(GetTriggerPlayer(),"war3mapImported\\PH1.mp3")
//for 1 "\" you must use "\\", ex: path is war3mapImported\PH1.mp3, you have to use "war3mapImported\\PH1.mp3"
endfunction
function InitTrig_g takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerChatEvent( t, Player(0), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(1), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(2), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(3), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(4), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(5), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(6), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(7), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(8), "-play1", true )
call TriggerRegisterPlayerChatEvent( t, Player(9), "-play1", true )
call TriggerAddAction(t,function LocalMusic)
endfunction
call TriggerRegisterPlayerChatEvent( t, Player(0), "-play1", true )