Save/load level and location and life,

Hello everyone! I’m a bit lost, I have created these 2 sequences to save/load level and to save/load location and life, the thing is that separately both work well but when joining them only loads the level, the location and life does not, it is as if the Load Level 02 function overwrite Load Ubi2 or cut the flow. I don’t know if anyone can help me. Thanks in advance.

All we see is custom events, they might be empty! :wink:

Can you show the code?

1 Like

Oh yes, these are the sequences. Thank you.




I think what you’re going is overwriting a previous save game.

Once you have saved the game, next time you need to modify something in the save game, you need to read back the save game, change it, and write it back. Not create a new save game object every time.

Here’s my save game 101

Don’t always just create a new one

image

I have tried your sequence but I don’t know why it doesn’t load the level. Today is not my day. I have overridden my node line so it doesn’t create another save game and it doesn’t work either, it loads the level but not the life or location. I’m sure it’s something it’s overwriting but I can’t see it. Thanks a lot anyway. Any more help? I give up.

Just break the process down. Do one piece at a time.

1 Like

Thanks, I have tried but something is wrong, anyway I will continue looking at that option that seems to be the most correct, if I get it I will post the result.

1 Like

Like I say, the main problem is that you’re creating a new save game every time. It will overwrite what’s in the one you saved… :slight_smile:

1 Like

Hi again, I’ve merged the two sequences, but it’s not working entirely. I managed to load the level, and the only variable that’s updating is the total points, but the rest, such as the player’s location, health bar, and current points, are not loading. I’m not sure if the node order has something to do with it, but I think I’ve tried everything. This is the closest I’ve come to getting it to work. Any suggestions before I give up again? Thank you in advance.








Sorry, it’s a bit of a mess, I can’t tell what’s happening :slight_smile:

I will write you one that saves player location and health.

So I make a save game like this

Make a blueprint function library, so you don’t have to keep doing all this stuff

In there, put these functions

In your player, you can now say:

This works.

Do you specifically need the game instance. If so, what are you doing with it?

Also, just to be clear, when you use ‘open level’, EVERYTHING gets thrown away ( except stuff in the game instance ). So when you start a new level, your player needs to load their location, health, blah blah etc… If I was changing levels from inside the player, it would go like this

and

image

Because when the new level starts, the player is completely new, and needs to load everything…

1 Like

It seems so simple made by you that I find it hard to give up haha I’m going to try again and redo it as you say and see what happens. Thank you very much again.

1 Like

Tell me how it goes…

1 Like

Hi there @JESUSPINEL, hope you’re well!

This topic has been moved from International to Programming & Scripting: Blueprint.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing.

1 Like

Hello again, here I am still fighting. If I save the game in the second level and try to load it from the first level, it loads location, time, health bar and totals, but it doesn’t change level. I guess it has to do with the last 2 steps you indicate, which is the part I don’t understand very well. I think I’m very close. Thank you very much.



I don’t see you saving the level, where is that? ( the pictures are small )

The level name just needs to be a string in the save game.

1 Like

Like this

Does it make sense?

Hang on, bit of a bug there…

The second bit is more like

The trouble is, it will always take you back to the last map saved. Usually, you would do this from a menu.

So we need to have a separate event to load the map. Gimme a moment…

1 Like

So, this keeps when we load the map, apart

With

1 Like

It only saves the location, it does not load the saved level. When I go back to the menu and start another game it automatically loads the saved game. I’m still giving it a try. Thank you very much I keep trying.


So go to LevelA ( for instance ), run CeSaveGame.

Then open LevelB ( another level ), and run LoadSaveMap. It has to open LevelA.

I think there’s something you’re not understanding about loading levels.

If you write the level name to the save game, it’s in there, it’s not going anywhere.

Later, if you read that name and use it with ‘open level’, the level will open.

But… when the player appears in that level, it has to know that the first thing to do is get everything from the save game ( except the level ). Because it will be a totally fresh player, no saved settings.

1 Like