Item Definitions & Fragments
UCrimsonInventoryItemDefinition is a Const, Abstract, Blueprintable UObject data asset. It holds Fragments (definition-level data) and StateFragments (per-instance mutable state templates).
UCLASS(Blueprintable, Const, Abstract)class UCrimsonInventoryItemDefinition : public UObject{UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Display)FText DisplayName;UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = State, Instanced)TArray<TObjectPtr<UCrimsonInventoryItemFragment>> Fragments;UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = State, Instanced)TArray<TObjectPtr<UCrimsonInventoryStateFragment>> StateFragments;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Item, meta = (AssetRegistrySearchable))FGameplayTag ItemType;};
Built-in item fragments
| Class | Display Name | Key properties |
|---|---|---|
UCrimsonInventoryItemFragment_Data | Inventory Data | bUnique, bStackable, MaxStackSize |
UCrimsonInventoryItemFragment_Footprint | Inventory Footprint | Dimensions (FIntPoint, for grid), Weight (float, for weight constraint), SlotCost (int, for multi-slot flat items), bAllowRotation |
UCrimsonInventoryItemFragment_Visuals | Item Visuals | ItemIcon, SlotWidgetClass, PickupActorClass, PickupMesh |
UCrimsonInventoryItemFragment_Constraint | Inventory Constraints | ConstraintsToCheck - instanced constraints evaluated alongside the component stack |
UCrimsonInventoryItemFragment_GrantCurrency | Grant Currency | Currency type and amount granted on pickup (item is consumed) |
UCLASS(Blueprintable, DisplayName = "Inventory Footprint")class UCrimsonInventoryItemFragment_Footprint : public UCrimsonInventoryItemFragment{/** W x H in cells (grid layouts). */UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (ClampMin = "1"))FIntPoint Dimensions = FIntPoint(1, 1);/** Mass / encumbrance per single unit (weight layouts + float-tag weight constraint). */UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (ClampMin = "0.0"))float Weight = 0.f;/** Slots this item consumes per stack in a flat-slot layout. */UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (ClampMin = "1"))int32 SlotCost = 1;/** Whether grid layouts may rotate this item to fit. */UPROPERTY(EditAnywhere, BlueprintReadOnly)bool bAllowRotation = false;};
Sensible defaults
Items without a Footprint fragment behave as 1x1, weight 0, 1-slot. You only need the fragment when an item is genuinely larger, heavier, or non-default.
State fragments (per-instance replicated mutable state)
| Class | Purpose | Key API |
|---|---|---|
UCrimsonInventoryStateFragment_Durability | Tracks current/max durability for equipment | ApplyDurabilityChange(float), GetDurabilityPercentage(), IsBroken() |
UCrimsonInventoryStateFragment_Lifetime | Tracks elapsed time for time-limited items | Timer-driven countdown; override in BP to implement expiry |