Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Matt Brown on Sat 14/06/2003 19:06:00

Title: play sound on exit..?
Post by: Matt Brown on Sat 14/06/2003 19:06:00
hey, if I wanted to play a sound everytime the player quit the game, to I just slap a Playsound(1); and a Wait(whatever) in the game script, or do I need to do something else?
Title: Re:play sound on exit..?
Post by: Scummbuddy on Sat 14/06/2003 19:07:35
put those in right before the quit game command, and it seems like it would work just fine.
Title: Re:play sound on exit..?
Post by: Matt Brown on Sat 14/06/2003 19:08:51
whoa, that was quick.

thanks, I'll do that.

;D

EDIT:

no dice

else if (button == 6)    // save game
     SaveGameDialog();
   else if (button == 7)   // load game
     RestoreGameDialog();
   else if (button == 8)   // quit
     PlaySound(1);
     Wait(420);
     QuitGame(1);
   else if (button == 9)    // about
blah blah blah

I get a parse errror around the second else if...what do I do?

Title: Re:play sound on exit..?
Post by: scotch on Sat 14/06/2003 20:38:05
You need to put {}s around that bit where there's two commands for the one if.

else if (button == 6) // save game
SaveGameDialog();
else if (button == 7) // load game
RestoreGameDialog();
else if (button == 8) // quit
{PlaySound(1);
Wait(420);
QuitGame(1);}
else if (button == 9) // about
blah blah blah
Title: Re:play sound on exit..?
Post by: Matt Brown on Sat 14/06/2003 20:49:13
ah, thank you much. I'll add that in there