I’m shocked there isn’t better information or a widely known standard way of doing this but it is what it is.
The goal is to be able to SAVE the game and exit. Then when the player clicks LOAD from the main menu, it loads the latest game save that includes the LEVEL they were last in.
‘Get Current Level Name’ CANNOT be used on a variable SET or updated during gameplay. Each time I’ve tested, the level ONLY saves when you either use a ‘Open Level (by Object Reference)’ OR ‘Open Level (by name)’ by selecting the MAP from the dropdown options. ANY attempt to use a VARIABLE reference from the GAME SAVE to record the MAP name will NOT work. I feel like this is partly because it’s STRING to NAME conversion it has to do which I have also tried just using the World Soft Object Reference which also fails.
Fundamentally my question is: How do you LOAD your game if there is an existing save file from the main menu?
If there is a saved file then just load it?
I apologize if I misunderstood your intention. You can try to print the string to see if your current name level is correct before you save.
Also, the way you should save your file is to replace the current value with the new one, in this case, you can set the variable value with the current level’s name and attempt to save it. Cause I’m assuming you are experiencing redundancy?
I tried just loading it from the slot but it doesn’t open the level, it remains in the main menu level, the issue is I can’t capture the level name and use it as a variable to load from in the main menu unless I use the dropdown option
You need to load game from slot, in your save game object set a name type variable and on save, set that to the return of get current level. Then on load game run the open level by name and plug in that variable
Ah, I see what might be the mistake here. Did you load your save game from the slot? Try to print out the values and see if it’s valid or not whenever you are trying to load.
Again, it appears your saved game reference here is local to the save game trigger class/object. You need to setup a game instance, make a saved game object in that. Then get game instance, cast to itself, from there get your save game object, and id recommend setting up functions in your saved game to call and set these values, Ryan Laley on YouTube had a great set of videos on setting it up or your more than welcome to hmu on discord for direct assistance: roflmaster.(With the period)
Saved games is a surprisingly complex system to setup in UE for how common and simple features it seems. But especially as you develop your project and want to say save player location, level stats or other actors stats it can get confusing
I followed some videos by Ryan Laley, doesn’t go too in depth with saving tons of different types of variables but runs you through the basic setup and will get your feet moving. Feel free to hmu on discord too : roflmaster.(With the period)