10. Save System - dylogaming/Dialogue-Component GitHub Wiki
The DC Save Ref object is where various properties are saved, such as actor location and the branches each actor was left on
Description | Image |
---|---|
The properties are saved in the struct and can be extracted like this | ![]() |
If you are going to use this asset's save file, ensure you set these bools to true on the Player's Dialogue Component's Save Struct If you don't, the struct will still be updated throughout your play session (and can be used for your own save system if you're using one) |
![]() |
Saving is a tricky thing to grasp at first, so this may be difficult to understand until you get it down.
Description | Image |
---|---|
Let's start with the custom events that come with the default BP_DC_TPC | ![]() |
Here we have several functions that utilize the save logic when these keys are pressed | ![]() |
Description | Image |
---|---|
The way "Save Game" works is if a save slot doesn't exist, one is created, and when created, it saves the data from all actor transforms, their current START branches, and conditions into the DC Save REF's struct | ![]() |
The image below shows in the first comment box, that the system loops through every actor and checks if they have the Dialogue Component
For all the actors that do, the next comment box gets their transforms added to the DC Save Ref's struct, as well as their current START (branch), and the player's conditions
Description | Image |
---|---|
When the "Load" event is called, the system extracts the data from the DC Save Ref's struct and sets the properties for each actor | ![]() |
For example, within the "Set Transforms" collapsed node, we can see that DC Save REF's structs "Actor Transform" map is used to load up each actor & their transform data that was previously saved, and sets their transform using it, restoring it to exactly how it was when the player saved the game.
The same occurs when the system loads up each actor's START branch
When using save systems from other assets, you basically want to call upon either the entire, or partial parts of the save and load logic from the Dialogue Component
So if another asset has a save button, you'd add the Dialogue Componeont's save logic, and same for loading