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: Blocking when any character talking  (Read 4485 times)

0 Members and 1 Guest are viewing this topic.

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Blocking when any character talking
« on: December 27, 2007, 02:59:29 PM »

Hi, I want game not interactive when any character is talking. Is any way to know if any character is talking in the scene (not only the main character)?
« Last Edit: December 27, 2007, 04:53:30 PM by lacosaweb »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Blocking when any character talking
« Reply #1 on: January 01, 2008, 09:03:51 AM »

Perhaps overriding the built-in Talk method to always set Game.Interactive to false would be the best way.
Something like:

Code: WME Script
  1. method Talk(Text, SoundFilename, Duration, TalkStances, TextAlignment)
  2. {
  3.   var OrigInteractivity = Game.Interactive;
  4.   Game.Interactive = false;
  5.  
  6.   this.Talk(Text, SoundFilename, Duration, TalkStances, TextAlignment);
  7.  
  8.   Game.Interactive = OrigInteractivity;
  9. }
  10.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Blocking when any character talking
« Reply #2 on: January 01, 2008, 07:43:13 PM »

I attached a script with this code in game.scripte but nothing happens. I tried to add a actor.Talk("blah"); inside this method but nothing happens. And I also tried to paste the method inside the game.script but nothing happens. I think that the engine doesn't execute this method when somebody.Talk is executed. What is the problem?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Blocking when any character talking
« Reply #3 on: January 01, 2008, 08:14:56 PM »

overriden Talk method should be inside the actor script (attached to actor). It's common object logic - you call actor.Talk so the method must be defined for actor object.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Blocking when any character talking
« Reply #4 on: January 01, 2008, 08:43:41 PM »

But I need to block the game when any actor is talking, not only when the main actor is doing this. For example, when main actor looks at object, another actor called actor2 talk: actor2.Talk("This is a beautiful object");
When the actor2 is talking I can walk or do anythink whith main actor. I want that when actor2 or any actor of the game is talking, the main actor can't do nothing until the talking is finished.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Blocking when any character talking
« Reply #5 on: January 01, 2008, 09:39:36 PM »

that's exactly what this code would achieve. You just have to include this method to script common to all actors.
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: Blocking when any character talking
« Reply #6 on: January 01, 2008, 09:42:09 PM »

Or create a new script file, put the method in it, and then attach this script to all your actors.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Blocking when any character talking
« Reply #7 on: January 02, 2008, 09:51:37 AM »

Ok, thanks.
Logged
 

Page created in 0.072 seconds with 25 queries.