Save Load Objects from different scenes.

Discussion and help for Easy Save 3
Post Reply
xPhrophet
Posts: 1
Joined: Thu Sep 03, 2020 5:57 pm

Save Load Objects from different scenes.

Post by xPhrophet »

Hello, I've created a random 3D map generator that creates Rooms linked to a specific scene, then links the doors to each room.
Got this to work by adding the RoomGenerator/Map/Player to the DoNotDestroyOnLoad, then loading the scene that corresponds with the room.
Each room is an already created prefab parented to RoomGenerator. That way a room never has to be created or destroyed and it keeps the
reference ID on save, even after a new map is already generated.

But now how to handle saving items/enemies in each Arena (3D space that the player can move around in)that has already been loaded.
The previous method would have me create the max number of prefabs of each item/enemy in every Arena,
Then disable the arena, DoNotDestroy, and reactivate it when player returns there. This require each Arena to have it's own pool of all
possible items and enemies, and to have the max number of arenas already created before start.

Could you possibly create a video tutorial of using EasySave3 in a setting that involves multiple scenes each with a variety of objects such as items using custom classes and scriptable objects? As most games are set up around this.

It seems we are supposed to store a dictionary of uniqueID's along with the prefab Gameobject, restore the object that holds this Dictionary, load the scene with it's own EasySave Manager, instantiate the prefabs then ES3.Load using that ID, or adding it to the AutoSaveManager as a ES3Prefab. I will continue to play around with this but have yet to be successful.
Attachments
saveExample.jpg
saveExample.jpg (547.07 KiB) Viewed 219 times

User avatar
Joel
Moodkie Staff
Posts: 2971
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save Load Objects from different scenes.

Post by Joel »

Hi there, and thanks for getting in contact.

It's difficult to understand your question without some context, as every project is different. Please could you create a new, very basic project which replicates the basics of what you're trying to achieve and private message it to me with instructions so I can try to understand?

If you're saving a series of prefab instances then generally you should just use ES3.Save<GameObject> as described here:
https://docs.moodkie.com/easy-save-3/es ... s-prefabs/

With regards to this:
It seems we are supposed to store a dictionary of uniqueID's along with the prefab Gameobject, restore the object that holds this Dictionary, load the scene with it's own EasySave Manager, instantiate the prefabs then ES3.Load using that ID, or adding it to the AutoSaveManager as a ES3Prefab. I will continue to play around with this but have yet to be successful.
I think you may be getting confused, as there's nowhere in our documentation which says to do this. Would you be able to confirm where you read this, as it seems it comes from a source which is not affiliated with us?

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Post Reply