Loading A Previously Saved Game

Started by Frodo, Mon 21/10/2019 04:13:26

Previous topic - Next topic

Frodo

My game is almost ready for beta testing (finally!   :wink:)

I added a 'Load' button in the Main Menu screen, cos... that's a handy thing to have. 
[imgzoom]https://i.imgur.com/sDnz99c.png[/imgzoom]

But how do I link to it?  How do I load a game from the Main Menu?
The 'Load' feature is a sub-menu within the game, where I can Load, Restart, Quit etc.  Not an actual screen.
So how do I Load a game from the Main Menu screen?    :confused:

Slasher

I think it's just

Code: ags

 gRestoreGame.Visible=true;

Khris

You say "sub-menu" and "screen"... do you mean "GUI" and "Room"?
Don't want to come off as a jerk, but AGS probably does have specific names for the things you're talking about, and using them will make helping you much easier ;)

Cassiebsg

Assuming that you "sub-menu" is a Gui, you just turn it visible on click, like Slasher said.
You might have to adjust your Z order for the GUI with a higher number than your main menu (assuming it's a GUI as well), so that it's displayed in front of it.
There are those who believe that life here began out there...

Frodo

Slasher, that brings up a blank Restore window.  But it doesn't include any actual Saved games.   :confused:
I can Load a game after I start playing, but not from the Main Menu. 
For Play, Credits, Intro, I used Hotspots and "player.ChangeRoom" to jump to the relevant room, but that doesn't work for Loading a game. 


Chris and Cassie, yeah, sorry, I meant GUI and Room.
After you start playing the game, the bar at the top lets you Look, Talk, Pick Up, and also gives you access to the Load, Save, Restart, Quit screen. 
But I can't seem to access Load, Save, Restart, Quit from the Main Menu I showed above.   :confused:

Crimson Wizard

#5
Quote from: Frodo on Tue 22/10/2019 18:52:51
Slasher, that brings up a blank Restore window.  But it doesn't include any actual Saved games.   :confused:
I can Load a game after I start playing, but not from the Main Menu. 

Could you post a code that you use when displaying restore dialog from Main Menu and from inside the game? Is there any noteable difference?

Note that AGS only automatically fills in the built-in restore dialog, but if you are using your own GUI with a list, then you also must call a function to fill the list with save items (ListBox.FillSaveGameList()
).

Frodo

Crimson Wizard, I used the code that Slasher poster, for the Main Menu screen:
I'm using an AGS pre-made GUI.  I'm not advanced enough to make my own, lol.   :tongue:

Code: ags
function hLoad_Interact()
{
  gRestoreGame.Visible=true;
}


And that brings up a blank Restore window
[imgzoom]https://i.imgur.com/Ivo2LdZ.png[/imgzoom]


But when I start playing the game, I can access the full Menu.
There's not a code for this that I can figure out.  It's just... there.    :confused:
[imgzoom]https://i.imgur.com/bs2MujL.png[/imgzoom]

[imgzoom]https://i.imgur.com/6qG1OJT.png[/imgzoom]

Crimson Wizard

Quote from: Frodo on Tue 22/10/2019 19:59:08
Crimson Wizard, I used the code that Slasher poster, for the Main Menu screen:
I'm using an AGS pre-made GUI.  I'm not advanced enough to make my own, lol.   :tongue:

Code: ags
function hLoad_Interact()
{
  gRestoreGame.Visible=true;
}


Well, then, it's obvious why it is empty, you are not filling the list.

I suggest replace this line with a call to same function that is called when you hit the button in options.

Find that GUI and that button in the editor, and see what function is linked to its OnClick event on the events pane.

Cassiebsg

In the old sierra template the function was called: show_restore_game_dialog()

So try calling it, they probably didn't change the name of it on the new template.  ;)
There are those who believe that life here began out there...

Slasher

Quote from: Cassiebsg on Wed 23/10/2019 16:55:45
In the old sierra template the function was called: show_restore_game_dialog()

So try calling it, they probably didn't change the name of it on the new template.  ;)

It still works in 3.5.0 in the Global..

Frodo

#10
Sorry for the delay in replying, I've been ill in the hospital.   :sad:
Back home now, though. 

Crimson, Cassie, Slasher, I'm trying your advice now, thanks.   :smiley:


EDIT:

Ahhh, I used the following code on the 'Load' button, and it seems to work now.
Thanks everyone.   :smiley:


Code: ags
function hLoad_AnyClick()
{
  gRestoreGame.Visible = true;
  lstRestoreGamesList.FillSaveGameList();
  mouse.UseModeGraphic(eModePointer);
  gIconbar.Visible = false;
}


Olleh19

Hahaha headbangers heaven  (laugh)

I have to play this! When?  :shocked:

Frodo

Quote from: Olleh19 on Sat 02/11/2019 00:20:57
Hahaha headbangers heaven  (laugh)

I have to play this! When?  :shocked:

Soon.  It's getting beta tested at the moment (shoot me a PM if you're interested), then it'll be ready.   :wink:

SMF spam blocked by CleanTalk