Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Problems with continuous music  (Read 2416 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Problems with continuous music
« on: March 12, 2007, 10:31:48 PM »

I've just started playing around with WME. I'm extremely impressed by the seemingly endless possibilities, but I've decided to explore the basics thoroughly to begin with.

I'm sure that I will come up with lots of questions, and the first one has to do with music.

Let's say that I have a scene where you can walk around in a series of scenes, with the same music in all scenes. If I set the music to play like this: "Game.PlayMusicChannel(0, "music\FirstChannel.ogg", true);" in the first scene, the music will go on playing in the rest of the scenes, off course. When I return to the first scene, however, the music will start from the beginning. How do I do to make the music play seamlessly, and only start again when it's not playing? I also want the music to start playing in the rest of the scenes, when a player loads a saved game from any other scene than the first one. I guess that this means that I have to set the music just like in the first scene in all the others. That is no problem, except for the fact that when I do it, the music starts playing from the beginning in all scenes.

Thanks in advance for any possible help!
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Problems with continuous music
« Reply #1 on: March 12, 2007, 10:37:34 PM »

Use something like this:

if(!Game.IsMusicChannelPlaying(0)) Game.PlayMusicChannel(0, "music\FirstChannel.ogg", true);

If you load a saved game, the music will automatically resume from the point where it was playing when you were saving.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Problems with continuous music
« Reply #2 on: March 12, 2007, 11:17:01 PM »

Worked perfectly! Thanks!
Logged
 

Page created in 0.039 seconds with 23 queries.