Skip to content
Plugin 1.0 · Unreal Engine 5.8Source snapshot · Version details

Containers and filters ​

Select an implementation ​

Set URicContainerDefinition.ContainerFragment to an implementation fragment:

  • URicContainerFragmentJigsawFixedSize creates URicContainerJigsawFixedSize. It uses a fixed grid, item shapes, and rotation.
  • URicContainerFragmentOneItem creates URicContainerOneItem. It holds one item instance, which can itself be a stack.

Add configuration and filter fragments to the definition's separate Fragments array.

Create managed containers ​

Call AddContainerFromDefinition or AddContainersFromCollection on an authoritative URicContainerManagerComponent.

URicInventorySubsystem.CreateContainerInstance constructs an instance, but construction and attachment are separate concerns. For a top-level inventory container, prefer the manager API so ownership and registration are maintained.

Tags and queries ​

Set the main fragment's ContainerTag to identify the container's purpose, such as Ric.Container.Type.Main or Ric.Container.Type.Pockets.

Use GetContainers() for top-level containers and GetContainersRecursive() for nested inventories. Look up an instance with FindContainerByIdRecursive or a purpose with the manager's tag-query methods.

Do not iterate occupied grid cells to count unique items: one multi-cell item can occupy several slots. Use GetItems() or GetItemsRecursive().

Placement rules ​

Before a slot-specific placement, call CanAddItemToSlot with the item, rotation, and slot index. The implementation checks its layout and filters.

For bulk additions, inspect the returned count or FRicAddResult. Inventory capacity can prevent the entire request from being placed.

Dynamic tag filters ​

Add URicContainerFragmentDynamicFilter:

  1. Fill GameplayTags with the tags to match.
  2. Choose AllowItemsWithTags or DisallowItemsWithTags.
  3. Enable ApplyToAllChildren only when the filter should also apply to descendant containers.

The runtime dynamic filter matches any tag in its set. For more specific logic, create a custom filter.

Custom filters ​

Subclass URicFilterBase and override PassesFilter(Item, Container, SlotIndex). Add the class through URicContainerFragmentFilters.

Built-in filter classes include URicFilter_LockedSlots and URicFilter_BanContainers. Filter classes can be used as CDOs, so avoid shared mutable per-container state in a filter class.