Soulslike Framework Docs
  • Welcome to Soulslike Framework!
  • Framework Overview
    • About the Framework
    • Features & Systems
    • Before Purchasing
    • Personal Assistance
  • Getting Started
    • Setting up Animations
      • Setup Locomotion Blendspaces
      • Setup Custom Montages
    • Using the Utility Tools
      • Easy Setup Tool
      • Asset Creators
      • Asset Browsers
    • Actor Tags
    • Finding References
  • Workflow
    • Using a Custom Character
    • Creating & Editing Actions
    • Creating & Editing Stats/Attributes
    • Creating & Editing Status Effects
    • Creating & Editing Buffs
    • Creating & Editing Items
      • Creating & Editing Weapons
    • Creating an Enemy
    • Creating Cinematics
  • Animation Notifies
    • Damaging & Combo's
      • Register Attack Notify
      • Weapon Trace Notify
        • AI Weapon Trace Notify
      • Fist Trace Notify
        • AI Fist Trace Notify
      • Area of Effect Damage Notify
      • Spawn Projectile Notify
        • AI Spawn Projectile Notify
    • Defensive
      • Try Guard Notify
      • Hyper Armor Notify
      • Invincibility Frame Notify
    • Feedback
      • Weapon Trail Notify
        • AI Weapon Trail Notify
      • Camera Shake Notify
        • World Camera Shake Notify
      • Launch Field Notify
      • Chaos Field Notify
      • Footstep Notify
    • Miscellaneous
      • Input Buffer Notify
      • Interrupt Montage Notify
      • Camera Sequence Notify
      • Set Movement Mode Notify
      • AI State Notify
      • AI Rotate Towards Target Notify
      • Adjust Stat Notify
  • Components / Managers
    • Player Specific Components
      • Input Buffer
      • Action Manager
      • Combat Manager
      • Interaction Manager
      • Inventory Manager
      • Equipment Manager
      • Ladder Manager
      • Progress Manager
      • Save/Load Manager
      • Radar & Radar Element Components
      • Central Debug Component
    • Shared Components
      • Stat/Attribute Manager
      • Status Effect Manager
      • Weapon Collision Manager
      • Buff Manager
      • Loot Drop Manager
    • AI-Only Components
      • AI Interaction Manager
      • AI Behavior Manager
      • AI Combat Manager
      • AI Boss Manager
  • Extending Functionality
    • Using Motion Warping
    • Custom Saving/Loading
    • Adding New Settings
    • Extending Weapon Animsets
    • Weapon Specific Impact Sounds
    • Resetting Enemies After Resting
Powered by GitBook
On this page
  • Example 1.0 - Saving a Custom Property
  • Example 1.1 - Loading our Custom Property
  • Example 2.0 - Saving Custom Actor(s)
  • Example 2.1 - Loading our Custom Actor(s)

Was this helpful?

  1. Extending Functionality

Custom Saving/Loading

PreviousUsing Motion WarpingNextAdding New Settings

Last updated 3 months ago

Was this helpful?

It is quite easy to expand upon the existing save/load system, thanks to our and the power of Instanced Structs!

Lets demonstrate this with a few examples.

Example 1.0 - Saving a Custom Property

For this example, we're going to add a new variable to our Character blueprint (B_Soulslike_Character). You can also add it to any component you want.

Next, we'll add some example events to alter/view its value:

Now to save this variable, all we need to do is trigger the RequestAddToSaveData() message in our Player Controller (PC_SoulslikeFramework):

This message has 2 inputs. It might look a bit overwhelming at hindsight. However it provides a great amount of modularity when it gets to saving/loading data:

  1. Save Tag (Gameplay Tag): Tag used for tracking save entry. Can be used to find data by tag and/or update/remove save entry data.

  2. Data[] (Instanced Struct): The actual data that is going to be saved/loaded.

In our case, we'll create an array which contains a single element - the value of our new property "MyVariable". This will update our save data and trigger an autosave whenever we change this value. We should also make the saving part a custom event if we want to call it from anywhere else.

  1. SerializeDataForSaving(): Serializes a specific data by tag and adds it to the final save data.

  1. SerializeAllDataForSaving(): Serializes all possible data and sets it to the final save data.

You're all set! Now our new property will get saved whenever it's value has changed. Additionally, it will also get saved whenever we bulk-save data (specifically on quits/crashes etc).

The reason it takes a few extra steps to save a simple property in Soulslike Framework is due to the save system being designed for handling more complex sorts of data.

You can always check out the existing saving/loading functionality for more information.

Example 1.1 - Loading our Custom Property

Loading the saved data is as easy as this:

Example 2.0 - Saving Custom Actor(s)

For this example, we're going to create an actor which adjusts its scale when player overlaps its trigger. Then we'll save its "overlapped" state and new scale.

Lets start by creating a new actor and setting it up accordingly:

Next, we'll need a new Struct to keep track of the 3 properties this actor has:

  1. Id (GUID): the unique identifier of the actor (important)

  2. Scale (Vector): the 3d scale of the actor

  3. HasBeenOverlapped (Bool): the state of the actor

And now, when the timeline for scaling up is finished, we can request to update the save data with the new entry:

Finally, ensure that the actor instance you want to save in your world/level has a valid GUID:

That's it! Now we're saving this actor.

Example 2.1 - Loading our Custom Actor(s)

That's basically it. Now when you play, you'll notice that this actor now saves its properties!

Finally, there are 2 methods in that we need to adjust:

To load, we just need to adjust our Event BeginPlay slightly and bind to 's OnDataLoaded() delegate:

AC_SaveLoadManager
AC_SaveLoadManager
Save & Load Manager
Rough example - the cast can be avoided.
Rough example - the cast can be avoided.
The decimal difference is related to formatting.