Skip to content
Plugin 1.0 · Unreal Engine 5.8Version details

API overview ​

Include paths are relative to each owning module's public headers. Examples omit reflection metadata for readability.

Container manager ​

Header: Components/RicContainerManagerComponent.h.

cpp
URicContainerBase* AddContainerFromDefinition(
    URicContainerDefinition* ContainerDefinition);
bool AddContainersFromCollection(URicContainerCollection* Collection);

bool AddItemFromDefinition(
    URicItemDefinition* Definition, int32 Num, int32& OutItemsAdded,
    FGameplayTagContainer FindSpaceInContainers,
    bool LookForPlaceInNestedItems,
    FGameplayTagContainer ExcludeContainerTags = FGameplayTagContainer());

bool AddItemFromDefinitionWithParams(
    URicItemDefinition* Definition, int32 Num,
    const FRicAddItemParams& Params, FRicAddResult& OutResult,
    FGameplayTagContainer FindSpaceInContainers,
    bool LookForPlaceInNestedItems,
    FGameplayTagContainer ExcludeContainerTags);

The manager owns roots. Query with GetContainers(), GetContainersRecursive(), FindContainerByIdRecursive(), and FindItemByIdRecursive(). Definition queries include first-match and all-match recursive variants.

Events: OnContainersChanged, OnSlotsChanged, OnItemAdded, OnItemRemoved, OnItemDiscarded, and OnItemGameplayTagChanged. The separate OnGameplayTagChanged event reports changes to the manager's own statistics.

The manager has its own replicated StackTags, with GetStatTagStackCount, SetStatTagStack, AddStatTagStack, and RemoveStatTagStack. These values are independent of its items and are excluded from GetTotalStat().

Container instance ​

Header: Instances/RicContainerBase.h.

cpp
bool AddItemDefinition(
    URicItemDefinition* Definition, int32 Stack, int32& OutItemsAdded,
    FGuid NewID = FGuid());

bool AddItemWithParams(
    URicItemDefinition* Definition, int32 Stack,
    const FRicAddItemParams& Params, FRicAddResult& OutResult,
    FGuid NewID = FGuid());

bool AddItemRef(
    URicItemInstance* Item, int32& OutItemsAdded,
    ERicRotation Rotation = ERicRotation::D0);

bool AddItemRefToSlot(
    URicItemInstance* Item, int32 SlotIndex,
    ERicRotation Rotation = ERicRotation::D0);

void RemoveItem(URicItemInstance* Item, int32 Num = -1);

These are virtual operations. Use concrete grid or single-item containers, not the abstract base's default behavior.

Queries: GetItems(), GetItemsRecursive(), FindItemByIndex(), FindItemByID(), GetItemSlotIndex(), GetItemOccupiedSlots(), and definition queries.

Validation: CanAddItemRef(), CanAddItemToSlot(), PassesFilters(), GetDropAction(), and CanSwapItem().

Persistence: GetSaveData() and LoadFromSaveData().

Item instance ​

Header: Instances/RicItemInstance.h.

GetID(), GetDefinition(), GetNum(), GetMaxStack(), GetShape(), and ownership queries describe the current item. GetContainers() exposes nested containers.

FindFragment<T>() returns a matching definition fragment or null. For multiple matches, use FindFragmentsByClass().

Read counts with GetStatTagStackCount(); modify them with SetStatTagStack(), AddStatTagStack(), or RemoveStatTagStack().

Shared tag-value interface ​

Header: Interfaces/RicGameplayStackTagAssetInterface.h.

URicItemInstance and URicContainerManagerComponent implement IRicGameplayStackTagAssetInterface:

cpp
virtual void GetOwnedStackGameplayTags(
    FRicGameplayTagStackContainer& OutTags) const = 0;
virtual int32 GetStatTagStackCount(FGameplayTag Tag) const;

Cast a runtime object to this interface to read its values without depending on its concrete type. It supplies reading only; storage, mutation, events, and replication belong to the implementation. See Gameplay tags and statistics for examples and Blueprint availability.

Prediction component ​

Header: Components/RicClientPredictedInventoryComponent.h.

cpp
bool MoveItemRotated(
    URicItemInstance* Instance, ERicRotation Rotation,
    URicContainerBase* ToContainer, int32 ToSlot);

ERicDropAction ProcessDrop(
    URicContainerBase* Container, URicItemInstance* Item,
    ERicRotation Rotation, int32 SlotIndex, bool& Result);

bool AddItemDef(
    URicItemDefinition* Definition, int32 Num, int32& OutItemsAdded,
    FGameplayTagContainer FindSpaceInContainers,
    bool LookForPlaceInNestedItems = true,
    FGameplayTagContainer ExcludeContainerTags = FGameplayTagContainer());

bool SplitItem(URicItemInstance* Item, int32 Num = 1);
bool RemoveItem(
    URicItemInstance* Item, int32 Num = -1, bool CallDiscardEvent = false);
bool LoadAmmo(URicItemInstance* Magazine);
bool UnloadAmmo(URicItemInstance* Magazine);

Other operation families include add-to-container, stack, swap, nesting, clearing, actions, quantities, and tag edits.

Use GetContainerCopies() for owned UI and GetObservedContainersCopy() for the observed manager. GetAllContainerCopies() combines them. SetObservedContainerManager() changes the external scope.

Find objects by GUID; subscribe with SubscribeToContainer(). Use OnSync and OnSyncContainer for model changes.

RPC gateway ​

Header: Components/RicItemOperationsRPCsComponent.h.

Reliable server requests include AddItem, AddItemRef, MoveItemRotated, ForceMoveItemRotated, SwapItemRotatedByID, StackItems, SplitItem, RemoveItem, ExecuteAction, tag edits, quick-slot assignments, and ammunition transfers.

These RPCs return no synchronous server result. Prefer the prediction facade for player UI. Your game validates permission for authoritative gameplay requests.

Inventory subsystem ​

Header: Subsystems/RicInventorySubsystem.h.

cpp
static URicInventorySubsystem* GetInstance(const UObject* WorldObject);

static URicContainerBase* CreateContainerInstance(
    UObject* Outer, URicContainerDefinition* Definition);

static URicItemInstance* CreateItemInstance(
    URicContainerBase* Outer, URicItemDefinition* Definition,
    FGuid NewID = FGuid(), bool bPreserveIdentity = false);

Construction alone is not a complete placement transaction. Prefer manager/container additions for ordinary gameplay.

FindContainerManagerByID() resolves registered owners. GetSaveData() and LoadFromSaveData() operate across registered inventories.

Low-level copying/transfers have lifecycle effects. Some methods named Copy transfer source contents; use prediction's model construction for UI rather than assuming subsystem copy methods are immutable deep-copy utilities.

Tick-handler registration uses handler class default objects and passes top-level containers.

Quick slots ​

Headers: Components/RicQuickSlotsComponent.h and Components/RicClientPredictedQuickSlotsComponent.h.

Configure count before BeginPlay. Assign with SetItemToQuickSlot(), clear with ClearQuickSlot(), and read with GetItemAtSlot(). Listen to OnQuickSlotChanged.

Common value types ​

  • FRicSize: rows and columns.
  • FRicCustomShape: dimensions and packed cell mask.
  • FRicAddItemParams: stack policy and initial tag values.
  • FRicAddResult: accepted quantity, new IDs, and affected stack IDs.
  • ERicRotation: D0, D90, D180, D270.
  • ERicEStackPolicy: Auto, ForceNewSlots, NoStack.
  • ERicDropAction: None, Add, Swap, Stack, Nest, Return.
  • ERicStackResult: All, Partial, None.

Optional systems ​

RicInteraction exposes points, interactors, a spatial subsystem, strategies, and a listener interface. RicInput exposes local-player input and game-instance drag helpers. RicPreview exposes preview handles and the preview subsystem.

See the dedicated system guides for lifecycle and integration examples.