Save and Load Prefab Instances using Auto Save

Examples which use the ES3AutoSave and ES3Prefab Components, which do not require code.
sebasrez
Posts: 12
Joined: Fri Mar 04, 2022 1:57 pm

Re: Save and Load Prefab Instances using Auto Save

Post by sebasrez »

Joel wrote: Wed Oct 12, 2022 4:11 pm
sebasrez wrote: Wed Oct 12, 2022 3:58 pm Hi!
When I added auto save to a prefab, I just did the transform to test. It started spawning the same prefab in multiples each time I started and stopped the game (saved and loaded) to the point of crashing. What can I do to fix this? Thank you
Hi there, and thanks for getting in contact :)

I don't appear to be able to replicate this at my end. Please could you replicate this in a new project and private message it to me so I can see what is happening?

Also just to check, are you adding Auto Save to the prefab using the Auto Save window, or are you adding the Components to the GameObject yourself? You should never directly add the ES3AutoSave/ES3Prefab Component to a GameObject as it won't always be initialized correctly.

All the best,
Joel
Hi Joel, thanks for the assistance unfortunately the issue seems to be when using a pooling system from another asset called Poolboss, when loading a scene it auto spawns all the prefabs in the pool list when auto saved. Is there any help you can possibly provide with this? I fear that it may be an issue which neither asset creator can provide support for if they both conflict with each other...

Just to clarify, I added the es3 component by right clicking the prefab, selecting easy save, selecting the option to enable easy save.
Aside from this everything works amazing and im excited to use the tool as it makes saving a breeze, I just have this concern about pooling in the project. Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and Load Prefab Instances using Auto Save

Post by Joel »

sebasrez wrote: Thu Oct 13, 2022 3:55 am
Joel wrote: Wed Oct 12, 2022 4:11 pm
sebasrez wrote: Wed Oct 12, 2022 3:58 pm Hi!
When I added auto save to a prefab, I just did the transform to test. It started spawning the same prefab in multiples each time I started and stopped the game (saved and loaded) to the point of crashing. What can I do to fix this? Thank you
Hi there, and thanks for getting in contact :)

I don't appear to be able to replicate this at my end. Please could you replicate this in a new project and private message it to me so I can see what is happening?

Also just to check, are you adding Auto Save to the prefab using the Auto Save window, or are you adding the Components to the GameObject yourself? You should never directly add the ES3AutoSave/ES3Prefab Component to a GameObject as it won't always be initialized correctly.

All the best,
Joel
Hi Joel, thanks for the assistance unfortunately the issue seems to be when using a pooling system from another asset called Poolboss, when loading a scene it auto spawns all the prefabs in the pool list when auto saved. Is there any help you can possibly provide with this? I fear that it may be an issue which neither asset creator can provide support for if they both conflict with each other...

Just to clarify, I added the es3 component by right clicking the prefab, selecting easy save, selecting the option to enable easy save.
Aside from this everything works amazing and im excited to use the tool as it makes saving a breeze, I just have this concern about pooling in the project. Thanks!
Hi there,

I've created a thread for this here, as this may help other people:
https://moodkie.com/forum/viewtopic.php ... 475#p10475

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
MiaMia
Posts: 2
Joined: Fri Aug 25, 2023 12:35 pm

Re: Save and Load Prefab Instances using Auto Save

Post by MiaMia »

Hi! I have been struggling with save and load system, so I am glad I found you!
Before I further mess up my game (as I did with previous save and load systems) I wanted to ensure I use it properly.

1. So, for every item I want to save do I check:
active, hideFlags, layer, name, tag, transform, mesh? So if my scene has hundreds of items do I check all those for all of them?
Easy Save Question.jpg

2. I understand for prefabs I just right click and select easy save. Is that correct?

3. What about for variables and inventory items? How do those get saved?

Please note I am using Game Creator 1 for the game.

4. Does Easy Save asset have the capability to quit the game? If not, I have one working from Game Creator. Will the easy save ensure that the scene with variables and prefabs is remembered when I quit? What do I need to do to make sure it does?

Thank you! I really hope this works. I am about to release the alpha release of my game and really hope I get this working!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and Load Prefab Instances using Auto Save

Post by Joel »

MiaMia wrote: Fri Aug 25, 2023 12:46 pm Hi! I have been struggling with save and load system, so I am glad I found you!
Hi there,
1. So, for every item I want to save do I check:
active, hideFlags, layer, name, tag, transform, mesh? So if my scene has hundreds of items do I check all those for all of them?
This wholly depends on what changes in your game. If it doesn't change at runtime it's not recommended to mark it to be saved.
I understand for prefabs I just right click and select easy save. Is that correct?
If you're using Auto Save (which it looks like you are), then you just need to use the Prefabs panel. See the Auto Save guide for more info:
https://docs.moodkie.com/easy-save-3/es ... hout-code/
3. What about for variables and inventory items? How do those get saved?
For information on what variables get saved, and how to select which variables get saved, please see the Supported Types and Choosing what is Saved guides:

https://docs.moodkie.com/easy-save-3/es ... ted-types/
https://docs.moodkie.com/easy-save-3/es ... -is-saved/

In the Auto Save window you can press the cog next to the Component to open the Types panel, which allows you to choose which variables on a script get saved. It's recommended to only change this if absolutely necessary, and to only select things which change at runtime.
Please note I am using Game Creator 1 for the game.
As I have no experience with this I'm afraid I can't provide any specific guidance.
4. Does Easy Save asset have the capability to quit the game?
Easy Save is a save/load asset, so quitting a game isn't a part of it's functionality.
Will the easy save ensure that the scene with variables and prefabs is remembered when I quit? What do I need to do to make sure it does?
You can follow the Auto Save guide for information on how to tell Easy Save when to save and load:
https://docs.moodkie.com/easy-save-3/es ... hout-code/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
MiaMia
Posts: 2
Joined: Fri Aug 25, 2023 12:35 pm

Re: Save and Load Prefab Instances using Auto Save

Post by MiaMia »

Thank you very much for such a quick reply!!!
One more question. Is there anything else I need to do to ensure save and load will load my game after I exit? Or it will automatically do so?
Is there a GUI interface or something to ensure the user can either load an existing game or start a new game?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and Load Prefab Instances using Auto Save

Post by Joel »

MiaMia wrote: Fri Aug 25, 2023 3:02 pmOne more question. Is there anything else I need to do to ensure save and load will load my game after I exit? Or it will automatically do so?
You choose when it loads and saves from the settings in the Auto Save window.
Is there a GUI interface or something to ensure the user can either load an existing game or start a new game?
You would need to create your own GUI for this.

Generally if you want to create save slots you would make each save slot a different file using code. See the 'Changing the filename or path from code' section at the end of the Auto Save guide for the code for this. Then to get a list of all of the save slots which have been created you would use the ES3.GetFiles() method.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
lockhighjumpingvenus
Posts: 7
Joined: Wed Oct 11, 2023 9:52 pm

Re: Save and Load Prefab Instances using Auto Save

Post by lockhighjumpingvenus »

I am trying to use auto save and a coded save function, but there seems to be issues I am running into. I just want to confirm if it is possible to use autosave with a coded save function in the same scene? :?:
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and Load Prefab Instances using Auto Save

Post by Joel »

Hi there,

This is fine as long as they're both using the same settings. For example if you're using encryption, encryption must be enabled for both Auto Save and code and use the same password.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
seadou19
Posts: 3
Joined: Wed Nov 15, 2023 10:16 pm

Re: Save and Load Prefab Instances using Auto Save

Post by seadou19 »

The tutorial project is saving the assets when quitting but not their position in the game. Not sure if that is something we are supposed to change but I do not see any instructions so I'm confused. Basically all the shapes spawn at position (0,1,-10)
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save and Load Prefab Instances using Auto Save

Post by Joel »

seadou19 wrote: Fri Nov 17, 2023 9:23 pm The tutorial project is saving the assets when quitting but not their position in the game. Not sure if that is something we are supposed to change but I do not see any instructions so I'm confused. Basically all the shapes spawn at position (0,1,-10)
Thanks for the heads-up, it looks like we exported an earlier version last time we updated the example. I've now replaced the attachment in the original post of this thread with the correct version.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply