In this guide I will show how to save new variables for your players. This could be useful for if you have added new variables to the BP_PlayerInventory and need them to be saved and loaded.
Before following the guide please make a backup of your project, editing structs can cause issues.
Start by going to the S_PlayerSave struct, here you can add new variables that you want to be saved, for this guide I will just be creating a variable called Level and the variable type will be Integer (NOTE – this is not a guide on adding levels this is just an example name).
When adding variables to a struct its best to only add a couple at a time. Once done Save the struct, then play in editor (It might take a while to load as blueprints have to be compiled) once the character loads in game you can exit play in editor and save all then restart the project. If you need to add more to the struct then do the same thing again until you have added all the variables to the struct that you need.
Next go to the BP_SGKSaveGame then go to the SavePlayerInventory function and copy the video below to add the pins for your new variables.
Next get your variable from the Player Inventory and connect it to the Set Members node like I have in the image below.
Next go to the BP_PlayerInventory then the LoadPlayerInventory function. Then copy the video below using your own variables.
NOTE – If your variable needs to work with multiplayer remember to set its Replication to Replicates in its settings in the BP_PlayerInventory, if you dont then only the server will have the loaded value!