Save and load up-to-date TEXT how-to (no youtube video, no premade tools, please)

Hello,

Is there any up-to-date TEXT how-to about save and load?

Videos are just an nighmare between the video quality and the time navigation, text+pictures how-to are far more convenient to use (at least for me). I will sound old fashioned but Youtube is not my Alpha and Omega. By the way, please, don’t suggest premade tools, I want to understand the fundamentals, the how-to. As a metaphore : My interest goes to a DIY solex, I have no use to buy a Hemi.

Do you mean save and load the game?

Then do it like this:

@**ClockworkOcean

As a beginning, That should do it, thanks.

To avoid missuderstanding : Event BeginPlay, BeginPlay is related to the start button event?**

Begin play is typically the first event to run in most blueprints. What I’ve shown there is a generic setup, so what it means is ‘only do this once at the start’. You’ll see if you look at the nodes, it’s creating the save game. This only needs to occur once, because after that, it’s sitting on the hard drive.

The other two nodes are what you need to do when saving and loading.

The save game object is created by right clicking in the content browser and choosing ‘blueprint class’ and then searching in the bottom list for ‘savegame’:

](filedata/fetch?id=1848992&d=1609773742)

You can then just put variables in it, which get written to the save game file, which resides on disk.

Well, I get this part. I’m more confused about where to attach the saving node.

Event BeginPlay appears to be linked to player BP. At start, my idea was to attach a game instance to the persistent level in order to be able to deal with future personnalizations. But judging by tutorials and your example, it seems I need to create a empty player instead.

But then a new problem occures, if there are changes to remember in the level, and they need to remain independant from the player… they will be lost.

Does “OnInitialized” Event used on the splash screen can work?

I did a written tutorial many years ago for saving data. As far as I can tell its still applicable. Definitely not best practices though. Might might be a start for you though.

I myself like written tutorials too but they do take longer to make.

@**pattym

I will check. Thanks.**

The BeginPlay thing happens only once, it’s really up to you where you put it. It could be in a level BP, the player controller, the game instance… You just have to make sure the save game exists, then you’re done.

What kind of player you have it totally independent of how you execute your save game.

When a change occurs, you run the save game update code. It’s that simple.

Later, when you need to recall and correct things, you use the load code.