Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Kaz on May 11, 2009, 10:56:50 AM

Title: Game.PlaySoundEvent() in a window script - odd behaviour
Post by: Kaz 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;
  }

Title: Re: Game.PlaySoundEvent() in a window script - odd behaviour
Post by: Mnemonic 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).
Title: Re: Game.PlaySoundEvent() in a window script - odd behaviour
Post by: Kaz 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