music coding (solved)

Started by Mantra of Doom, Sat 22/11/2008 19:15:40

Previous topic - Next topic

Mantra of Doom

I think I need some expert help here. I'm using AGS 3.0 and I'm trying to queue up some music to start during a cutscene. The song that starts in the cutscene is called Music5.mid. It should play once and then go back into the normal music called Music4.mid which will play until an action sequence later in the game.

It seems like I'm doing this right, and this works flawlessly in an earlier part of the game, but in this bit, as soon as the cutscene starts, Music5 is skipped and it goes back to Music4.

Code: ags

    StopMusic(); //stops current music
    PlayMusic(5); //starts's the Date Theme
    SetMusicRepeat(1); //loop the Explore music
    PlayMusicQueued(4); //plays the Explore music


I've tried several variations, and the only way I got this to work is to comment out the playing the explore music... but that would leave silence if the player didn't know where they were supposed to go and didn't get to the next part before the song ended.

Any ideas?
"Imitation is the sincerest form of imitation."

RickJ


Mantra of Doom

Thank's RickJ. Again, I think this might be the wrong approach but I finally got things to work.

Code: ags

    StopMusic();
    PlayMusic(5);
    SetMusicRepeat(0);
    PlayMusicQueued(5);
    SetMusicRepeat(1);
    PlayMusicQueued(4);



Since it kept skipping over the PlayMusic(5), and changing that PlayMusic(5) to PlayMusicQueued(5) didn't work, I just added the extra line and it worked.

"Imitation is the sincerest form of imitation."

m0ds

I have the same question, but you guys solved it. Weird to think the answer came from a game I wrote the music for! Was there ever a reason for this? It's just one music queued out of the lot of them. Weird. Oh well. Good old 2.72. Sorry to drag up an old thread. It was just too co-incidental not too. I'll just add my 2 cents and say the above solution by Andrea works well!

SMF spam blocked by CleanTalk