I’ve been trying to deal with this issue since yesterday, I’m using save node function and it just won’t save the single variable I’m trying to save. The Game Save has like 70 Variables so idk if it affects anything but, I really need help I’ve tried everything and it just won’t save for some reason…
Show us how you doing it.
Well it would be hard to explain it to u with some screenshots.
I’ll try to explain it with text.
So in the SaveGame BP, there is a single bool, and a string for the name. (I deleted the save game that has over 70 variables due to my rage)
In the Main Menu Widget, I create a SaveGame Object and save it to a variable, the player would type his name and the bool is used to see whether the profile is created, and then when the player presses create, it would set the variables and then save them using Save Function Node.
Now logically I should be confident that the variables are saved and should stay there until I delete the them. IT’S NOT… I added a debug that goes true if it successfully saved and false if it doesn’t… It’s always true and whenever I check the variables using print string it just always set back to it’s default…
What is a Save Function Node? Usually [Save Game to Slot] is used, and then [Load Game from Slot] to load the save. You wrote nothing about loading – where do you want your saved variable to come from?
I’m trying to load the variable from the same blueprint, it’s just if the player quits the game and already made a somesort of profile, the Main Menu UI will be different
and I am using the load function, it also sometimes just saves half of the variables and the other half won’t save…
I’m literally doing everything the correct way and it still won’t save…
Test this:
Create a save game object with a bool and a string:
In the game mode, at the begin play, set the values and save them . Press play and then stop.
Now, again in the game mode, change it at the begin play, so to read the values and to print them:
Is it working? If, it’s then you are doing something wrong and you must show us exactly how you doing it.
When you create the save game object, all its variables will have the default values that you’ve set in you Save Game blueprint. In the loaded one, the variables will have the values you’ve set before saving. If I understand your question right, then no, their returns won’t be the same.
then if I want to get a copy of the variable from the game save, how do I do that. There would be 2 game save references, the create and the load…
I think I’m over thinking this, Ima try that and reply back
okay so, I guess everything somehow worked. Now the only issue I have left is when saving over 70 variables, It just sometimes saves and sometimes half of it saves…
And sometimes it doesn’t save at all, unless I place em on the event tick
This we have discussed in one of the other questions here; if a save file already exists, you have to load it, cast it to the respective save game object, change certain variables, and then save it again to the same slot. This was the other previously saved variables will stay saved. You can’t create a new game object, change a few variables, and save it to the existing slot, because the other variables will be defaulted. IDK if it’s the reason behind your issue, though.
can I have the create and load function with the same reference on the return node?
yea it does… as I said above, half of the variables are being saved…
. I added a debug that goes true if it successfully saved and false if it doesn’t.
Since you’re saving the game asynchronously, I assume you’re checking that in the Completed pin.
Have you tried to use “Save Game to Slot” instead of “Async Save Game To Slot”, just to be sure that nothing interfering with the operation?
Are you also loading the game asynchronously?
yea same thing, and yes I’m loading the game ASync
can u save the game more than once on the same blueprints?
If half of the variables are still not being saved even with synchronous save/load then I out of ideas.