Hi all,
Having an issue here and I’ve reached a dead end:
I want to be able to save and load a complex array. The array type is an object I created that include within it an array of himself (object A contains an array of type object A). I know my only way to be able to save object A is to save its variables in a structure and on load to create the object with the saved parameters from the structure. The thing is a structure can’t include itself in it (so there won’t be an infinite loop).
What would be the best way to make something similar to this?
There is no way to do this cleanly. You’ll have to create an identical struct.
There is, however, likely a better way to structure your save data so that this isn’t necessary. Could you elaborate on what you’re trying to do?
I’m trying to create an array, save it and load it when game is starting.
The array contains object A. Object A contains an array of object As in it. That way each element in the array can split to separate branches.
For saving, I tried creating two structures: One that contains the parameters of the object I’m trying to save (let’s call it Structure A) and another structure that contains Structure A and an array of Structure As.
I think the save part works, but loading is a problem.