I have tried many things and I’m not having any luck trying to get this thing to work the way I want it to.
What I want to happen is when I quicksave and exit, I want to save some stats on the current player, and the player stats widget to go away as well as taking my player to the main menu.
It is going through the process properly but it won’t save and load the way I want it to and I have tried to move the stat changes to the player character (though the stats are part of a component to make my life easier when adding enemies with those same stats). The biggest issue here is that it is not setting the variables, and I’m not sure what I’m doing wrong. I also took a good amount of pictures to help anybody who decides to help. Let me know if I need to add more (I hit the cap).
Did you used Saving and Loading Your Game | Unreal Engine Documentation ?
There is CPP and BP solution for this. From taking look at your screenshot (What is realy hard to find anything) You are loading Slotname = 0. eg 0 will mean 0.save (I think).
This may cause some problems Slotname mean file you wish to save to.
If you do that as in given link it will work for sure.
Btw when you load you need to load this save game object then read from this file.
I don’t see anywhere if you are actualy saving it. (When you load make sure to check if it’s valid then assign some default value if it’s not)
But that may be not on screenshot.
I can’t say dirrectly what’s wrong because I don’t see that file.
Could be a problem with you opening a new level and then loading the save game. Since you are opening new level through a widget, I’m pretty sure that widget gets destroyed as soon as that level opens. I’d do loading/saving through the game instance class. Try using a print string node or adding a break point to a node to easily see if it is even being called.
Your save file system is flawed because you use a “sequence” to “open level” followed by a “load game” function within the same widget. Nothing is executed after an “Open Level” node is called. So the widget that is supposed to be “loading” your game never gets the opportunity to load the saved data. You need to open the level and then call this function from somewhere else not the widget that opened the level. If you need some help with this, check out video #21 about Save/Load.
Ok that helped to call the function from elsewhere, and where I called it from is the level as soon as it opens (I don’t plan on saving from elsewhere as all other locations will most likely just be for something that is more or less redundant) and I use a boolean to determine what kind of save I’m loading.