Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: lacosaweb on December 27, 2007, 02:59:29 PM

Title: Blocking when any character talking
Post by: lacosaweb 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)?
Title: Re: Blocking when any character talking
Post by: Mnemonic 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.  
Title: Re: Blocking when any character talking
Post by: lacosaweb 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?
Title: Re: Blocking when any character talking
Post by: metamorphium 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.
Title: Re: Blocking when any character talking
Post by: lacosaweb 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.
Title: Re: Blocking when any character talking
Post by: metamorphium 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.
Title: Re: Blocking when any character talking
Post by: Mnemonic 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.
Title: Re: Blocking when any character talking
Post by: lacosaweb on January 02, 2008, 09:51:37 AM
Ok, thanks.