[PLUGIN] Savior

Do i want to use the “Async " one or the callback one? I mean i only need one slot and one node to call each a save and load , like " save game world " , and " load game world” . right?

Also i should be able to put the initial nodes " save game world " and “load game world” , right on just the parent AI bp , right? All the other AI are childs of the parent. And tie those nodes in to the code , like after the character is possessed ?

If you are a beginner, you do not want to use Async functions at first.
Async programming for some people is really hard to understand, it’s a good thing to edit your Slot class to run as “Synchronous” process as well, then you slowly adapt to async mode when you feel confident.

The system assumes that you understand programming when you use Async methods, and I don’t really have time to teach how to use Unreal Engine in general.
All I can do is support with how the plugin works, but I can’t help with how to work with Unreal Engine in general.

Ok , so i got the AI staying gone , problem is i am using SGK v2 asset and it already has a main menu and saves everything except the AI, so i was hoping to use Savior for just the AI and so i can only really put the savior save game world and load game world nodes on SGK widget on save and load , but it screws up the whole game that way because its like 2 different saves and loads are happening at the same time. But i cant have 2 different widgets to click to save and load. So is there a way to Use Savior for just the AI without having it in a widget , like auto save or something? Otherwise it seems i would have to disable SGK save all together and save and load everything through savior.

You can create a custom BP function where you create “New Slot Instance” then you call “Save Actor” on each of the actors/pawns that you want to save.

Then do the same with “Load Actor” node from an instance of a Savior slot class.

I believe on the player pawn or controller of the demo project there is a sample of that, saving only specific actors instead of using Save World.
They are bound to some raw keyboard functions on the uber graph of the Blueprint.

I added “Savior” module to my Build.cs file, added path of plugin to Include Diretories of VC++ Directiories in Visual studio


but when I built that it had errors

You should be able to just include “Savior.h”.
If that doesn’t work then there’s something wrong with your project’s Build.cs.

Is there an autosave with Savior?

Auto save feature was discontinued since every developer want to do it their own way, it’s different for every project.

in my project, almost actor are created by C++, and I wanna save and load them with your plugin. Can you show step by step to do that?

The sample project that is linked on plugin page has always had C++ classes as example.

There’s is a Controller class and a Pawn class in there that use the plugin C++ interface which I believe is fairly simple to read.

I tried with that tutorial but has message when i open my ue project

In your uproject file you seems to have some plugins enabled = false.

I would make sure that the plugin is actually enabled on Plugins panel.

It can run in 4.27 version, but when I override OnLoaded_Implementation() function it has error

That is not what is in the demo project.
And there is no point making the _Implementation body a UFUNCTION, that is going to conflict with the UInterface generated function.

I saw in your tutorial,


How i can get C++ demo project?

As I said before, there is a link to it on the Marketplace’s plugin description page.

I bought that. then I have questions for you. Demo project only in Blueprint

In the demo project folder there are C++ classes that implement the interface.
It’s the same way all C++ interfaces are implemented.

From the GameBaseCharacter.h and GameBaseCharacter.cpp files you can see C++ example, and it definitely compiles.

There is no full C++ only demo project as such a thing is not necessary to show how the interface can be used from C++.

#pragma once

#include "Savior.h"

#include "CoreMinimal.h"

#include "Engine/StaticMesh.h"

#include "GameBaseCharacter.generated.h"


UCLASS()
class SAVIOR2_DEMO_API ACharacterBase : public ACharacter, public ISAVIOR_Serializable, public ISAVIOR_Procedural
{
	GENERATED_BODY()

public:

	ACharacterBase();

public:

	UPROPERTY(SaveGame) FGuid SGUID;

	UPROPERTY(BlueprintReadWrite, EditAnywhere, SaveGame)
	FText CharacterName;

public:

	virtual void BeginPlay() override;

	virtual void OnLoaded_Implementation(const FSlotMeta &MetaData) override;

	/// Begin Respawn Listener.
	virtual void OnBeginRespawn_Implementation(const FSaviorRecord &Data) override;

	/// Finish Respawn Listener.
	virtual void OnFinishRespawn_Implementation(const FSaviorRecord &Data) override;
};

#include "GameBaseCharacter.h"

ACharacterBase::ACharacterBase()
{
	SGUID = USavior::CreateSGUID(this);
}

void ACharacterBase::BeginPlay()
{
	Super::BeginPlay();

	//GetCharacterNameRenderer()->SetText(CharacterName);
	LOG_SV(true,ESeverity::Warning,CharacterName.ToString());
}

void ACharacterBase::OnLoaded_Implementation(const FSlotMeta &MetaData)
{
	//GetCharacterNameRenderer()->SetText(CharacterName);

	LOG_SV(true,ESeverity::Warning,
		FString::Printf(TEXT("OnLoaded()  ==>>  %s  ::  %s"),
			*MetaData.SaveLocation, *CharacterName.ToString()
		)
	);
}

void ACharacterBase::OnBeginRespawn_Implementation(const FSaviorRecord &Data)
{
	LOG_SV(true,ESeverity::Warning,
		FString::Printf(TEXT("OnBeginRespawn()  ==>>  %s  ::  %s"),
			*Data.ClassPath, *CharacterName.ToString()
		)
	);
}

void ACharacterBase::OnFinishRespawn_Implementation(const FSaviorRecord &Data)
{
	LOG_SV(true,ESeverity::Warning,
		FString::Printf(TEXT("OnFinishRespawn()  ==>>  %s  ::  %s"),
			*Data.ClassPath, *CharacterName.ToString()
		)
	);
}


I don’t see virtual void OnLoaded_Implementation(const FSlotMeta &MetaData) override;
in your code