Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kurdt on Mon 08/10/2007 04:05:11

Title: Playing music then changing rooms [SOLVED]
Post by: Kurdt on Mon 08/10/2007 04:05:11
Here's the deal:

I've got a screen on which I'm showing my title card. When the game loads, it flashes a static "Kurdt's Awesome Game Production Company" (or whatever I name my brand) and plays a little piece of fanfare over it. When the music ends (aka it's not looped) I want to call the ChangeRoom function to move on. Is there a specific code I could use for this, a "Change room when the music stops" function I haven't found?

I've got a few theories that I haven't put into practice yet (I'm at work at the moment), but I'm just checking to see if there's a simpler way than how I'm thinking to do it.

This is how I've got it figured:

SetMusicRepeat(0);
PlayMusic(2);
Wait(360); //a 9 second piece of music
cEgo.ChangeRoom(1);


Is there some unknown way to do it simpler than that, without using the Wait function perhaps?
Title: Re: Playing music then changing rooms
Post by: Khris on Mon 08/10/2007 04:08:23
There's no simpler way I can think of.
That's the way to do things like that :)
Title: Re: Playing music then changing rooms
Post by: Kurdt on Mon 08/10/2007 06:34:33
Oh my God. Does that mean I might actually understand something in AGS? I don't think I can do this anymore. ;D
Title: Re: Playing music then changing rooms [SOLVED]
Post by: Khris on Mon 08/10/2007 10:08:54
Of course it'd be a whole different story if you wanted the code to be non-blocking. In this case you'd have to use a timer.