Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Bartimaeus on Tue 28/09/2004 21:50:08

Title: Ambient sound
Post by: Bartimaeus on Tue 28/09/2004 21:50:08
The other day I figured out how to use this ambient sound thing to make a sound play in the background. However...
Whenever it changes rooms, the sound obviously has to start over again. As you can imagine, this sounds pretty weird on the game.
So, I searched the manual and I found this helpful titbit:
game.ambient_sounds_persist
According to the manual, if I set this to (1), the sound should play through the rooms. The only problem is that I don't know where to type all of this in.
In the global script?
I don't have a clue.
I'd really appreciate some help.
Thanks.
Title: Re: Ambient sound
Post by: BorisZ on Tue 28/09/2004 22:28:56
Try game_start in global script. ;D
Title: Re: Ambient sound
Post by: Bartimaeus on Wed 29/09/2004 15:19:19
Yep... I found it in global script, but now what should I do?
I tried typing the game.ambient_sound_persist thing before, after, in between, you name it. It still won't work.
Am I missing something here?
Title: Re: Ambient sound
Post by: Ashen on Wed 29/09/2004 15:27:52
Try this:

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
  // called when the game starts, before the first room is loaded
  game.ambient_sounds_persist = 1;
}
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE

(Obviously, if there's anything already in game_start, leave it there)
Title: Re: Ambient sound
Post by: Bartimaeus on Wed 29/09/2004 16:58:21
Eurika! She works!!!
Thanks alot. I was trying to put the '1' in brackets as opposed to '=1'.
Thanks for the help.
Title: Re: Ambient sound
Post by: TerranRich on Thu 30/09/2004 05:22:26
Nope, it's a global variable, not a function/command. :) Glad it works.