Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Game.Interactive = false; can be defeated, causing hang  (Read 4891 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'
Game.Interactive = false; can be defeated, causing hang
« on: August 09, 2008, 06:51:16 AM »

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.
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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #1 on: August 09, 2008, 08:08:47 AM »

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.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #2 on: August 09, 2008, 10:31:27 AM »

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
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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #3 on: August 09, 2008, 11:17:21 AM »

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.
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: 5677
    • View Profile
    • Dead:Code Site
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #4 on: August 09, 2008, 11:30:04 AM »

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?
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: Game.Interactive = false; can be defeated, causing hang
« Reply #5 on: August 09, 2008, 01:14:18 PM »

I've not scripted any double-click handlers anywhere. Are there any in the engine?
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

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #6 on: August 09, 2008, 01:18:02 PM »

I should have confirmed in my last post that interactivity fails in the way described and has been independently found by a number of our beta testers. Whatever happens, I'm going to have to change hundreds of scripts, but I'm convinced there's something wrong with Game.Interactive = false. I'll be manually disabling whatever hotspot/region/sprite I've just clicked on, so maybe that should be automatic.

Cheers

 
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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #7 on: August 09, 2008, 02:18:57 PM »

well, I use Game.Interactive almost all the time, having game published and the only issue I ran into was the one I've described. The other suggested workaround is intercepting Game.ChangeScene in game.script as follows:

method ChangeScene(name)
{
  Game.Interactive = true;
  Game.ChangeScene(name);
}

this would save you tons of changes. ;)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Game.Interactive = false; can be defeated, causing hang
« Reply #8 on: August 09, 2008, 02:29:24 PM »

Hi MM

Thanks for the idea.

Your method might work but all over the game we have differences in the way we use ChangeScene - some are dissolves, some are immediate, so we'd have to pass those parameters too, and I wouldn't know where to begin doing that.

Cheers
 
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.196 seconds with 22 queries.