Skip to main content

Save & Load

SkillPal: PRO comes with a game-ready, optimised save/load system.

It has its own component: BPC_Save, which is added to BP_PlayerBase and located in /SkillPal/BP/Saving/.

BPC_Save

Main Functions

  • Serialize: This function will serialise current data (LearntSkills, ActionbarSkills[], CurrentBuffs[] & Gameplay variables) into a singular Struct (S_SavInfo) so it can be saved optimally.
  • AttemptSave: This function will simply call Serialize() first, then send the serialised data into the SaveGameObject - SGO_SkillPal, and save the game to desired SlotName.
  • AttemptLoad: This function will first check if SaveGame exists, if it does not, will reset Runtime variables of skills (including rankIndex). If the SaveGame exists, it will deserialize, then load in order: LearntSkills, ActionbarSkills[], ActiveBuffs[] & Gameplay variables (health/resource/level/experience/skill points/etc).

Helper Events

  • Event LoadSkills: Will deserialize and build skills from save data, processing saved rank index and saved LearntSkills.
  • Event LoadSkillTree: Will "learn" all skills that have been written into LearntSkills through the loading functionality.
  • Event LoadActionbar: Will deserialize and build Actionbar from saved ActionbarSkills[] data, making use of the saved GUID and Keybind to assign correct Skill to correct Actionbar slot.
  • Event LoadActiveSkills: Will deserialize and load Active "buffs" from saved ActiveBuffs data, making use of the saved GUID and BuffEffect to choose which skill to activate when initialised.
using the save system

To save data, all you must do is get BPC_Save and call AttemptSave().

In the Demo, BPC_Save is utilised inside BP_PlayerBase with CTRL+S.