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: Playing Music in Window  (Read 3453 times)

0 Members and 1 Guest are viewing this topic.

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Playing Music in Window
« on: May 23, 2008, 12:37:06 PM »

Hi all

I've set up a window to carry the main menu of the game, which appears when the player presses 'Esc'. In the script associated with the window, the first line after the inc's and GoExclusive is Game.PlayMusicChannel(3, "myogg.ogg", true);.

But the music doesn't play, and I'd rather it did :-(

Not only that, but the music in the scene we left by pressing 'Esc' is still playing, even though the window's PauseMusic is set to 'true'. I thought that 'PauseMusic' paused the scene's music, to resume when the window was eventually closed.

Can anybody please tell me what I have completely misunderstood about music and windows?

Thanks


Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Playing Music in Window
« Reply #1 on: May 23, 2008, 12:41:48 PM »

please post your script here.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Playing Music in Window
« Reply #2 on: May 23, 2008, 01:03:05 PM »

#include "scripts\base.inc"
#include "scripts\keys.inc"

self.GoExclusive();

Game.PlayMusicChannel(3,"sounds\RhiannonRhiannon.ogg", true);

Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playing Music in Window
« Reply #3 on: May 23, 2008, 01:56:09 PM »

Firstly, GoExclusive() metod blocks script execution, so your scipt waits for the window to close and THEN it calls PlayMusic.
As for pausing the music, only the "system exclusive" windows pause music, i.e. those special windows that pause game.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Playing Music in Window
« Reply #4 on: May 23, 2008, 02:20:38 PM »

So I guess the 'GoExclusive' should be executed *after* the PlayMusic.

Thanks Mnemonic - I'd never have guessed that GoExclusive stops the script, simply because everything else in the script - on "Credits", on "QuitGame", etc - executes just fine.

So different things in the window script are affected different ways by the GoExclusive?
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Playing Music in Window
« Reply #5 on: May 23, 2008, 03:10:27 PM »

Quote
So different things in the window script are affected different ways by the GoExclusive?
Umm, that's not a good way to put it. There are two things: script execution flow and event handlers. Event handlers are waiting for events to come, and when they do, the handlers are executed.
On the other hand, the script execution can be blocked by some methods, and the script then waits for these methods to finish. window.GoExclusive() is one of these methods. There are many others and you're (knowingly or non knowingly) using them all the time. Methods like GoTo(), Talk(), PlayAnim() etc. work the same, simply because it's convenient for the developer.

Now, window.GoSystemExclusive() is a very special command, because (together with Game.PlayVideo()) it's the only method which freezes the entire game (you don't want to miss anything in the game while changing the sound volume, for example). By default this command also pauses the music, but it can be overridden using the window.PauseMusic attribute, because sometimes people wanted to keep the music playing even when the rest of the game is paused.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Playing Music in Window
« Reply #6 on: May 23, 2008, 03:46:26 PM »

Thanks for explaining that
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com
 

Page created in 0.015 seconds with 19 queries.