SetRestartPoint issue - "one time" splash screen

Started by Intangible, Thu 01/09/2011 22:42:02

Previous topic - Next topic

Intangible

I have a "room" that is used to display both the one-time "splash screen" GUI at startup and the title screen GUI:

function room_Load()

  if (Game.DoOnceOnly("Show Splash Screen"))
  {
    BeginShowModalDialog();
    gStatusline.Visible = false;
    gSplashscreen.Visible = true;
  }
  else
  {
    SetRestartPoint();
    BeginShowModalDialog();
    gStatusline.Visible = false;
    gTitle.Visible = true;   
    PlayBGM(aTitle);
  }
}

The simple idea here is that the first time this room is encountered, it will show the splashscreen. On subsequent encounters, it will show the title screen. So far, so good.

Of course, if the player restarts the game, that will reset the flag for "Game.DoOnceOnly("Show Splash Screen"))", which I don't want (the only way they should be able to see the splashscreen again is if they restart the application itself). So I placed a call to SetRestartPoint() within the block of code that shows the title screen, in the hopes that from this point onward, whenever the user restarted the game, they'd jump to this part of the logic.

It almost works. The title screen displays instead of the splashscreen, but the title GUI is disabled... none of the buttons are enabled. Any ideas as to what might be causing this?

monkey0506

I could be wrong, but you could check and see if eEventRestoreGame is fired when restarting the game (in on_event). I think it might since the "restart point" is really just the AGS save slot 999. If it is called then you could simply place a call to your "no reset" Game.DoOnceOnly flags in there.

pcj

You could also just make the splash screen a separate room?  Not sure exactly why they need to be in the same room.
Space Quest: Vohaul Strikes Back is now available to download!

Intangible

#3
There's no particular reason that they have to be the same room; it's just that they're both entirely black rooms covered by a fullscreen GUI so I thought I'd try to reuse them.

It doesn't seem to make a difference, though: after a restart the title GUI is still entirely disabled, even if it's separate from the splashscreen:

function room_Load()
{  
   SetRestartPoint();
   BeginShowModalDialog();
   gStatusline.Visible = false;
   gTitle.Visible = true;    
   PlayBGM(aTitle);
}

Is there something I'm missing about restart points? What could make every button on the title GUI disabled after a restart?

pcj

In my quick tests, it does seem to skip game_start() when restarting the game, yes.
Space Quest: Vohaul Strikes Back is now available to download!

Intangible

Well, shucks, how do other people create a splash screen that only displays once during the application's run?

Or do people simply allow the splashscreen to display everytime the user clicks "Restart"? I notice that's how the demo game that ships with AGS works. I suppose it's not the worst thing in the world...

hedgefield

For reasons outside my knowledge the Restart function skips any room_load, _firstload or _beforefadein code, so when setting up a restart point it is best to do it at the exact moment the player gains control and any scripted events have finished unfolding. Otherwise upon a restart it will simply not run these codes, such as in your case loading the menu. So load the menu FIRST, then set the restart point.

Intangible

So in that case, what should I change in the above example (the second, simplified example)?

hedgefield

function room_Load()
{
    BeginShowModalDialog();
    gStatusline.Visible = false;
    gTitle.Visible = true;   
    PlayBGM(aTitle);
    SetRestartPoint();
}

When restarting now, this should take you back to the point right after the menu has been loaded.

Intangible

It's weird, but even with this code:

function room_Load()

    BeginShowModalDialog();
    gStatusline.Visible = false;
    gTitle.Visible = true;   
    PlayBGM(aTitle);
    InitializeEngine();
    SetRestartPoint();   
}

... the buttons on the title GUI are still disabled on a restart (it's safe to call InitializeEngine() explicitly, because that method starts with a "Game.DoOnceOnly"). I'm not sure where to look next... I don't even know what would be disabling the buttons in the first place; it's not like I disable them anywhere in my game (that I can think of). I've never even seen the buttons disabled until I tried to introduce this SetRestorePoint thing.

Intangible

I've been thinking... maybe I should just follow the KIS rule (keep it simple), and include whatever splashscreen information I wanted on the title page. That way, the game can just start on the title page every time, and there's no need to mess around with restart points.

It's not like I "need" a separate splash screen. :)

SMF spam blocked by CleanTalk