PulseSave Integration
Table of Contents
Overview
PulseQuestSaveBridge is a separate plugin (LuQ-Studios/PulseQuestSaveBridge) that connects PulseQuest to the PulseSave save system. PulseQuest and PulseSave don’t depend on each other; only the bridge depends on both.
| Class | Purpose |
|---|---|
UPulseQuestManagerSaveModel | PulseSave model of a quest manager. Stores the quest manager as the bytes of a FPulseQuestSaveGame (with the versioned state structs of its records, see Save & Load) |
UPulseSaveQuestManager | UPulseQuestManager that implements IPulseSaveInterface |
APulseSaveSharedQuestHost | APulseSharedQuestHost that implements IPulseSaveInterface |
Setup
- Enable Pulse Quest, Pulse Save and Pulse Quest Save Bridge.
- C++: add
PulseQuestSaveBridgeto your module dependencies. - Use
UPulseSaveQuestManagerinstead ofUPulseQuestManager(orAPulseSaveSharedQuestHostinstead ofAPulseSharedQuestHost). - Let a PulseSave manager collect it (actor collector, or register it in a register collector).
Blueprint: Save quests with PulseSave
- Replace the quest manager component with
Pulse Save Quest Manager, setSave Identifier(e.g. from the player id). - PulseSave: collect the component (actor collector, or
Register Objecton a register collector). Save To Slot (Async)/Load From Slot (Async)(or the engine slot variants) of the PulseSave manager save and load the quests with everything else.Save Load Paramson the component decides whether the quest manager is reset before loading.
Settings
| Property | Description |
|---|---|
SaveIdentifier | PulseSave identifier. If None: <owner name>.<component name> for the component, the actor name for the host |
bSaveEnabled | Switches saving off |
SaveLoadPriority | Higher loads first (PulseSave load order) |
SaveLoadParams | FPulseQuestManagerLoadParams used when PulseSave loads the quest manager (reset first by default) |
The identifier must be the same in every session. Quest managers on player controllers or player states are spawned at runtime and get new names, so set SaveIdentifier (for example from a player id).
How it works
- Save: PulseSave calls
OnSave; the model starts an asynchronous quest manager save and reports not ready (IsReadyToSave) until the manager’sOnSavedEventfired. Then the bytes are in the model and PulseSave writes it. - Load: PulseSave reads the record into the model and calls
OnLoad; the model startsLoadQuestManagerand reports not ready (IsReadyToLoad) untilOnLoadedEventfired. - A failed quest manager save or load fails the model right away (
SaveModelError); problems are written to the model messages and show up in the PulseSave reports. - Only the authority saves and loads. Shared quest host players are not saved; add them again after loading.
Existing saveable actors
If an actor already implements IPulseSaveInterface, keep a plain quest manager, return UPulseQuestManagerSaveModel::StaticClass() from GetSaveModelClass and call the model:
void AMyPlayerState::OnSave_Implementation(UPulseSaveManager* SaveManager, UPulseSaveModel* SaveModel)
{
if (UPulseQuestManagerSaveModel* Model = Cast<UPulseQuestManagerSaveModel>(SaveModel))
Model->BeginCaptureQuestManager(QuestManager);
}
void AMyPlayerState::OnLoad_Implementation(UPulseSaveManager* SaveManager, UPulseSaveModel* SaveModel)
{
if (UPulseQuestManagerSaveModel* Model = Cast<UPulseQuestManagerSaveModel>(SaveModel))
Model->BeginApplyToQuestManager(QuestManager, FPulseQuestManagerLoadParams());
}
Other model functions: CaptureQuestManagerNow (synchronous save), SetQuestSaveGame / GetQuestSaveGame (store a FPulseQuestSaveGame you keep yourself), IsOperationPending, WasOperationSuccessful.
Versions
UPulseQuestManagerSaveModel::GetModelVersion() is 1. The quest save game has its own version (PULSE_QUEST_SAVE_GAME_VERSION); data of a newer version is refused.