I am waiting for Epic to release latest version (3.5.8) for Unreal 4.26 on Marketplace.
With this update, I will also add to demo project a “Simple Inventory” component that can illustrate how to easily create an array of serializable Objects (items) that the plugin will save and load automatically for you:
The core of the entire inventory system lies on the fact that the “Simple Item” class is derived from the “Auto Instanced” class that is provided by the Savior plugin:
UCLASS(ClassGroup=Inventory, Category="Inventory", Abstract, HideDropdown, BlueprintType)
class SIMPLEINVENTORY_API USimpleInventoryItem : public UAutoInstanced
{
//...
}
The Inventory Component class just holds an array of those objects, together with some helper nodes to add/remove instances of Items. Because Items are derived from UAutoInstanced class of UObjects, once you load a save data the Savior plugin understands that you give it free pass to respawn any instances of those items into the Array that is marked with the ‘Save Game’ tag within the Inventory Component class:
UPROPERTY(Category="Inventory", VisibleAnywhere, SaveGame)
TArray<USimpleInventoryItem*> Inventory;
Also another key factor is the fact that both, the Inventory Component and instances of Simple Item classes, contain a ‘SGUID’ property that is properly initialized from each class ‘PostInitProperties()’ method:
if ( !HasAnyFlags(RF_ClassDefaultObject|RF_ArchetypeObject) )
{
SGUID = USavior3::MakeObjectGUID(this,EGuidGeneratorMode::ResolvedNameToGUID);
}
You can check the code and blueprints when update is released by Epic, and I have also uploaded the Simple Inventory source code to GitHub that you can download from here:
(UE4) Simple Inventory (github.com)
In demo project there’s both interactable item actors to pick from world that add themselves to the inventory and input commands for testing:
Ctrl+Shift+L in Character Blueprint loads inventory data from any targeted Slot.
It’s using the handy ‘Load Actor Hierarchy’ function for that:
If you also want to examine the way that inventory widgets were put together, it’s good idea to take a look into these C++ classes:
SimpleInventoryWidget.h
SimpleInventoryItemWidget.h
And the Blueprint classes that compose an usable Item class.
I have create two blueprints as example:
BP_SmallPotion
BP_LargePotion
They can be found in Content/Savior2/Demo/Inventory directory.
Widget Blueprints can be found inside SimpleInventory’s Plugin Content directory:







