Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: cat on Mon 26/12/2011 23:20:56

Title: SetRestartPoint weird issue
Post by: cat on Mon 26/12/2011 23:20:56
Hi!

I have a weird restart issue:
I want to show a splashscreen and afterwards change to the menu. When the game is won I want to automatically go to the menu screen without showing the splash screen.

The problem is, when the game is finished, the menu screen is shown, but the clicks on the menu buttons (objects) do not work anymore. It is not triggered and the breakpoint there is not hit.

In the menu room I do the following:
function room_Load()
{
   bLeft.Visible = false;
   bRight.Visible = false;
   bBack.Visible = false;
   SetRestartPoint();
}


And this is one of the click handlers:
function oStart_AnyClick()
{
  player.ChangeRoom(1);
}


What I do after the game is won:
RestartGame();
Title: Re: SetRestartPoint weird issue
Post by: monkey0506 on Tue 27/12/2011 01:51:21
The restart point is just the save slot 999, which is automatically deleted on the normal exit of the engine.

It seems as though you're not posting all of the code and other info we need. For example, whether any of these objects are ever turned off or moved. Also, have you done any debugging other than just setting a breakpoint? It would be useful to know the relevant information from the objects at the time they stop working. You may also want to check the mouse mode since AnyClick events aren't triggered by eModeWalkto.
Title: Re: SetRestartPoint weird issue [solved]
Post by: cat on Tue 27/12/2011 08:32:32
Ok, I tried setting the mouse mode explicitly in
function room_AfterFadeIn()
{
  mouse.Mode = eModeInteract;
}
but that didn't help, because the function is not called after restart.
Edit: I even tried to put this code in the room rep_exec but this didn't help either.

The objects are never turned off or moved, there is just a code in rep_exec to change their sprite when mouse over. I don't know what else I could debug, because the hovering still works but the clicks don't. There isn't any code besides that in the menu screen.

Maybe I'm just doing it wrong and the SetRestartPoint should be in another function? Or maybe I should do the restart and skip splashscreen thing in a different way without SetRestartPoint?

Edit2: Interestingly, the keys for save/load/etc don't work after the restart either...

Edit3: Got it! I put the SetRestartPoint in room_AfterFadeIn instead of room_Load() and now it works. Weird.