Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Playback of music files upon loading a saved game  (Read 3834 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
Playback of music files upon loading a saved game
« on: September 02, 2007, 01:28:23 PM »

When a game is saved while a music channel is playing, upon loading the game, the music file starts up at the exact same place as it was when the game was saved. It might be a nice touch to let the music file start from the beginning instead, and give the load a "smoother" feel. Is this possible somehow?

And while we're on the topic: Is there any way to pause the music during the save/load screens ONLY?

Thanks in advance for any suggestions!

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playback of music files upon loading a saved game
« Reply #1 on: September 02, 2007, 02:32:17 PM »

Is this possible somehow?
Unfortunately not, the game continues where is stopped when the player saved the game.

And while we're on the topic: Is there any way to pause the music during the save/load screens ONLY?
You'd have to pause music before calling Game.SaveGame() / Game.LoadGame() and resume after the SaveGame() call.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playback of music files upon loading a saved game
« Reply #2 on: September 02, 2007, 02:49:35 PM »

I think you can hijack the Game.AfterLoad event to start over the music.
Or is there a trap Mnemonic?

To be more specific I thought about something like this in the game.script:

on "AfterLoad"
{
  if (Game.IsMusicPlaying()) Game.SetMusicPosition(0);
}
« Last Edit: September 02, 2007, 02:53:18 PM by metamorphium »
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playback of music files upon loading a saved game
« Reply #3 on: September 02, 2007, 02:50:34 PM »

The trap is you need to know what music file to start over.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playback of music files upon loading a saved game
« Reply #4 on: September 02, 2007, 02:54:00 PM »

oops, you're always too fast.  ::beer
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Playback of music files upon loading a saved game
« Reply #5 on: September 02, 2007, 05:53:04 PM »

The trap is you need to know what music file to start over.

Exactly. But I'll keep it in mind if I'll make a game with only one music file in it. ;)

Thanks the both of you!

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playback of music files upon loading a saved game
« Reply #6 on: September 02, 2007, 06:06:30 PM »

Actually meta's solution should work universally. Obviously he's more creative with WME scripting than I am :)
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: Playback of music files upon loading a saved game
« Reply #7 on: September 03, 2007, 06:25:01 PM »

Yippee! It really DOES work

My initial conclusion was, like Mnemonic's, that you needed to know which particular music file to start over. I tested it nonetheless, making the classic mistake of trying it out from old savegames. But, off course, Meta's simple yet perfect solution does the trick (which is kind of obvious at second glance).

It's so much nicer to load a game without being thrown into the middle of a music piece (or the last two notes, for that matter).

Thanks again, the both of you!

Mikael
Logged
 

Page created in 0.042 seconds with 24 queries.