Ambient sound

Started by Bartimaeus, Tue 28/09/2004 21:50:08

Previous topic - Next topic

Bartimaeus

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.
~The more adventures I go on, the more sand I get in my shoes

BorisZ

Try game_start in global script. ;D

Bartimaeus

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?
~The more adventures I go on, the more sand I get in my shoes

Ashen

Try this:
Code: ags

#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)
I know what you're thinking ... Don't think that.

Bartimaeus

Eurika! She works!!!
Thanks alot. I was trying to put the '1' in brackets as opposed to '=1'.
Thanks for the help.
~The more adventures I go on, the more sand I get in my shoes

TerranRich

Nope, it's a global variable, not a function/command. :) Glad it works.
Status: Trying to come up with some ideas...

SMF spam blocked by CleanTalk