Load Game from Slot

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Arctichorse9
Posts: 25
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Load Game from Slot

Post by Arctichorse9 »

Hi, I am using AutoSave and trying to script a Continue Game button to load the last saved scene and data but running into an error message.

An object reference is required for the non-static field, method or property for this line of code--

Code: Select all

PixelCrushers.SaveSystem.LoadGameFromSlot(1);
I believe AutoSaves are kept in Slot1? Thanks for any help.

Also, how would I query whether there is save data in Slot1?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Game from Slot

Post by Tony Li »

Hi,

If you're using the AutoSaveLoad component, you can specify which slot number to use.

To check if there's a saved game in the slot, check PixelCrushers.SaveSystem.HasSavedGameInSlot(#).
Arctichorse9
Posts: 25
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Load Game from Slot

Post by Arctichorse9 »

I discovered the Dialogue System extras and have successfully implemented a full menu system that is really nice but I have two questions.

If you have a Dialogue Manager in the Main Menu, do you need one in any other scene?

And I have a small problem to solve. On Windows, I can open the menu panel by pressing the Escape key but on mobile I have to use a button. Is there a script to add to a button to open that menu?

Thanks a lot for your help. Those extras are really useful.
Arctichorse9
Posts: 25
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Load Game from Slot

Post by Arctichorse9 »

I think my only question now is whether you need a Dialogue Manager in other scenes if you have one in the Main Menu because searching this forum I found what I think is the answer to my other question about calling the menu on mobile:

https://www.pixelcrushers.com/phpbb/vie ... ape#p33236

Very helpful.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Game from Slot

Post by Tony Li »

Hi,

It's fine to have an instance of your Dialogue Manager prefab in every scene. It makes it easier to test that scene directly in the Unity editor's play mode. However, see this: How To: Manage Player Controls and Scene Changes
Arctichorse9
Posts: 25
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Load Game from Slot

Post by Arctichorse9 »

Thank you very much.
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load Game from Slot

Post by Tony Li »

Glad to help!
Post Reply