Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: freeplayer on Sat 08/03/2014 14:11:01

Title: Each room to have own Music track.
Post by: freeplayer on Sat 08/03/2014 14:11:01
Hello all.
I've tried search in the manual and also over net this issue but couldn't find exactley.

I want to have a track of music / room. Each room, to play the designated music track once entered in room.
I realised that with the code:
Code (ags) Select

function room_FirstLoad()
{
     aMusic1.Play();
}

That I set in the both rooms i have. But, there is a problem. When i go from room 1 to room 2, the music changes, so it's ok. But once i go to room 1 from room 2 (back) the music from room 2 plays and no other changes.

Would apreciate help to set each room to have a soundtrack on entry, EACH time!

Thanx!
Title: Re: Each room to have own Music track.
Post by: Khris on Sat 08/03/2014 15:54:05
Just use Before/AfterFadein as opposed to FirstLoad, which is associated with the "first time player enters room" event and is only called once, like the text implies.
Title: Re: Each room to have own Music track.
Post by: freeplayer on Sat 08/03/2014 18:17:32
Solved with
function room_AfterFadeIn() in both rooms script!
Wierd, i tink i tried that before... hmm.
Anyway, thanx!