Save And Load
Add Component
Add a Save Load Component to any of your actors. In the example, I added it to the Player Controller.
Now you can use the Server Load All and Server Save All functions and bind them to any events.
You can also save and load individual parts, such as only the character's inventory slots or only World Objects, which include picked up items, items in storage, and interaction components.
Note that if you want to save these parameters separately, they must be located in different save slots. However, you can still use the Server Save All function and load only the necessary parts.
Integration with your save system
From the Save Load Component, you can get variables that you can save to your save file, and then load everything from these variables when loading.
Preparing Items for Save
- In the Inventory component, you should manually add a unique identifier. This identifier should be unique across all characters with different inventories.
- In each Storage Component, only if it is not a Global Storage, a GUID should be generated.
If you add an Actor Interaction Component somewhere, it must also have a generated GUID.
If you add a Scene Interaction Component, it should also have a generated GUID.
All GUIDs should be generated when the actor has already been added to the scene, not in the blueprint itself.
You don't need to generate GUIDs for BP_World_Item.