Can't Save/Load with Button from Widget

Hi everyone,

I have been having some trouble lately finishing my save system. I want it so from the pause menu when they are in a game they can save all of there stats such as there world location, health, hunger, etc. I hooked it up to a button but I don’t think it is saving the data. I get a .sav file in my project folder and I don’t get any errors in the editor so I am not sure what it could be. For the loading part, from the main menu they have an option to load a save game file. Again, no errors or anything. It doesn’t load the saved data though. I’m not sure if it is the save or the load part that isn’t working. Here is my current BP setup:






bumping this thread

In situations like these I hook up Print String nodes to certain events and see if everything is working as intended.

For this I’d check the “Cast Failed” outputs fist to see if any of the casts may cause problems. If that’s not the issue you might want to print the Saved values and the values of the character after they are “Set” so see if the savegame has the correct numbers in it. If it returns the wrong numbers on load it might save them incorrectly and that narrows down the problem to the save itself.

Basically try to think where a problem could be and check if everything works as intended.

Hi,

While I was debugging like you said I came across these errors in my message log that I wasn’t getting before.

Does that help at all?

Hm I can only guess without having it infront of me.

Where do you define the “Char” variable and what’s stored inside of it? It seems like he’s not able to access it on load.

So my assumption is that “Char” is your player character and your load function is trying to apply the variables before the character is loaded. It’s just a wild guess, though.

Char is a reference to my character. Char is connected to these nodes:

It’s connected to a couple other places too. Would I have to cast to my character anywhere?