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: Game.PlaySoundEvent() in a window script - odd behaviour  (Read 2400 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'
Game.PlaySoundEvent() in a window script - odd behaviour
« on: May 11, 2009, 10:56:50 AM »

Hi all,

Trying to use Game.PlaySoundEvent("sound", "event"); in a window script. It works fine in a scene, but in a window, the sound plays but the event never executes. Although if I replace the "event" with a this.some-method, the method executes but then the sound doesn't play ???

Any ideas how I get the event to execute? Should it work or should I be using an entity instead?

Thanks

Code: [Select]
on "George"
  {
  s = "scenes\07_Pub_Reception\JuliaGeorge.ogg";
  this.DoIt();
  }

method DoIt()
  {
  this.Disable();
  this.PlaySoundEvent(s, "Enable");
  }

method Disable()
  {
  Game.Interactive = false;
  Game.Msg("Disabling prompts");
  a = this.GetControl("Fire");
  a.Disabled = true;
  a.Visible = false;
  a = this.GetControl("George");
  a.Disabled = true;
  a.Visible = false;
  }

on "Enable"
  {
  Game.Msg("Prompts enabled");
  a = this.GetControl("Fire");
  a.Disabled = false;
  a.Visible = true;
  a = this.GetControl("George");
  a.Disabled = false;
  a.Visible = true;
  Game.Interactive = 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: Game.PlaySoundEvent() in a window script - odd behaviour
« Reply #1 on: May 11, 2009, 11:02:49 AM »

I don't know, it looks like it should work. I can't test it right now.
If you used an entity, you would be able to use the Talk() method, which pauses the script execution until the talking is over (I suppose that's what you're trying to achieve).
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: Game.PlaySoundEvent() in a window script - odd behaviour
« Reply #2 on: May 15, 2009, 03:12:59 PM »

I'll give the 'Talk' a try. First time we've used speaking characters as such. Yet more of the built-in brilliance of this engine.

Cheers
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.042 seconds with 19 queries.