Loading a Game from the Main Menu ?

Hi, I am pretty new to unreal engine 4 but I have been working on a save and load function fro my game, Right now I have it working somewhat the user can save and load there position in-game using the pause menu with two buttons on it.

But I am trying to now Load it from the main menu to no avail (I know both the load and save work just for some reason not on the main menu)

Here is my load function

And an image of my main menu

I cant for the life of me now figure out why it is not working ?

I am new to unreal so any help would be great

Place your Open Level node at the end of your blueprint execution and let me know how that worked out.

Reasoning: It’s opening the Alpha level and none of the code after is being called, your menu widget is no longer loaded at that point.*

Thought it was in the Map blueprint, corrected to reflect widget.

Sadly no luck, when i moved it to the end the level didnt even open (Nothing happened when I hit the button) updated image is included with the open level at the end

Also just to be clear the main menu is opened on its own blank level, not level_Alpha_Map

Hmm, well that could mean a couple things are happening, or not happening.

The casts could be failing, which I don’t see why they would be but try running some print strings from the fail execution anyway.

Another thing that could be happening, which I don’t think has been a problem for some while, is that the Slot Name in the game exist and Load game nodes may need to be typed in. A bug in a very early version of the engine didn’t recognize string inputs.

And finally a last question, does the map need to be open as you load, or would it be easier to open the map and load the variables and set positions on startup of the next map?

1 Like

I just implemented that same feature in my game last week.

At first, I couldn’t get it to work, no matter what I tried. I tried executing stuff after the “load map” node since I suspected things might be getting lost during the transition. That didn’t work. The game always just started a new game without loading anything.

Only way to get things to work as I wanted was to create a new boolean variable in my Game instance blueprint (I called it “New game?”) and when the player presses the “Continue”/“Load last game” button on my main/startup menu, it sets the variable of “New game?” to false.

edit 2: I use game instance, since as far as I know, that’s the only place which stores whatever you want between level loads. My main menu is a seperate level which has the following buttons: New game, Settings, Quit. And if a save file does exist, it shows a “Continue” button as well, otherwise it stays hidden.

Then in my level blueprint of the level I want to load, On event begin, I run a check for “New game?” variable from the Game instance blueprint and if it’s true, I’ll start a new game or if it’s false I’ll load the variables I need.

Here’s a screenshot of the game instance cast to set the variable right before loading the new level.

I’m not saying this is the right method, I’m a complete newbie and idiot when it comes to blueprints. Hopefully someone more clever can give you (and me) a better solution. :slight_smile:

edit: looks like I had two variables on that screenshot, not sure why. Either “Continue?” or “New game?” should be enough. :wink:

So from what I understand, you just want to load values into a level you start from your menu.

Built this and just tested in 4.9 and works 100% between levels as long as the top code is executed in your menu (anywhere really) so that it creates the saved game.

I think you may have been forgetting the Save Game to Slot to node in the menu, that’s what it looks like in the above screen shots and idk why I missed that the first time…we’ll say I was tired.

Let me know if this helps.

Man you just saved my life!
Did that to my project and it works perfectly