Save/load level and location and life,

Fundamentally, you should load up your save and copy the variables out to work with them. You basically create all your variables the way you want then, with life etc, and when you want to save, you copy every single variable over to your save actor, and then save it.

So load the save from the slot. Get the save, cast to it, set your life on your player to the life from your cast save file. Same with location and everything else. The go through do what you want with the values you pulled from the save.

Then play. You life changes and location etc. So now you want to save, you make sure all the variables are set. Life is set, location vector is set, etc. Then you get your save actor, and set the life inside it. Set the location inside it. Everything. So that the save actor is up to date with all the relevant information. The you save the game to the slot.

1 Like

I am trying to understand the sequences. I have a hard head but I will get it. I’m still standing. :sweat_smile:

I understand the variables and location are ok now? It’s just the level swap, right?

1 Like

Yes, the location and the life bar now load well by putting the LoadSaveMAp at the end of the sequence. But the problem I have is that the character when entering the first level jumps to the saved level automatically, it’s like (if I understand correctly) the LoadSaveMap sequence doesn’t execute it, to know if it’s the level or not.

1 Like

That’s why I said to take that open level off begin play. You have to choose when to use ‘open level’, otherwise the player will always open the last played level before you can do anything.

1 Like

I’m going to let a few days go by because I’m blocked, for the moment I will continue provisionally with the system I had with 3 buttons, CeSaveGame to save level and location, CeLoadGame to load level and once the level is loaded, LoadUbi to load location and health bar. I need to clear my mind and continue. I am not giving up :dagger:. I will be back soon. Thanks infinite for the help.

You’ll get there… :slight_smile:

Ubi is the character?

Then it’s no problem to say ‘save level’ → save ubi

But you can’t say ‘load level’ → load ubi, because once you do ‘load level’ nothing else in the code gets run.

So, you say ‘load level’.

Then, Ubi knows to do ‘begin play’ → load ubi ( or you have to do it after Ubi has started the level ).

If you get totally stuck, zip up the project and put it on google docs ( or something ) and I’ll take a look. But you need to make the project small for this ( I don’t know if it is ).

1 Like

No, Ubi is just the short name for Ubication,

The 4 nodes are interfaces within the character

Save level 02 - save level
Save ubi 2 - saves the location and the bar
Loadlevel 02 - load level the level
Load Ubi 2 - loads location, health bar, total points

As you say I can not put after “Loadlevel 02” the “Load Ubi 2” because it does not run it. My solution for the moment is to do it manually from a button.

When I press the “Save game” button in the interface I save “Save level 02 and Save ubi 2” and when I press the “Load game” button regardless of the level where it is I load “Loadlevel 02” and once the character is in the level I can press in the interface an “extra” button that loads “Load Ubi 2” to load location, the health bar, total points.

Sounds like it’s working.

You basically can’t load a level from inside another level. I mean you can, but it doesn’t make much sense, because you have to stand in level x to load level y.

That’s why the level is usually loaded from a menu.