Download

Saving/Loading and Array of Objects

I’ve looked at tutorials, Tappy Chicken and Rama’s example, but can someone tell me what is the “recommended” way to save and load an array of objects?

More specifically, procedurally generated actors, which seem to break the FArchive derived routines in the engine (they use FindObject, but since they are procedurally generated, they are not assets). I can code up something custom, but I was wondering if I missed something built-in that would do the transforms, materials, etc.

EDIT:and I can’t edit my typo in the subject :stuck_out_tongue:

I provided additional code and information on your answerhub post

https://answers.unrealengine.com/questions/35618/savingloading-an-array-of-objects.html

:slight_smile:

Rama

I replied there and now here for more visibility.

Thanks Rama, I know about the << operator. What I am looking for is the proper way to handle procedural objects. I had looked at the header files, and saw that everything derived from FMemoryArchive has the << operator disabled for UObject*. And the ones for UObject (in ArchiveUObject.h) require assets, for which there are none in procedural generated objects.



class FMemoryArchive : public FArchive
{

...

	virtual FArchive& operator<<( class UObject*& Res )
	{
		// Not supported through this archive
		check(0);
		return *this;
	}

...


new response :slight_smile:

https://answers.unrealengine.com/questions/35618/savingloading-an-array-of-objects.html

Thanks again Rama, but it is not the answer I am looking for. I too have a save system that works the way you describe, but there is a whole object archiving infrastructure included in the engine. I want to know what the recommended way of using it is, instead of doing low-level archiving.

Well hopefully Epic can reply to you on the matter then :slight_smile:

I prefer lower level to save as much space as possible on the HDD :slight_smile:

But once again,

Thank you for posting your research on generating dynamic meshes!

Your research saved me a lot of time!

Here’s a pic of a UV-Mapped generated Torus Knot with collision, that I made in-game, and the process was vastly sped up because you shared your research!

:heart:

Rama