UMIPUsablePieceAsset¶
Overview¶
UMIPUsablePieceAsset defines consumable / usable behavior for items that have a usable static piece. It extends UMIPBaseItemPieceAsset and configures: precheck class for whether use is allowed, actors to spawn on the player when equipped, a gameplay effect (FMIPGameplayEffectWithCallerMagnitudes) to apply on use, optional quest line tags to grant, cooldown (tag + duration, optional offline time), UI property text (static lines vs effect-driven), and an optional consume sound override.
At runtime, inventory / use pipelines read this asset to apply effects, play audio, and enforce cooldowns.
All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
Key Classes & Files¶
| Class | File |
|---|---|
UMIPUsablePieceAsset |
Public/Inventory/DataAsset/MIPUsablePieceAsset.h |
IsDataValid |
Private/Inventory/DataAsset/MIPUsablePieceAsset.cpp |
Properties¶
| Property | Type | Description |
|---|---|---|
PreCheckObjectClass |
TSubclassOf<UMIPItemUsagePreCheckObject> |
Optional pre-use validation. |
ActorsToSpawn |
TArray<TSubclassOf<AMIPItemEffectActor>> |
Spawned on pawn when item is equipped. |
EffectToApply |
FMIPGameplayEffectWithCallerMagnitudes |
GE applied on use (class + caller magnitudes). |
QuestLinesToGive |
FGameplayTagContainer |
Quest lines granted on use. |
bUseStaticPropertyTexts |
bool |
If true, tooltip uses PropertyTexts instead of effect-derived text. |
PropertyTexts |
TArray<FText> |
Static lines when bUseStaticPropertyTexts is true. |
CooldownTag |
FGameplayTag |
Tag under ItemCooldown category for cooldown tracking. |
CooldownDuration |
float |
Seconds cooldown duration. |
bCountOfflineTimeForCooldown |
bool |
Whether cooldown ticks while offline. |
ConsumeSoundOverride |
USoundBase* |
Optional; else UMIPSoundSettings::ConsumeItemSound. |
GetConsumeSound() returns override or settings default.
Editor validation¶
| Severity | Condition | Message |
|---|---|---|
| Error | EffectToApply.GameplayEffect is null, ActorsToSpawn is empty, and QuestLinesToGive is empty |
Usable piece has no effect: EffectToApply, ActorsToSpawn, and QuestLinesToGive are all empty. |
| Error | CooldownDuration < 0 |
CooldownDuration must be >= 0. Got: %.2f |
Implementation: Private/Inventory/DataAsset/MIPUsablePieceAsset.cpp (#if WITH_EDITOR).
Integration¶
| Topic | Link |
|---|---|
| Inventory / consume flow | Inventory |
| Sound | Sound |
| Data assets index | Data assets index |