Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: TomGamer on October 24, 2015, 08:41:09 PM

Title: Same music in some scenes
Post by: TomGamer on October 24, 2015, 08:41:09 PM
Hello! :)

I want to play same music (looping) in some scenec.

From outside scene i go to Room1
Room1,Room2,Room3 = same music.
I want go through this rooms without changing position on music track.

From Room3 i go to Floor1Room1
Floor1Room1,Floor1Room2,Floor1Room3 = different music.
Play music as above.

It is possible to set music for some rooms without cuting (start again music) loop?

Thanks for help!
Title: Re: Same music in some scenes
Post by: TomGamer on October 25, 2015, 12:40:39 PM
No1 know? :(
Title: Re: Same music in some scenes
Post by: NAItReIN on October 25, 2015, 01:27:37 PM
Take a look at Music support in WME:
http://docs.dead-code.org/wme/inside_music.html

Title: Re: Same music in some scenes
Post by: TomGamer on October 25, 2015, 01:43:32 PM
THX for reply man, ofc i already read it before but it is not solution of my problem...

Anyway thanks.
Title: Re: Same music in some scenes
Post by: NAItReIN on October 25, 2015, 01:46:46 PM
Quote
THX for reply man
You're welcome.

Quote
....it is not solution of my problem...
I will try to find solution for you. I believe there is a way how to achieve what you want.
Title: Re: Same music in some scenes
Post by: piere on October 26, 2015, 10:37:33 AM
Game.PlayMusic() should play the music through all different scenes without stopping.
Title: Re: Same music in some scenes
Post by: Azrael on October 26, 2015, 07:15:26 PM
Just check for the music that is playing, something like that should work:

Code: WME Script
  1. if (Game.IsMusicPlaying() && Game.GetMusic() != "music\Room.ogg")    //There is a music playing but is not the right one
  2.         {
  3.         //This crossfade the two musics, so one fade out and the other fade in
  4.         Game.PlayMusicChannel(1, "music\OtherMusic.ogg", true);
  5.         Game.SetMusicChannelVolume(1, 0);
  6.         Game.MusicCrossfade(0, 1, 1500);
  7.         }
  8. else if (!Game.IsMusicPlaying()) Game.PlayMusic("music\Room.ogg", true);    //There is no music playing
  9.  

Title: Re: Same music in some scenes
Post by: Azrael on October 26, 2015, 07:20:02 PM
Obviusly if the right music is already playing it won't be stopped.
Title: Re: Same music in some scenes
Post by: TomGamer on October 26, 2015, 09:27:48 PM
Sir, thanks so much for answer! I will check your solution soon as possible!!

Very thanks!!!