Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: pakhpakh64 on April 09, 2013, 02:30:25 PM

Title: Game recieves input in "Game.Interactive = false" !!!
Post by: pakhpakh64 on April 09, 2013, 02:30:25 PM
hi every body
I have this piece of code in which i set Game.Interactive to false but the game still recieves mouse input!  :-\
I have set breakpoints in Debugging console and until player doesn't do any thing Game.Interactive remains false, but with one single click it switches back to true and THE REST OF THIS EVENT IS NOT PERFORMED!

Code: WME Script
  1. on "SomeEvent"
  2. {
  3.         Game.Interactive = false;
  4.  
  5.         var NewLampOff = Scene.GetNode("NewLampOff");
  6.         actor.ActorGoToObject(NewLampOff); //The only difference between this function and engine's GoToObject
  7.                                         //is in the path that actor actually walks.
  8.         actor.PlayAnimAsync("take");
  9.         Sleep(600);
  10.         NewLampOff.Active = true;
  11.         Sleep(600);
  12.        
  13.         Game.Interactive = true;
  14. }
  15.  

I really don't know what causes this, because if player doesn't do anything the event is performed right.
any help would be much appreciated.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: dongo on April 09, 2013, 03:35:18 PM
Hi,

ActorGoToObject(NewLampOff);

this method is make for you? search the method and look it, maybe its the problem source.
if you put a line like Game.Interactive=true on this method, when you call this method, Game.Interactive goes to true ;)
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: pakhpakh64 on April 09, 2013, 04:13:57 PM
I checked ActorGoToObject function, it doesn't use Game.Interactive, I'm pretty sure what causes this weird problem lays some where else.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: dongo on April 09, 2013, 04:38:20 PM
very rare, ok go to scripts directory in your proyect and open game.script

search on this if you have a line Game.Interactive=true; on "LeftClick" event
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: anarchist on April 09, 2013, 04:50:38 PM
Does the cursor remain changed to the non-interactive cursor? How do you know for certain that it is in non-interactive mode and how do you notice that it exits? Perhaps you could show us your ActorGoToObject (or at least a part of it if you are shy  ;D )

For searching many files of code for a hidden command that affects my game unexpectedly (like yours) I use Notepad++ application and search using its "Find in files" feature to see where the hell I put that @#^%!& command.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: Jose on April 10, 2013, 02:03:13 PM
Also Scite (which came with WME) has the option for searching in files.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: pakhpakh64 on April 11, 2013, 08:32:14 AM
Wow tnx for all the suggestions.

Does the cursor remain changed to the non-interactive cursor? How do you know for certain that it is in non-interactive mode and how do you notice that it exits?

I make the cursor hidden in non-interactive mode, and as I said I check if it's interactive/non-interactive mode with WME Debugging console.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: anarchist on April 11, 2013, 06:48:24 PM
Have you tried compiling the game and running it directly (instead of Run Game in WME Project Manager)?

Also, between which commands does the game exit interactive mode? Also, where do you apply the event? Through game script, through an entity or do you call it from a window that was under exclusive mode (GoSystemExclusive or GoExclusive)?

Because the code you showed us should work, we will need more information to help you.
Title: Re: Game recieves input in "Game.Interactive = false" !!!
Post by: pakhpakh64 on April 25, 2013, 11:38:47 AM
I fix it, thanks for all the help, it was a pretty bad mistake, I was setting Game.Interactive to true In another script in parallel execution with this one!