Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: taryuu on Sat 20/09/2003 00:24:32

Title: Music Scripting problems
Post by: taryuu on Sat 20/09/2003 00:24:32
allright, so i want the background music to repeat in my room.  however i also want the player to turn off or turn on the music by interacting with an object.  

if(IsMusicPlaying()==0)
PlayMusic(3);
if(IsMusicPlaying()==1)
StopMusic();


however because the music is repeating, it's always going to be 1.  therefore, the player can shutoff the music, but can't turn it on again.

so i tried this

if (GetCurrentMusic()==-1)
PlayMusic(3);
if(IsMusicPlaying()==1)
StopMusic();

still doesn't work.  again the player can't turn it on again.  what can i do to fix this problem?



Title: Re:Music Scripting problems
Post by: Timosity on Sat 20/09/2003 03:07:03
I haven't tried it but i would imagine something like this might work

if(IsMusicPlaying()==0) {
PlayMusic(3);
}

else if(IsMusicPlaying()==1) {
StopMusic();
}
Title: Re:Music Scripting problems
Post by: taryuu on Sat 20/09/2003 03:32:22
ahhh the old "else" dealie.  thanks man.