UMIPEquipmentPieceAsset¶
Overview¶
UMIPEquipmentPieceAsset is the data asset that defines everything about a single piece of equipment: which slot it occupies, what stats it grants, how those stats are applied via Gameplay Effects, what it looks like on the character, and which crafting operations (reforge, recalibrate, seal, transmute) are available for it.
It inherits from UMIPBaseItemPieceAsset → UMIPBaseDataAsset and is referenced at design time by UItemPiece_EquipmentDefinition (the static item piece that lives on the item definition). At runtime, the inventory manager reads this asset to generate rolled stats (UItemPiece_DynamicEquipmentItemStats) and the equipment system reads it to build and apply the UMIPEquipmentGE.
Definition-only asset
This asset is definition data only — it is never modified at runtime. Per-instance state (rolled stat values, sealed stats, enhancement level) lives on dynamic item pieces attached to the UMIPItemInstance.
Key Classes & Files¶
All paths are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
| Class / Struct | File |
|---|---|
UMIPEquipmentPieceAsset |
Public/Inventory/DataAsset/MIPEquipmentPieceAsset.h |
UMIPBaseItemPieceAsset |
Public/Inventory/DataAsset/MIPBaseItemPieceAsset.h |
FStaticItemAttributeDefinition |
Public/Inventory/Structs/EquipmentData.h |
FItemAttributeDefinition |
Public/Inventory/Structs/EquipmentData.h |
FRandomizedItemAttributePool |
Public/Inventory/Structs/EquipmentData.h |
FWeightedItemAttributeDefinition |
Public/Inventory/Structs/EquipmentData.h |
UMIPEquipmentGE |
Public/AbilitySystem/GameplayEffects/MIPEquipmentGE.h |
UMIPEquipmentReforgeAsset |
Public/Inventory/DataAsset/MIPEquipmentReforgeAsset.h |
UMIPEquipmentRecalibrateAsset |
Public/Inventory/DataAsset/MIPEquipmentRecalibrateAsset.h |
UMIPEquipmentSealAsset |
Public/Inventory/DataAsset/MIPEquipmentSealAsset.h |
UMIPEquipmentTransmuteAsset |
Public/Inventory/DataAsset/MIPEquipmentTransmuteAsset.h |
| Implementation | Private/Inventory/DataAsset/MIPEquipmentPieceAsset.cpp |
Properties¶
Core¶
| Property | Type | Description |
|---|---|---|
EquipmentLevel |
int32 |
Item level of the equipment (default 1). Used for level-gating and display. |
SlotTag |
FGameplayTag |
Equipment slot this piece occupies (tag category EquipmentSlot, e.g. EquipmentSlot.Chest). Only one item may occupy a slot at a time. |
GameplayEffect |
TSubclassOf<UMIPEquipmentGE> |
The Gameplay Effect blueprint class applied while this item is equipped. Its modifiers are auto-generated from the stat definitions below; magnitudes are injected via SetByCaller at application time. See UMIPEquipmentGE. |
Stat Definitions¶
Equipment stats come in three flavours, each stored in a separate array on the asset:
| Property | Type | Description |
|---|---|---|
StaticItemAttributeDefinitions |
TArray<FStaticItemAttributeDefinition> |
Fixed stats. Every drop of this item always has these exact values. |
DynamicItemAttributeDefinitions |
TArray<FItemAttributeDefinition> |
Range stats. Each stat rolls a random value between Min and Max when the item instance is created. |
RandomizedDynamicItemAttributePools |
TArray<FRandomizedItemAttributePool> |
Pool stats. Each pool randomly selects one stat from its weighted list when the item is created, then rolls its value within the min/max range. |
FStaticItemAttributeDefinition¶
A guaranteed, constant stat. The value is the same for every instance of this equipment.
FGameplayTag AttributeTag; // e.g. Attribute.Combat.Armor
float AttributeEffect; // e.g. 25.0
TEnumAsByte<EGameplayModOp::Type> ModifierOp; // Additive | Multiplicitive | Division
FItemAttributeDefinition¶
A stat with a randomisable range. The actual value is rolled once at item creation and stored on UItemPiece_DynamicEquipmentItemStats.
FGameplayTag AttributeTag;
float MinAttributeEffect; // e.g. 5.0
float MaxAttributeEffect; // e.g. 15.0
TEnumAsByte<EGameplayModOp::Type> ModifierOp;
FRandomizedItemAttributePool¶
A weighted pool of FItemAttributeDefinition entries. Exactly one entry is selected per pool, based on weight, using SelectByWeight(float InRandom01).
struct FWeightedItemAttributeDefinition
{
FItemAttributeDefinition AttributeDefinition;
float Weight; // relative probability (≥ 0)
};
struct FRandomizedItemAttributePool
{
TArray<FWeightedItemAttributeDefinition> WeightedDefinitions;
};
Stat layering example
A Legendary Chest Armor might have:
- Static: +50 Armor (every drop)
- Dynamic: +5–15 Strength, +3–10 Vitality (rolled per drop)
- Pool 1: either +2–6% Crit Chance (weight 3) or +4–10% Crit Damage (weight 1)
- Pool 2: either +1–3 Lifesteal (weight 1) or +5–12 Thorns (weight 1)
This gives every instance the same Armor, a random spread of Strength / Vitality, and two "wildcard" stats drawn from weighted pools.
Crafting Operations¶
Each crafting operation is gated by an optional sub-asset. When the sub-asset reference is null, that operation is disabled for this equipment piece.
| Property | Type | Description |
|---|---|---|
ReforgeAsset |
UMIPEquipmentReforgeAsset* |
Reforge — re-rolls all dynamic stats. Defines required material items and currency fee. |
RecalibrateAsset |
UMIPEquipmentRecalibrateAsset* |
Recalibrate — re-rolls a single dynamic stat. Defines required material items and currency fee. |
SealAsset |
UMIPEquipmentSealAsset* |
Seal / Unseal — locks or unlocks a single stat so it is preserved during reforge. Defines required materials and fees for both operations. |
TransmuteAsset |
UMIPEquipmentTransmuteAsset* |
Transmute — re-selects a pool stat (draws again from the same FRandomizedItemAttributePool). Defines required materials and currency fee. |
Sub-asset structure¶
All four sub-assets follow the same pattern — a list of required material items and an optional currency fee:
UMIPEquipmentReforgeAsset
├── TArray<FMIPExchangeRequiredItem> ReforgeRequiredItems
└── FMIPCurrencyFeeStruct ReforgeFee
UMIPEquipmentRecalibrateAsset
├── TArray<FMIPExchangeRequiredItem> RecalibrateRequiredItems
└── FMIPCurrencyFeeStruct RecalibrateFee
UMIPEquipmentSealAsset
├── TArray<FMIPExchangeRequiredItem> SealRequiredItems
├── FMIPCurrencyFeeStruct SealFee
├── TArray<FMIPExchangeRequiredItem> UnsealRequiredItems
└── FMIPCurrencyFeeStruct UnsealFee
UMIPEquipmentTransmuteAsset
├── TArray<FMIPExchangeRequiredItem> TransmuteRequiredItems
└── FMIPCurrencyFeeStruct TransmuteFee
Currency vs disabling operations
Leave the currency fee struct zeroed (default) to charge no currency — do not set the sub-asset to null unless you want to disable the entire operation.
Visual / Mesh¶
| Property | Type | Description |
|---|---|---|
SKMesh |
USkeletalMesh* |
Skeletal mesh displayed on the character when the item is equipped. Managed by UMIPBaseEquipmentMeshesManager. |
AttachToSocketName |
FName |
Socket on the character skeleton where SKMesh is attached. |
RelativeMeshTransform |
FTransform |
Offset transform applied to the mesh relative to the socket (default: identity position, no rotation, scale 1). |
Sound¶
| Property | Type | Description |
|---|---|---|
EquipUnequipSoundOverride |
USoundBase* |
Per-item override for the equip/unequip sound. If null, falls back to the global sound in UMIPSoundSettings. |
The accessor GetEquipUnequipSound() (BlueprintCallable) returns the override if set, otherwise loads the default from UMIPSoundSettings::Get().EquipUnequipSound.
How Stats Flow at Runtime¶
UMIPEquipmentPieceAsset (designer data)
│
├── StaticItemAttributeDefinitions ──────── fixed values, used directly
│
├── DynamicItemAttributeDefinitions ─────── rolled at item creation
│ stored on UItemPiece_DynamicEquipmentItemStats
│
├── RandomizedDynamicItemAttributePools ──► one stat selected per pool
│ rolled and stored alongside dynamic stats
│
└── GameplayEffect (UMIPEquipmentGE class)
│
▼
GenerateModifiers() (editor-time)
Creates SetByCaller modifiers for every attribute
│
▼
ApplyEquipmentAttributes() (runtime, server)
Injects actual stat values via SetSetByCallerMagnitude()
Applies the Infinite GE to the player's ASC
│
▼
Attribute modifiers are active while equipped
Removed via RemoveActiveGameplayEffect() on unequip
Editor hooks (#if WITH_EDITOR / WITH_EDITORONLY_DATA)¶
PostEditChangeProperty¶
When any property on the asset changes, if GameplayEffect is set, the code calls GameplayEffect->GetDefaultObject<UMIPEquipmentGE>()->GenerateModifiers() so the CDO of the UMIPEquipmentGE blueprint stays aligned with stat arrays (SetByCaller modifier names and counts).
IsDataValid¶
| Severity | Condition | Message |
|---|---|---|
| Error | SlotTag invalid |
SlotTag is not set — equipment has no slot assigned. |
| Error | GameplayEffect null |
GameplayEffect is not set — equipment will apply no stat modifiers. |
| Error | EquipmentLevel <= 0 |
EquipmentLevel must be >= 1. Got: %d (formatted with current level) |
Implementation: Private/Inventory/DataAsset/MIPEquipmentPieceAsset.cpp (#if WITH_EDITOR).
Integration¶
| Topic | Link |
|---|---|
| How equipment GE modifiers are generated and applied | UMIPEquipmentGE |
| Equipment attribute and mesh components | Equipment Components |
| Item pieces and item instance architecture | Item Pieces and Instance |
Item piece hierarchy and UItemPiece_EquipmentDefinition |
UMIPItemPiece |
| Reforge component | Reforge |
| Data assets index | Data Assets |