Question on making a Jukebox (PlayMusic function in a GUI)

Started by Vp8, Sat 19/07/2003 22:52:15

Previous topic - Next topic

Vp8

I'm making a game and I have a question about something.
Okay, I'm trying to make a jukebox kind of thing where the player can press a button and music will play. At first, it seemed simple enough.
I tried using hotspots, scripting it so that PlayMusic would play the appropriate song corresponding to the button. That didn't work, so I tried putting it in a GUI (where when a button was pressed the appropraite PlayMusic would be activated) and when I press a button, it would animate appropriately by temporarily going over to the other view, making it obvious that the button was being pressed properly, but there was still no change in the music. Then I read the manual some more and found a sentance saying that if PlayMusic was used in an interaction, you need to use PlaySound and add a thousand to the music number so that the engine would recognize it as music. I tried, and it still didn't work.
And no, there is no default room music in the room where the jukebox is.

So, how do I script it so that when I press the GUI button it plays the music I tell it to play?

AJA

Have you used StopMusic() before starting to play another one? New music clip won't start playing if there is music playing. So, you must use StopMusic() and after that PlayMusic().

I Hope that helps... :)

Vp8

Yeah, I tried that.
Still doesn't work, though. The current music doesn't even stop even when I use StopMusic.

Bob The Hun

Hmm.
How are you using it in your script?
Because the music should stop when you use StopMusic, I'm pretty sure.

Vp8

I have it somewhat like this:

If (interface == 11){
 if (button == 0){
    StopMusic();
    PlayMusic (21);
}
 if (button == 1){
   StopMusic();
   PlayMusic(22);
}

..and so on

SMF spam blocked by CleanTalk