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: Need help understanding Game.PlaySoundEvent()  (Read 3936 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'
Need help understanding Game.PlaySoundEvent()
« on: May 09, 2009, 06:30:31 PM »

Hi chaps,

The code below is supposed to have Julia say a paragraph when you leftclick on her, then load a window only after she's finished speaking.

She speaks, but the "on Julia" is never executed. So I don't understand the practical use of PlaySoundEvent. Anybody got any examples?

Thanks

Code: [Select]
on "Julia"
  {
  Game.Msg("This is the Julia Window call");
  Game.LoadWindow("scenes\07_Pub_Reception\Julia.window");
  Game.Interactive = true;
  }
 
on "LeftClick"
  {
  var a = Scene.GetNode("Julia");
  a.Active = false;
  Game.PlaySoundEvent("scenes\07_Pub_Reception\JuliaHello.ogg", "Julia");
  }

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: Need help understanding Game.PlaySoundEvent()
« Reply #1 on: May 09, 2009, 06:34:05 PM »

The event is triggered in the object which plays the sound. In your script you're using Game to play the sound, therefore the "julia" event is sent to Game object. I don't know what is this script attached to, but perhaps try using this.PlaySound() instead. Then you'll get the event in the same script.
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: Need help understanding Game.PlaySoundEvent()
« Reply #2 on: May 09, 2009, 06:59:21 PM »

The script is being run from a scene node.

So I changed
Code: [Select]
  Game.PlaySoundEvent("scenes\07_Pub_Reception\JuliaHello.ogg", "Julia");
to
Code: [Select]
  this.PlaySoundEvent("scenes\07_Pub_Reception\JuliaHello.ogg", "Julia");
No change I'm afraid - the "on Julia" still doesn't run. Does it look as though it should?
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

Akusa

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 46
    • View Profile
Re: Need help understanding Game.PlaySoundEvent()
« Reply #3 on: May 09, 2009, 07:55:45 PM »

just a question: is the node called Julia?
Because i think maybe WME takes the node, deactivates it, still play the sound but because the node is deactivated, he does not trigger the Event "Julia"
But i never touched this part of WME so im not sure.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Need help understanding Game.PlaySoundEvent()
« Reply #4 on: May 09, 2009, 09:00:52 PM »

Yes, Akusa is right. Is this script attached to the "julia" node?
Other than that, it should work. I just tested it in wme demo and it does work.
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: Need help understanding Game.PlaySoundEvent()
« Reply #5 on: May 10, 2009, 09:50:33 AM »

My thanks to you both, that did it for the scene - BUT see my new post for use in a Window.

Cheers

« Last Edit: May 11, 2009, 10:57:43 AM by Kaz »
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.041 seconds with 19 queries.