(QUESTION?) Will this work? (Saving actors to an array in a BP Save pulling the vars again on load game)

I am saving an array of actors in my BP Save file. The Actor Class has several variables I need to save, and then load back in on startup. If I save an array of the actors on my BP Save …can I load them Back up from the saved array by spawning new actors into the world then setting the Vars pulled from the Array of saved actors?

Yes. That’s exactly how you do it.

Here’s my savegame 101:

I notice you have some references in there maybe? That probably won’t work, because they are often runtime dependent. But you can get around that.

1 Like

thank you for the response! I was planning on setting the references from the Gamestate separately as it will already have them when this fires. . . still tinkering with my create new game functions so i will be able to test all this soon! thanks again i was worried i may be heading in the wrong direction and needed confirmation it would work if i built it that way.

Just put everything you need to set the level up again, in the save game. Then you’re ok.

Well I have been using a save file as I iterate along the way, no problem pushing and pulling vars directly from it… The main thing I was unsure of was saving an array of actors and pulling the vars out of them. That’s what i had never done before…

I am building an overworld map that is a moving solar system, so it needs to save all the positions of the planets and several game related variables, of many different type, for each Actor. All these things need to load right as they were, when creating or loading a save file.
link to my wix-website for SpaceBlink

Nice retro site, although I don’t see any planets :wink:

Something that makes things a lot easier, is letting all the actors manage their own part of the save game. So you don’t have to manage it from one central sort nightmare cortex.

Unless of course you’re already controlling everything from one script. In that case, use that script to update the SG.

here is my overworld currently

Hmm yeah i am currently saving everything from a single function, seems to make sense for my game though, as my game instance is handling a lot of the moving parts.

1 Like