API Reference

Every public type in the CrimsonInventory runtime module, plus the editor module's tools. Types from other modules are labeled.

Manager

MemberKindNotes
UCrimsonInventoryManagerComponentClassImplements ICrimsonItemHost. Events OnStackChanged, OnInventoryUpdated, OnLayoutGroupsChanged, OnConstraintFailure, OnConstraintChanged, OnItemDropped, OnCurrencyDropped, OnCurrencyChanged, OnItemHostChanged (each with a ...Native twin).
LayoutAssetProperty (replicated)The root layout.
ActiveConstraintsProperty (replicated, instanced)Rule objects.
RegisteredCurrencyDataTables, RegisteredConstraintsDataTablesProperties (replicated)Per-inventory tables.
bEquippedItemsOccupyLayoutPropertyPark equipped entries (false) or leave them in place (true).
OnInventoryInitializedDelegateAfter InitializeInventory.
OnConstraintValueChangedDelegateFOnCrimsonInventoryConstraintValueChanged(UCrimsonInventoryManagerComponent* Inventory, const FCrimsonInventoryCapacityView& Capacity). Fires on the server and the owning client with the replicated authoritative values, once per tag per change. A value can be announced more than once in a frame (a cross-group move); the last is the settled one.
InitializeInventory(ConstraintTables, IntCaps, FloatCaps, CurrencyTables)Function (server)Seed caps and tables.
InitializeConstraintTags(IntCaps, FloatCaps)FunctionSeed caps only.
GetLayout, SetLayoutFunctionsSetLayout is server-only.
GetLayoutGroups, FindLayoutGroup, IsEntryInSubtree, IsNonEmptyBagFunctions (pure)Group queries.
ExtractSubtree, AddSubtreeFunctions (server)Bag-aware move primitives.
CanAddItemDefinition, HasRoomFor, CalculateAddableQuantity, PreviewPlacementFunctionsPreviewPlacement works on clients.
AddItemDefinition, AddItemInstance, RemoveItemsByDefinition, RemoveItemInstanceFunctions (server)Add / remove.
MoveItemByEntry, TransferEntryTo, SplitStackByEntry, MergeStacksByEntry, SetEntryLockFlagFunctions (server)Entry operations by id.
DropItemByEntry, DropItemsByDefinition, DropEntriesAsBag, DropCurrencyFunctions (server)World drops.
FindEntryIdForInstance, SetEntryEquipped, GetEntryEquippedSlot, GetPendingEquips, ClearPendingEquip, HasPendingEquipsFunctionsEquipment bridge.
GetAllItems, FindFirstItemStackByDefinition, GetFilteredItems, PartitionItemsByFilter, GetTotalItemCountByInstance, GetTotalItemCountByDefinitionFunctionsItem queries.
GetEntryView, GetEntryViews, GetCapacityViews, GetCurrencyViewsFunctions (pure)UI snapshots.
GetSlottedEntries, FindEntryByEntryId, FindEntryAtTargetFunctions (C++ only)Raw entry access.
RequestAsyncSort(Request)Function (server)Sort on a worker thread; ApplySortResult lands it.
AddCurrency, RemoveCurrency, RemoveCurrencyByTag, RemoveCurrencyByName, GetCurrencyAmount, FindAllCurrencyByTag, FindCurrencyByName, FindCurrencyDefinitionByTag, FindCurrencyDefinitionByNameFunctionsCurrency. Mutators are server-only.
AddConstraint, RemoveConstraint, GetActiveConstraints, GetConstraintsByTagFunctionsConstraint stack. Mutators are server-only, and both AddConstraint and RemoveConstraint recount the current counters from the entries afterwards, so a rule added to an already-full inventory reports a correct value immediately instead of starting at zero.
GetCurrentIntConstraintValue, GetMaxIntConstraintValue, GetCurrentFloatConstraintValue, GetMaxFloatConstraintValueFunctions (pure)Raw capacity reads, one number each. GetMax* includes the ExpandRoot bag bonus.
GetConstraintCapacity(Tag, OutView), GetConstraintFraction(Tag)Functions (pure)One tag's whole gauge. GetConstraintCapacity returns false and zeroes OutView when the tag is in none of the four containers. GetConstraintFraction is Current / Max, unclamped, 0 when there is no cap.
ModifyIntConstraintValue(Tag, Delta), ModifyFloatConstraintValue(Tag, Delta)Functions (server)Move the current counter, not the cap. Announce immediately.
SetIntConstraintMax(Tag, NewMax)Function (server)Replace an int cap; 0 removes it. Layouts derive their capacity from the caps, so the layout runtime rebuilds and the change is announced. There is no float equivalent: float caps come from InitializeInventory and the ExpandRoot bag bonus.
GetSaveData, ApplySaveDataFunctionsApplySaveData is server-only.
GetInventoryDebugStrings, GetCurrencyAmountString, DebugPrintAllConstraints, DebugPrintConstraintFunctionsDebug.
FCrimsonInventoryEntryStructGetEntryId, GetSlotIndex, GetRotation, GetLayoutGroupId, IsLocked, HasLockFlag, GetItemInstance, GetStackCount, GetPlacementTarget.
FCrimsonInventoryListStructFastArray of entries.
ECrimsonInventoryLockFlagsEnumUser, Equipped.
UCrimsonAsyncAction_ObserveInventoryConstraintClass (Blueprint async node)Async/CrimsonAsyncAction_ObserveInventoryConstraint.h. The node Observe Inventory Constraint (Inventory, Constraint Tag): its OnConstraintChanged pin (bHasConstraint, Capacity) fires once immediately with the current value and then on every change of that tag. bHasConstraint is false, with the view zeroed apart from its Tag, while the inventory does not track the tag yet.

Layouts and placement

TypeKindNotes
UCrimsonInventoryLayoutAbstract data assetFindPlacement, CanAcceptAt, TryResolveMove, GetCapacityHint, GetItemFootprint, SupportsRotation, SupportsStacking, RebuildOccupancy (C++).
UCrimsonInventoryLayout_FlatSlotData assetMaxSlotsTag.
UCrimsonInventoryLayout_GridData assetGridWidthTag, GridHeightTag, bAllowRotation.
UCrimsonInventoryLayout_WeightData assetOrdered list; weight cap via a float-tag constraint.
FCrimsonPlacementTargetStructSlotIndex, GridPosition, Rotation, LayoutGroupId.
FCrimsonPlacementQueryStructItemDef, RequestedStackCount, Policy, Hint, LayoutGroupId, bAllowSpillToOtherGroups, IgnoreEntryId (an entry whose current cells do not count as occupied - the entry being moved, so a UI preview lets its footprint overlap its own old position; the move resolver already ignores the moved entry).
FCrimsonPlacementResultStructbSuccess, FailureReason, Target, QuantityPlaced, QuantityRemaining, bMergedIntoExisting, MergedTargetEntryId.
FCrimsonMoveQuery, FCrimsonMoveResultStructsECrimsonMoveAction: Move, Swap, Merge; SwappedEntryId.
FCrimsonPlacementContextStructComponent, LayoutGroupId, Layout; GetIntCapacity, GetFloatCapacity, GetGroupState.
FCrimsonItemFootprintStructDimensions, Weight, SlotCost, bAllowRotation.
ECrimsonItemRotation, ECrimsonPlacementPolicyEnumsRotation steps; MergeFirst, FirstFree, LastFree, MergeOnly, ExplicitTarget.
FCrimsonLayoutGroupInfoStructGroupId, ParentGroupId, OwnerEntryId, Layout, Depth, bActive, CapacityHint, DisplayName.
FCrimsonLayoutRuntimeState, FCrimsonLayoutGroupRuntimeStateStructs (transient)EntryIdToTarget, Groups, GroupStates; per-group SlotIndexToEntryId, GridOccupancy, GridSize.
FCrimsonInventorySubtree, FCrimsonInventorySubtreeNodeStructsBag-with-contents payload.

Constraints

TypeNotes
UCrimsonInventoryConstraintConstraintTag, DisplayName; CanAcceptItem, CanAcceptAt, CalculateMaxAllowedQuantity, OnItemAdded, OnItemRemoved, OnStateRestored.
UCrimsonInventoryConstraint_SlotMaxSlotsTag, FailureMessage.
UCrimsonInventoryConstraint_IntTagTrackedTag, ValueContributedPerItem, FailureMessage.
UCrimsonInventoryConstraint_FloatTagTrackedTag, ValueContributedPerItem, bReadFromFootprintFragment, bAllowOverflow, FailureMessage. With bAllowOverflow the rule never vetoes an add and never clamps a requested quantity - it only counts, so the cap becomes a soft threshold an observer reacts to.
UCrimsonInventoryConstraint_GridCellRuleRules of FCrimsonGridCellRule (Min, Max, RequiredTags, BlockedTags, FailureMessage).
UCrimsonInventoryConstraint_StackLimitItemTagFilter, MaxTotalQuantity, FailureMessage.
UCrimsonInventoryConstraint_TypeFilterRequiredTags, BlockedTags, FailureMessage.
FCrimsonConstraintDefinitionTable row: ConstraintTag, DisplayName, ConstraintClass.
FCrimsonConstraintCheckResultbPassed, FailureReason, MaxAllowedQuantity; Success(), Failure(Reason).

Items

TypeNotes
UCrimsonInventoryItemDefinitionDisplayName, ItemType, Fragments, StateFragments; FindFragmentByClass, FindStateFragmentByClass, GetPrimaryAssetId; PrimaryAssetType = CrimsonInventoryItemDefinition.
UCrimsonInventoryItemFragmentBase; OnInstanceCreated.
UCrimsonInventoryItemFragment_DatabUnique, bStackable, MaxStackSize.
UCrimsonInventoryItemFragment_VisualsItemIcon, SlotWidgetClass, PickupActorClass, PickupMesh.
UCrimsonInventoryItemFragment_TooltipTooltipWidgetClass, Description, RarityColor.
UCrimsonInventoryItemFragment_FootprintDimensions, Weight, SlotCost, bAllowRotation; ToFootprint().
UCrimsonInventoryItemFragment_EquippableEquipmentDefinition, PreferredSlotTag; ResolveDefinitionClass.
UCrimsonInventoryItemFragment_ConsumableMakes an item usable. UseEventTag, EffectsToApply (each effect plus the SetByCaller magnitudes this item feeds it), Application (Instant / Over Time), DurationSeconds and DurationSetByCallerTag (Over Time only), ConsumeCount, CooldownTag, CooldownSeconds, CooldownEffect. Adding it makes the item answer ICrimsonUsableObject, so one ability you grant once serves every consumable in the game. See How-To: Make an Item Usable.
UCrimsonInventoryItemFragment_BagLayout, IntCapacities, FloatCapacities, Constraints, bAllowNestedBags, MaxNestingDepth, Mode, GroupDisplayName.
UCrimsonInventoryItemFragment_GrantCurrencyCurrencyType, AmountPerItem.
UCrimsonInventoryItemFragment_ContextActionsActions.
UCrimsonInventoryItemFragment_ConstraintConstraintsToCheck.
UCrimsonInventoryStateFragmentInitializeFromDefinition, TickState, OnStateRestored, ResumeStateLogic.
UCrimsonInventoryStateFragment_DurabilityMaxDurability, CurrentDurability; ApplyDurabilityChange, GetDurabilityPercentage, IsBroken, GetCurrentDurability, GetMaxDurability.
UCrimsonInventoryStateFragment_LifetimeTotalLifetime, TimeRemaining.
UCrimsonInventoryItemInstanceGetItemDef, GetItemType, GetItemName, GetStackItemCount, GetOwningManager (the manager whose entry list holds the instance; on a client a replicated instance keeps the outer it was first replicated under, so after a store-to-player transfer the outer is stale and the entry list's replication stamp answers instead), IsStackableWith, FindFragmentByClass, FindStateFragmentByClass; stat tag API (AddStatTagStack, GetStatTagStackCount, HasStatTag, float variants); CreateFromDefinition, CloneInstance (C++). CanPlayerAccess, static GetInstanceClass(). Implements ICrimsonUsableObject, answered entirely from the definition's Consumable fragment.
UCrimsonInventoryItemSetItems map of name -> definition.
UCrimsonInventoryItemTypeActionSet (CrimsonCore)TypeActions (FCrimsonInventoryItemTypeActions: ItemType, Actions); GetActionsForType.
UCrimsonInventoryContextAction_UseThe Use entry and the double-click default for a consumable. Shown only for items with a Consumable fragment, and only from the player's own bag. Sends the item's use event on the server rather than acting directly, so a menu click and an action bar press take one path.
UCrimsonInventoryContextAction_Equip, _Unequip (CrimsonCore)Moved to CrimsonCore with the equipment integration.
UCrimsonInventoryQuantityContextActionAbstract base for verbs acting on PART of a stack. GetQuantityPrompt (reports the selectable range to the host UI - it shows no UI itself), ComputeDefaultAmount, ResolveQuantity (re-clamps the payload server-side); DefaultAmountMode (Minimum / Half / Maximum), bPromptForQuantity.
UCrimsonInventoryContextAction_DropDrops an entry into the world through DropItemByEntry. Destructive section, hidden on equipped / vendor / loot / container targets, Disabled with a reason when the entry is locked; DropDistance.
UCrimsonInventoryContextAction_BuyBuys from vendor stock. Enabled when at least one unit is affordable and fits; the amount is bounded by stock, bag room and purse. QuantityPerPurchase seeds the prompt rather than fixing the amount.
FCrimsonInventoryQuantityPayloadQuantity. Built client-side by the quantity prompt and re-clamped in ExecuteAction - never trusted as sent.
UCrimsonInventoryFunctionLibraryFindItemDefinitionFragment, GetItemDefinitionFromSet, GetAllItemDefinitionsFromSet, GetMaxStackSize. (GetContextActionsForItem moved to CrimsonCore's UCrimsonInventoryContextActionStatics.)

Routing and containers

TypeNotes
UCrimsonInventoryRoutingComponentMoveItem, TransferItem, TransferItemTo, SplitStack, SortInventory, DropItem, LockEntry, OpenContainer, CloseContainer, TakePickupSlot, TakePickupAll; CanAccessInventory, CanOpenContainer (defaults to the container's CanPlayerOpen), ResolvePartyKey, ResolveMapInstanceKey (native events); CloseSessionFor (server); GetOrCreatePersonalContainer, FindPersonalContainer (C++); GetSaveData, ApplySaveData; OnContainerOpened, OnContainerClosed.
ECrimsonContainerScopeShared, PerPlayer, PerParty, PerMapInstance.
FCrimsonContainerInstanceKeyContainerTag, ScopeKey.
FCrimsonContainerOpenResultbSuccess, FailureReason, Inventory, InstanceKey.
ACrimsonContainerActorBaseContainerTag, Scope, DefaultLayout, DefaultIntConstraints, DefaultFloatConstraints, RuntimeConstraints; GetInventoryComponent, ApplyInventoryDefaults, EnsureConstraintOfClass, NotifyContainerOpened (native event, server), CanPlayerOpen (native event: access policy + reason; default allows any valid player), CloseAllSessions, CloseUnauthorizedSessions (server), OnScopedInstanceCreated. (CrimsonCore's ACrimsonInteractableContainerActor adds ICrimsonInteractableTarget, OpenContainerUIAbility, OpenConditions, InteractionText.)
ACrimsonInstancedInventoryActorGetInventoryComponent, GetInstanceKey; viewer-gated relevancy.
UCrimsonInventoryInstanceSubsystemWorld subsystem (C++): GetOrCreateInstance, FindInstance, RemoveViewer, RemoveViewerFromAll, DestroyInstance, GetAllInstanceKeys.

Pickups

TypeNotes
ACrimsonPickupActorBasePickupInventory (replicated), BagMeshOverride, PickupMeshComponent; InitializeAsDroppedItem, InitializeAsDroppedRow, IsMultiItem, GetTotalSlotCount, IsEmpty, TakeSlot, TakeAll; GetPickupSaveData, ApplyPickupSaveData; OnPickupInitialized, OnPickupContentsChanged.
ICrimsonPickupableGetCrimsonPickupInventory, SetCrimsonPickupInventory.
FCrimsonInventoryPickupInstances, Templates, Currencies.
FCrimsonPickupInstanceItem, StackCount, Contents (subtree nodes).
FCrimsonPickupTemplate, FCrimsonCurrencyPickupTemplateDefinition + count; currency row + amount.
FCrimsonPickupTakeResultbAllTaken, QuantityTaken, QuantityRemaining, FailureReason.
ECrimsonPickupSlotTypeInstance, Template, Currency.
UCrimsonPickupableStaticsGetFirstCrimsonPickupableFromActor, SetCrimsonPickupInventoryOnActor, BreakPickupInventory, MergePickupInventories.
FCrimsonInventoryPickupSaveDataSerializable snapshot of a pickup (CrimsonInventoryPickupSaveData.h): Rows, Templates, Currencies; IsEmpty. Item instances are flattened into FCrimsonInventorySaveEntry records, because a saved POINTER to a runtime subobject resolves to nothing on load.
FCrimsonPickupSaveRow, FCrimsonPickupSaveNodeOne item row (Root + Contents) and one nested bag item (Entry + ParentNodeIndex).

Currency

TypeNotes
FCrimsonCurrencyDefinitionTable row: CurrencyType, CurrencyTag, DisplayName, Icon, bUserFacing.
UCrimsonInventoryCurrencyAbstract handler: Initialize, GetAmount, GetAmountString, AddAmount, RemoveAmount, SetAmount; TypeTag, Name.
UCrimsonBasicCurrencyAmount (replicated), MaxAmount.
FCrimsonInventoryCurrencyViewTag, Name, Amount, Currency.

Sorting and filtering

TypeNotes
FCrimsonInventorySortRequestbMergeAfterSort, Rules.
FCrimsonInventorySortRuleSortTag, bAscending, CustomSorter.
UCrimsonInventorySorterbAscendingOrder; Compare(A, B) over FCrimsonInventorySortSnapshot.
UCrimsonInventorySorter_Name, _ItemType, _StackSize, _CompositeBuilt-ins; composite chains ChainedSorters.
UCrimsonInventoryFilterPassesFilter(Instance).
UCrimsonInventoryFilter_ItemType, _HasTag, _Name, _CompositeBuilt-ins; composite uses ChainedFilters with ECrimsonCompositeFilterLogic AND / OR.

Statics, settings, save

TypeNotes
UCrimsonInventoryStaticsFindInventoryManager, FindRoutingComponent, GiveItemToActor, GiveTransactionToActor, RequestPickup, GetAllItemDefinitionIds, LoadItemDefinitionById, GetAllItemDefinitionsInEditor.
UCrimsonInventorySettingsItemDefinitionScanPaths, CurrencyDefinitionTables, ConstraintDefinitionTable, SorterMappings, MaxContainerInteractionDistance, ItemInstanceClass, bVerboseLogging. Category Crimson.
FCrimsonInventorySaveDataLayoutAsset, NextEntryId, Items, ActiveConstraints, ConstraintMaxTags, ConstraintMaxFloatTags, CurrencyAmounts. Only the caps are saved; the current counters are recounted from the restored entries.
FCrimsonInventorySaveEntryPer-entry record including LockFlags, EquippedSlotTag, EquippedSlotIndex, StateFragments.
FCrimsonInventoryObjectSaveRecordObjectClass, Bytes.
FCrimsonInventoryRoutingSaveData, FCrimsonRoutingPersonalContainerSavePersonal containers by tag.
FCrimsonInventoryEntryView, FCrimsonInventoryCapacityViewUI snapshots. FCrimsonInventoryCapacityView: Tag, Current, Max, bIsFloat, Fraction (Current / Max, unclamped - 1.25 is 25% over the cap, 0 when Max <= 0; clamp it yourself for a progress bar).

Messages and tags

Tag (defined in CrimsonInventoryTags.cpp)Payload / use
Crimson.Inventory.Message.StackChangedFCrimsonInventoryChangeMessage. Broadcast per entry on BOTH sides: remote clients get it from the FastArray callbacks, the authority from its own catch-up sweep in FinalizeServerMutation, so a listen-server host and a standalone game receive it too. bIsRestoreOrInitialSync marks a save restore or the first replicated batch - UI that toasts acquisitions must skip those.
Crimson.Inventory.Message.InventoryUpdatedFCrimsonInventory_Message_InventoryUpdated.
Crimson.Inventory.Message.LayoutGroupsChangedFCrimsonInventory_Message_LayoutGroupsChanged.
Crimson.Inventory.Message.ConstraintChangedFCrimsonInventory_Message_ConstraintChanged (InventoryComponent, Capacity, PreviousCurrent, PreviousMax). One broadcast per changed tag on the server and the owning client - every viewer for an unowned container. Compare PreviousMax with Capacity.Max to tell a cap change from a counter change.
Crimson.Inventory.Message.ConstraintFailureMessageFCrimsonInventoryConstraintFailureMessage.
Crimson.Inventory.Message.CurrencyChangedFCrimsonInventoryCurrencyChangeMessage.
Crimson.Inventory.Message.OperationResultFCrimsonInventoryOperationResult (ECrimsonInventoryOperation).
Crimson.Inventory.Message.ItemDroppedFCrimsonInventory_Message_ItemDropped.
Crimson.Inventory.Message.CurrencyDroppedFCrimsonInventory_Message_CurrencyDropped.
Crimson.Inventory.Constraint.Slots, .GridWidth, .GridHeight, .Weight, .UniqueItemsDefault capacity tags read by layouts and constraints.
Crimson.Inventory.Sort.ByName, .ByStackSize, .ByItemTypePre-registered sort tags in SorterMappings.

Editor module

ItemNotes
Inventory Dev Tools windowTools -> Crimson Inventory -> Inventory Dev Tools or Crimson.Inventory.DevTools. Tabs: Items, Layout, Groups, Equipment, Currency, Containers, Routing, Messages, Save, Cheats.
Content Browser entriesAdd -> Crimson Plugins -> Inventory submenus: Layouts, Constraints, Fragments, Currency.

CrimsonCore (for orientation only)

CrimsonCore is free to download, but compiles only with all Crimson plugins installed. It ships the turnkey inventory screen, slot widgets, drag and drop, context menu, and a showcase map on top of this plugin. See CrimsonCore -> Inventory UI. Nothing in this plugin depends on it.

System readiness

Announced by the Add Inventory Game Feature action as ModularGameplay feature states. Wait on them rather than polling for the component: UGameFrameworkComponentManager::RegisterAndCallForActorInitState(Actor, CrimsonInventory::SystemReadyFeatureName, FGameplayTag(), Delegate, true); the implementer is the manager (or the routing component for the routing feature).

Tag constantTagAnnounced when
CrimsonInventory::SystemReadyFeatureNameCrimson.SystemReady.InventoryAnnounced once the inventory manager is added AND initialized - layout assigned, constraints and currencies registered.
CrimsonInventory::RoutingSystemReadyFeatureNameCrimson.SystemReady.InventoryRoutingAnnounced once the routing component is added and registered.