API Reference
Every public type in the CrimsonInventory runtime module, plus the editor module's tools. Types from other modules are labeled.
Manager
| Member | Kind | Notes |
|---|---|---|
UCrimsonInventoryManagerComponent | Class | Implements ICrimsonItemHost. Events OnStackChanged, OnInventoryUpdated, OnLayoutGroupsChanged, OnConstraintFailure, OnConstraintChanged, OnItemDropped, OnCurrencyDropped, OnCurrencyChanged, OnItemHostChanged (each with a ...Native twin). |
LayoutAsset | Property (replicated) | The root layout. |
ActiveConstraints | Property (replicated, instanced) | Rule objects. |
RegisteredCurrencyDataTables, RegisteredConstraintsDataTables | Properties (replicated) | Per-inventory tables. |
bEquippedItemsOccupyLayout | Property | Park equipped entries (false) or leave them in place (true). |
OnInventoryInitialized | Delegate | After InitializeInventory. |
OnConstraintValueChanged | Delegate | FOnCrimsonInventoryConstraintValueChanged(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) | Function | Seed caps only. |
GetLayout, SetLayout | Functions | SetLayout is server-only. |
GetLayoutGroups, FindLayoutGroup, IsEntryInSubtree, IsNonEmptyBag | Functions (pure) | Group queries. |
ExtractSubtree, AddSubtree | Functions (server) | Bag-aware move primitives. |
CanAddItemDefinition, HasRoomFor, CalculateAddableQuantity, PreviewPlacement | Functions | PreviewPlacement works on clients. |
AddItemDefinition, AddItemInstance, RemoveItemsByDefinition, RemoveItemInstance | Functions (server) | Add / remove. |
MoveItemByEntry, TransferEntryTo, SplitStackByEntry, MergeStacksByEntry, SetEntryLockFlag | Functions (server) | Entry operations by id. |
DropItemByEntry, DropItemsByDefinition, DropEntriesAsBag, DropCurrency | Functions (server) | World drops. |
FindEntryIdForInstance, SetEntryEquipped, GetEntryEquippedSlot, GetPendingEquips, ClearPendingEquip, HasPendingEquips | Functions | Equipment bridge. |
GetAllItems, FindFirstItemStackByDefinition, GetFilteredItems, PartitionItemsByFilter, GetTotalItemCountByInstance, GetTotalItemCountByDefinition | Functions | Item queries. |
GetEntryView, GetEntryViews, GetCapacityViews, GetCurrencyViews | Functions (pure) | UI snapshots. |
GetSlottedEntries, FindEntryByEntryId, FindEntryAtTarget | Functions (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, FindCurrencyDefinitionByName | Functions | Currency. Mutators are server-only. |
AddConstraint, RemoveConstraint, GetActiveConstraints, GetConstraintsByTag | Functions | Constraint 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, GetMaxFloatConstraintValue | Functions (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, ApplySaveData | Functions | ApplySaveData is server-only. |
GetInventoryDebugStrings, GetCurrencyAmountString, DebugPrintAllConstraints, DebugPrintConstraint | Functions | Debug. |
FCrimsonInventoryEntry | Struct | GetEntryId, GetSlotIndex, GetRotation, GetLayoutGroupId, IsLocked, HasLockFlag, GetItemInstance, GetStackCount, GetPlacementTarget. |
FCrimsonInventoryList | Struct | FastArray of entries. |
ECrimsonInventoryLockFlags | Enum | User, Equipped. |
UCrimsonAsyncAction_ObserveInventoryConstraint | Class (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
| Type | Kind | Notes |
|---|---|---|
UCrimsonInventoryLayout | Abstract data asset | FindPlacement, CanAcceptAt, TryResolveMove, GetCapacityHint, GetItemFootprint, SupportsRotation, SupportsStacking, RebuildOccupancy (C++). |
UCrimsonInventoryLayout_FlatSlot | Data asset | MaxSlotsTag. |
UCrimsonInventoryLayout_Grid | Data asset | GridWidthTag, GridHeightTag, bAllowRotation. |
UCrimsonInventoryLayout_Weight | Data asset | Ordered list; weight cap via a float-tag constraint. |
FCrimsonPlacementTarget | Struct | SlotIndex, GridPosition, Rotation, LayoutGroupId. |
FCrimsonPlacementQuery | Struct | ItemDef, 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). |
FCrimsonPlacementResult | Struct | bSuccess, FailureReason, Target, QuantityPlaced, QuantityRemaining, bMergedIntoExisting, MergedTargetEntryId. |
FCrimsonMoveQuery, FCrimsonMoveResult | Structs | ECrimsonMoveAction: Move, Swap, Merge; SwappedEntryId. |
FCrimsonPlacementContext | Struct | Component, LayoutGroupId, Layout; GetIntCapacity, GetFloatCapacity, GetGroupState. |
FCrimsonItemFootprint | Struct | Dimensions, Weight, SlotCost, bAllowRotation. |
ECrimsonItemRotation, ECrimsonPlacementPolicy | Enums | Rotation steps; MergeFirst, FirstFree, LastFree, MergeOnly, ExplicitTarget. |
FCrimsonLayoutGroupInfo | Struct | GroupId, ParentGroupId, OwnerEntryId, Layout, Depth, bActive, CapacityHint, DisplayName. |
FCrimsonLayoutRuntimeState, FCrimsonLayoutGroupRuntimeState | Structs (transient) | EntryIdToTarget, Groups, GroupStates; per-group SlotIndexToEntryId, GridOccupancy, GridSize. |
FCrimsonInventorySubtree, FCrimsonInventorySubtreeNode | Structs | Bag-with-contents payload. |
Constraints
| Type | Notes |
|---|---|
UCrimsonInventoryConstraint | ConstraintTag, DisplayName; CanAcceptItem, CanAcceptAt, CalculateMaxAllowedQuantity, OnItemAdded, OnItemRemoved, OnStateRestored. |
UCrimsonInventoryConstraint_Slot | MaxSlotsTag, FailureMessage. |
UCrimsonInventoryConstraint_IntTag | TrackedTag, ValueContributedPerItem, FailureMessage. |
UCrimsonInventoryConstraint_FloatTag | TrackedTag, 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_GridCellRule | Rules of FCrimsonGridCellRule (Min, Max, RequiredTags, BlockedTags, FailureMessage). |
UCrimsonInventoryConstraint_StackLimit | ItemTagFilter, MaxTotalQuantity, FailureMessage. |
UCrimsonInventoryConstraint_TypeFilter | RequiredTags, BlockedTags, FailureMessage. |
FCrimsonConstraintDefinition | Table row: ConstraintTag, DisplayName, ConstraintClass. |
FCrimsonConstraintCheckResult | bPassed, FailureReason, MaxAllowedQuantity; Success(), Failure(Reason). |
Items
| Type | Notes |
|---|---|
UCrimsonInventoryItemDefinition | DisplayName, ItemType, Fragments, StateFragments; FindFragmentByClass, FindStateFragmentByClass, GetPrimaryAssetId; PrimaryAssetType = CrimsonInventoryItemDefinition. |
UCrimsonInventoryItemFragment | Base; OnInstanceCreated. |
UCrimsonInventoryItemFragment_Data | bUnique, bStackable, MaxStackSize. |
UCrimsonInventoryItemFragment_Visuals | ItemIcon, SlotWidgetClass, PickupActorClass, PickupMesh. |
UCrimsonInventoryItemFragment_Tooltip | TooltipWidgetClass, Description, RarityColor. |
UCrimsonInventoryItemFragment_Footprint | Dimensions, Weight, SlotCost, bAllowRotation; ToFootprint(). |
UCrimsonInventoryItemFragment_Equippable | EquipmentDefinition, PreferredSlotTag; ResolveDefinitionClass. |
UCrimsonInventoryItemFragment_Consumable | Makes 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_Bag | Layout, IntCapacities, FloatCapacities, Constraints, bAllowNestedBags, MaxNestingDepth, Mode, GroupDisplayName. |
UCrimsonInventoryItemFragment_GrantCurrency | CurrencyType, AmountPerItem. |
UCrimsonInventoryItemFragment_ContextActions | Actions. |
UCrimsonInventoryItemFragment_Constraint | ConstraintsToCheck. |
UCrimsonInventoryStateFragment | InitializeFromDefinition, TickState, OnStateRestored, ResumeStateLogic. |
UCrimsonInventoryStateFragment_Durability | MaxDurability, CurrentDurability; ApplyDurabilityChange, GetDurabilityPercentage, IsBroken, GetCurrentDurability, GetMaxDurability. |
UCrimsonInventoryStateFragment_Lifetime | TotalLifetime, TimeRemaining. |
UCrimsonInventoryItemInstance | GetItemDef, 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. |
UCrimsonInventoryItemSet | Items map of name -> definition. |
UCrimsonInventoryItemTypeActionSet (CrimsonCore) | TypeActions (FCrimsonInventoryItemTypeActions: ItemType, Actions); GetActionsForType. |
UCrimsonInventoryContextAction_Use | The 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. |
UCrimsonInventoryQuantityContextAction | Abstract 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_Drop | Drops 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_Buy | Buys 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. |
FCrimsonInventoryQuantityPayload | Quantity. Built client-side by the quantity prompt and re-clamped in ExecuteAction - never trusted as sent. |
UCrimsonInventoryFunctionLibrary | FindItemDefinitionFragment, GetItemDefinitionFromSet, GetAllItemDefinitionsFromSet, GetMaxStackSize. (GetContextActionsForItem moved to CrimsonCore's UCrimsonInventoryContextActionStatics.) |
Routing and containers
| Type | Notes |
|---|---|
UCrimsonInventoryRoutingComponent | MoveItem, 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. |
ECrimsonContainerScope | Shared, PerPlayer, PerParty, PerMapInstance. |
FCrimsonContainerInstanceKey | ContainerTag, ScopeKey. |
FCrimsonContainerOpenResult | bSuccess, FailureReason, Inventory, InstanceKey. |
ACrimsonContainerActorBase | ContainerTag, 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.) |
ACrimsonInstancedInventoryActor | GetInventoryComponent, GetInstanceKey; viewer-gated relevancy. |
UCrimsonInventoryInstanceSubsystem | World subsystem (C++): GetOrCreateInstance, FindInstance, RemoveViewer, RemoveViewerFromAll, DestroyInstance, GetAllInstanceKeys. |
Pickups
| Type | Notes |
|---|---|
ACrimsonPickupActorBase | PickupInventory (replicated), BagMeshOverride, PickupMeshComponent; InitializeAsDroppedItem, InitializeAsDroppedRow, IsMultiItem, GetTotalSlotCount, IsEmpty, TakeSlot, TakeAll; GetPickupSaveData, ApplyPickupSaveData; OnPickupInitialized, OnPickupContentsChanged. |
ICrimsonPickupable | GetCrimsonPickupInventory, SetCrimsonPickupInventory. |
FCrimsonInventoryPickup | Instances, Templates, Currencies. |
FCrimsonPickupInstance | Item, StackCount, Contents (subtree nodes). |
FCrimsonPickupTemplate, FCrimsonCurrencyPickupTemplate | Definition + count; currency row + amount. |
FCrimsonPickupTakeResult | bAllTaken, QuantityTaken, QuantityRemaining, FailureReason. |
ECrimsonPickupSlotType | Instance, Template, Currency. |
UCrimsonPickupableStatics | GetFirstCrimsonPickupableFromActor, SetCrimsonPickupInventoryOnActor, BreakPickupInventory, MergePickupInventories. |
FCrimsonInventoryPickupSaveData | Serializable 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, FCrimsonPickupSaveNode | One item row (Root + Contents) and one nested bag item (Entry + ParentNodeIndex). |
Currency
| Type | Notes |
|---|---|
FCrimsonCurrencyDefinition | Table row: CurrencyType, CurrencyTag, DisplayName, Icon, bUserFacing. |
UCrimsonInventoryCurrency | Abstract handler: Initialize, GetAmount, GetAmountString, AddAmount, RemoveAmount, SetAmount; TypeTag, Name. |
UCrimsonBasicCurrency | Amount (replicated), MaxAmount. |
FCrimsonInventoryCurrencyView | Tag, Name, Amount, Currency. |
Sorting and filtering
| Type | Notes |
|---|---|
FCrimsonInventorySortRequest | bMergeAfterSort, Rules. |
FCrimsonInventorySortRule | SortTag, bAscending, CustomSorter. |
UCrimsonInventorySorter | bAscendingOrder; Compare(A, B) over FCrimsonInventorySortSnapshot. |
UCrimsonInventorySorter_Name, _ItemType, _StackSize, _Composite | Built-ins; composite chains ChainedSorters. |
UCrimsonInventoryFilter | PassesFilter(Instance). |
UCrimsonInventoryFilter_ItemType, _HasTag, _Name, _Composite | Built-ins; composite uses ChainedFilters with ECrimsonCompositeFilterLogic AND / OR. |
Statics, settings, save
| Type | Notes |
|---|---|
UCrimsonInventoryStatics | FindInventoryManager, FindRoutingComponent, GiveItemToActor, GiveTransactionToActor, RequestPickup, GetAllItemDefinitionIds, LoadItemDefinitionById, GetAllItemDefinitionsInEditor. |
UCrimsonInventorySettings | ItemDefinitionScanPaths, CurrencyDefinitionTables, ConstraintDefinitionTable, SorterMappings, MaxContainerInteractionDistance, ItemInstanceClass, bVerboseLogging. Category Crimson. |
FCrimsonInventorySaveData | LayoutAsset, NextEntryId, Items, ActiveConstraints, ConstraintMaxTags, ConstraintMaxFloatTags, CurrencyAmounts. Only the caps are saved; the current counters are recounted from the restored entries. |
FCrimsonInventorySaveEntry | Per-entry record including LockFlags, EquippedSlotTag, EquippedSlotIndex, StateFragments. |
FCrimsonInventoryObjectSaveRecord | ObjectClass, Bytes. |
FCrimsonInventoryRoutingSaveData, FCrimsonRoutingPersonalContainerSave | Personal containers by tag. |
FCrimsonInventoryEntryView, FCrimsonInventoryCapacityView | UI 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.StackChanged | FCrimsonInventoryChangeMessage. 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.InventoryUpdated | FCrimsonInventory_Message_InventoryUpdated. |
Crimson.Inventory.Message.LayoutGroupsChanged | FCrimsonInventory_Message_LayoutGroupsChanged. |
Crimson.Inventory.Message.ConstraintChanged | FCrimsonInventory_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.ConstraintFailureMessage | FCrimsonInventoryConstraintFailureMessage. |
Crimson.Inventory.Message.CurrencyChanged | FCrimsonInventoryCurrencyChangeMessage. |
Crimson.Inventory.Message.OperationResult | FCrimsonInventoryOperationResult (ECrimsonInventoryOperation). |
Crimson.Inventory.Message.ItemDropped | FCrimsonInventory_Message_ItemDropped. |
Crimson.Inventory.Message.CurrencyDropped | FCrimsonInventory_Message_CurrencyDropped. |
Crimson.Inventory.Constraint.Slots, .GridWidth, .GridHeight, .Weight, .UniqueItems | Default capacity tags read by layouts and constraints. |
Crimson.Inventory.Sort.ByName, .ByStackSize, .ByItemType | Pre-registered sort tags in SorterMappings. |
Editor module
| Item | Notes |
|---|---|
| Inventory Dev Tools window | Tools -> Crimson Inventory -> Inventory Dev Tools or Crimson.Inventory.DevTools. Tabs: Items, Layout, Groups, Equipment, Currency, Containers, Routing, Messages, Save, Cheats. |
| Content Browser entries | Add -> 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 constant | Tag | Announced when |
|---|---|---|
CrimsonInventory::SystemReadyFeatureName | Crimson.SystemReady.Inventory | Announced once the inventory manager is added AND initialized - layout assigned, constraints and currencies registered. |
CrimsonInventory::RoutingSystemReadyFeatureName | Crimson.SystemReady.InventoryRouting | Announced once the routing component is added and registered. |