Save System Menu?

Announcements, support questions, and discussion for the Dialogue System.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Save System Menu?

Post by timbecile »

I'm working on an RPG, and I would like a save menu where I can show all the save games that are available. I looked through Save System Methods and didn't see anything for getting that sort of information. Tony, can you point me in the right direction for building a Save/Load menu screen?
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Menu?

Post by Tony Li »

Hi,

You could use the free Dialogue System Menu Framework on the Extras page as-is or adapt it to your liking. It currently shows all available slots, with unused slots reported as "-empty-". But you could change this into a scrolling list that only shows the used slots if you prefer. It might require a bit of coding.

The Dialogue System also integrates with Easy Main Menu if you prefer to use that.

If you want to write the menu from scratch, you can use the method SaveSystem.HasSavedGameInSlot to check which slots contain saved games.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Save System Menu?

Post by timbecile »

Great! Thanks Tony! I'm not afraid of coding so this will be perfect
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Save System Menu?

Post by timbecile »

One other question...how many save slots are allowed? The menu shows 3, but I'm going to need way more than that.
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Menu?

Post by Tony Li »

Unlimited.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Save System Menu?

Post by timbecile »

Great! One last thing...

If I wanted to save metadata for the savegame (like the save game name, a thumbnail, and the timestamp of the save) how would I do that?
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Menu?

Post by Tony Li »

You'll have to save that separately on your own. The Dialogue System Menu Framework, for example, saves it in PlayerPrefs or a disk file, depending on whether you're saving games to PlayerPrefs or disk.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Save System Menu?

Post by timbecile »

ok. guess I'll need to dig in deeper on the menu system.

so it's saved as its own separate save slot?

Thanks again Tony!
User avatar
Tony Li
Posts: 21080
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save System Menu?

Post by Tony Li »

When it saves a game to a slot, it also creates a PlayerPrefs string entry containing information about that saved game. The string contains the slot number, the current system time, the value of Variable["CurrentStage"] if set, and return value of an optional delegate function RecordExtraSlotDetailsHandler() that you can assign.

When showing the load game menu, it sets the button label for that slot to the string that was saved in PlayerPrefs.

The Menu Framework is meant to be a starting point. You could start with that and then save the catalog of slot info to a disk file instead of PlayerPrefs. This way you can include additional information with each catalog entry, such as a screenshot. When setting up the load game menu, you can load each catalog entry's screenshot to accompany the slot's button.
timbecile
Posts: 110
Joined: Mon Mar 12, 2018 11:00 pm

Re: Save System Menu?

Post by timbecile »

OK, I see. looks like it's in the SaveHelper.SaveGameNow?

to save to disk, can I use the DiskSaveGameDataStorer.WriteStringToFile function?

Hope I'm not being too much of a bother!
Post Reply