Hi!
I am struggling to understand what is happening in my project right now and hope to find some help here.
I created a save system for my first person game, and I tried to keep it modular and sclable.
However, I notices after deleting all the save profiles written to disk (to check if the game saves fine), that certain variables from my save game object are not immediately changed when they are called during gameplay.
{Please note, the setup for the upgrades is just for testing}
For instance: I created the save system inside the first person template from unreal. I edited the weapon pickup to change a variable in the struct “Player Upgrades”, and then save the game via an interface call.
Now, if I load up my autosave file, the gun will be added automatically to the player, because the player blueprint asks:
This works fine. But only if the save file “Autosave” already exists in the SaveGames location:
The blue true is from the weapon pickup and comes after I set the struct within the weapon pickup to true.
The yellow true comes from the game instance, where I just get the struct, split it and print the bool.
However,
This is confusing me, because if I delete the save file and then play again, the gun gets not saved and the save game object seemingly is not edited:
The weapon pickup bool says true, but inside my game instance its now false. Thus, the struct is not getting changed, but why? Is it a timing problem? But how can that be if the save game data command comes after I edited the struct?
I really want to fix that because for now, I ask inside the Game Instance if a Autosave exist and if not, just write to disk. But it seems weird to me that the struct isnt getting changed if the save game was not written to disk, even though I create a save game object in the beginning.
The Init Event is called via Event Init-
Sorry if this seems confusing, I hope I communicated my issue in somewhat clear way!