Loading game from save list

I’m trying to create game menu where i can choose game slot from list. I got my slotNames stored in DT_SlotNames. I’m receiving names properly (printed them to test it). I’m trying to enable button to load game save if it exists and when it does I cannot cast it to BP_ThirdPersonCharacter where i got my “startingGameSave” function. How do I load game via button and my function? Blueprint of my button below (pink line is slotName string and works as it should):

StartingGameSavae function:

Is this supposed to be connected?

Removing the widget before attempting all of this isn’t a great idea, because it’s trying to run your code :slight_smile:

Better to remove it at the end.

Yes it should be heh, i had to disconnect it while moving things around. Unfortunatelly after reconecting it, still cannot cast.

1 Like

Is there a player at this time, or are there just menus?

Just menus, i thought this might be a problem but i have no idea how to solve it

That’s the problem, then. If there is no character, this won’t work

image

Ok. Could you tell me the way how to do this properly, pls?

Hey @Smokus1,

Rather than calling from your character, you could call from your Game Instance or another blueprint. Check out this non-Epic affiliated tutorial for an example on setting that up:

I hope the above is the solution you need!

1 Like

Hey @Smokus1,

Checking in! Was the above the solution you were looking for?

Sorry, i had not very much time to check it out, let you know soon

Finally found some time to work on that. Basically I did everything as tutorial said. Save and load works. I just don’t know how to load save from main menu. I start the game with gamemode override set to BP_MainMenu. It loads the widget with 2 buttons. First button is to exit the game (works) and second opens game slot widget and then removes w_main from parent. In game slot widget there is only one button that should load level by name but all it does is removing it from parent and going back to main menu widget. Button blueprint below:

Couldn’t upload more than one img so here’s a load game:

And menu:

In this area

image

I don’t know what ‘on game loaded’ is, but I can tell you that everything was a waste, if you then call ‘open level’.

That’s because pretty much everything gets thrown away by ‘open level’. It just opens the level you name, and everything was like it was when you saved it in the editor.

If you want to get back to when you saved the game, you need to do ‘open level’ first, then load the save game, and make all the changes :slight_smile:

Ok, that makes sense

Just to be clear, you have to do the loading either inside the level, or you can use something like the game instance to load stuff, because ‘open level’ doesn’t affect the game instance.

Skipping the part of saving/loading the game, i’m troubling with that open level, my main menu level won’t disappear, and level just won’t open, any ideas?
(the only button in main menu) i also tried without Remove from parent

EDIT: I created new map for MainMenu and there set game mode override to mainmenu and in thirdpersonmap left thirdpesrongamemode and now it works

1 Like