Wintermute Engine > Bug reports

Game.Interactive = false; can be defeated, causing hang

(1/2) > >>

Kaz:
We make a lot of use of Game.Interactive = false, mainly on doors.

on "LeftClick"
  {
  Game.Interactive = false;
  //Display the open door
  //Play the door sound
  Sleep(1000);
  Game.ChangeScene(destination scene);
  Game.Interactive = true;
  }

With the above routine, Game.Interactive = false; was used because the documentation says it disables user input. But as several of our testers have found, Game.Interactive = false can be defeated. If the player clicks again during that routine (i.e. double-click), the ChangeScene takes place, but the Game.Interactive = true; isn't obeyed and the player is left permanently with the egg timer.

Our workaround is to disable the hotspot before the Game.Interactive = false; thus:

on "LeftClick"
  {
  var a = Scene.GetNode("open_door");
  a.Active = false;
  Game.Interactive = false;
  //Display the open door
  //Play the door sound
  Sleep(1000);
  Game.ChangeScene(destination scene);
  Game.Interactive = true;
  }

So as to disable input locally before doing it at a Game object level. Then it seems impossible to cause the hang.

metamorphium:
the problem might be more connected to placing

Game.Interactive = true; after the ChangeScene, I'd never do this because it might bring a lot of instabilities.

Kaz:
Hi MM

Is that for sure? Because we're going to have to change every door script in the game, something I want to do only once - and I have a choice now as to whether to shut hotspots or change the order of Game.Interactive = true;

Cheers

metamorphium:
take it this way. Game.ChangeScene is a method, not an event so the code goes on after the scene changing is complete. As the scene change detaches all Scene attached scripts, it's a matter of pure luck, if your script will survive long enough to be finished. This can bring in those ugly bugs which on some computers appear while on others no and they're pretty random.

I'd be glad if Mnemonic verified it here, but I myself had to change many many scripts upon realizing what's going on.

Mnemonic:
The script finishes the code after ChangeScene. *Unless*, I think, you kill the scene elsewhere in the meantime. I'm not convinced mere clicking can affect interactivity state, they're completely unrelated. Does your game have any double-click handlers? If so, what do they contain?

Navigation

[0] Message Index

[#] Next page

Go to full version