Page 1 of 1

Load Game from Slot

Posted: Fri Oct 18, 2024 6:44 am
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?

Re: Load Game from Slot

Posted: Fri Oct 18, 2024 12:38 pm
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(#).

Re: Load Game from Slot

Posted: Sun Oct 20, 2024 3:47 am
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.

Re: Load Game from Slot

Posted: Sun Oct 20, 2024 3:53 am
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.

Re: Load Game from Slot

Posted: Sun Oct 20, 2024 8:35 am
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

Re: Load Game from Slot

Posted: Mon Oct 21, 2024 1:19 pm
by Arctichorse9
Thank you very much.

Re: Load Game from Slot

Posted: Mon Oct 21, 2024 3:18 pm
by Tony Li
Glad to help!