Page 1 of 1

Saving procedurally instantiated prefabs

Posted: Sun Apr 11, 2021 6:00 pm
by nFighter
Hey! I believe it should be a common task, but I’m not fully understand the concept so I’m not sure what exactly I need to search.

I have a scene with procedurally instantiated Prefabs. I’m using MapMagic to populate scene with objects. With the same “seed” same prefabs always instantiated in the same place. Is there a way I could save/load this instantiated prefabs state with EasySave?

Let’s say I instantiate red cubes on scene start, during the gameplay some of them were colored green. Can I save this state, so on next scene load my instantiated cubes will be colored accordingly?

Re: Saving procedurally instantiated prefabs

Posted: Sun Apr 11, 2021 6:05 pm
by nFighter
I suppose it could be some logic on prefab that save the components state and load it when the prefab instantiated...

Re: Saving procedurally instantiated prefabs

Posted: Sun Apr 11, 2021 7:20 pm
by Joel
Hi there,

There's information on saving and loading prefabs in general here:
https://docs.moodkie.com/easy-save-3/es ... s-prefabs/

As I have no experience with MapMagic I'm afraid I can't comment on that directly.

All the best,
Joel

Re: Saving procedurally instantiated prefabs

Posted: Mon Apr 12, 2021 3:05 pm
by nFighter
As far as I understand - ES3 want to instance saved prefab, but I want to handle the instancing myself. And only ask ES3 to restore component state on my instanced prefab, does this kind of workflow exist?

Re: Saving procedurally instantiated prefabs

Posted: Mon Apr 12, 2021 3:41 pm
by Joel
Hi there,

In this circumstance you would use ES3.LoadInto to load the data into your prefab instance, or save the Components individually and load these into the Components on your prefab instance.

All the best,
Joel