I have an MP3 playing in one room. If the player interacts with object x, they are sent to another room. I have music in the new room. Currently, the music crossfades. Can you specify the song to cut out instantly in this one occurance?
Put the following line:
StopMusic()
before the room change
That is what I have and it doesn't work. The music is still fading out when the new room loads.
Is there a wait function I need to put in?
In that case I'm not quite sure about that, probably when crossfade is on, even StopMusic() won't stop the music immediately but fade to silence instead.
I don't see any way to change the crossfade method in game (maybe I overlooked)), in that case a "trick" that may work is when you want the music to stop, temporilarly mute the music channel, then wait for a few game loops and turn it on again (which will cause a delay unfortunately):
StopMusic();
SetMusicVolume(-3);
Wait(40);
SetMusicVolume(0);
Or maybe, instead, try using the StopChannel() function and see if it makes any difference:
StopChannel(0); //channel 0 is music
On the first tab, the game options, in that, on the bottom on the left, there is a crossfade music selection,make sure its on no, or fast. try it out.
Problem is I want all the music, aside from this one time, to crossfade. Looks like it may not be possible.
SetGameOption will solve your problems
Change it to not crossfade tracks just between the room change.
EDIT: To be more specific:
SetGameOption(OPT_CROSSFADEMUSIC, 0); // Crossfade off music should stop instantly
SetGameOption(OPT_CROSSFADEMUSIC,3); // Medium crossfade(or whatever your setting is)
After that, just use StopMusic();
Yep, as junc says disable crossfading, stop the music, then re-enable it. For example:
SetGameOption(OPT_CROSSFADEMUSIC, 0);
StopMusic();
SetGameOption(OPT_CROSSFADEMUSIC, 2);