Add a New Apply-Item-on-Equipment Feature¶
Overview¶
UMIPApplyItemOnEquipmentComponent is the base for all equipment-manipulation features (Enhancement, Reforge, Repair, Seal, etc.). It extends UMIPBasePlayerLevelBasedFeatureComponent and implements IMIPInteractableComponentInterface, so a new feature gets level-gating, save/load, and NPC-interaction support out of the box — you only supply the domain logic.
All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
Key Classes & Files¶
| Class / Asset | File / Location |
|---|---|
UMIPApplyItemOnEquipmentComponent |
Public/PlayerLevelBasedFeatures/MIPApplyItemOnEquipmentComponent.h |
UMIPBasePlayerLevelBasedFeatureComponent |
Public/BaseComponents/Player/LevelFeature/MIPBasePlayerLevelBasedFeatureComponent.h |
UMIPBaseSaveableComponent |
Public/BaseComponents/AutoSave/MIPBaseSaveableComponent.h |
UMIPLevelBasedFeaturesDefAsset |
Public/DataAsset/MIPLevelBasedFeaturesDefAsset.h |
FMIPPlayerLevelBasedFeatureStruct |
Public/PlayerLevelBasedFeatures/MIPPlayerLevelBasedFeatureStruct.h |
DA_LevelBasedFeatureDefs |
Content Browser — UMIPLevelBasedFeaturesDefAsset instance assigned on the Player Controller |
Step 1: Create a Blueprint Child Class¶
In the Content Browser, create a new Blueprint class derived from UMIPApplyItemOnEquipmentComponent.
Suggested naming convention:
Place it alongside the other feature Blueprints (e.g. /ModularInventoryPlus/Features/LevelBased/).
Step 2: Set RequiredTags¶
RequiredTags (inherited from UMIPBasePlayerLevelBasedFeatureComponent) defines which gameplay tags must be present on the player before this feature becomes usable. The manager grants these tags when the player reaches the configured level.
Open the new Blueprint → Class Defaults → Level Based Feature category:
| Property | Example value |
|---|---|
RequiredTags |
Player.LevelBasedFeature.Seal |
BlockedTags |
(leave empty unless you need a condition that disables the feature) |
The tag in RequiredTags must match the tag you put in GivenTags in Step 4 — the manager grants it when the player hits the target level, which then unlocks the feature.
Step 3: Configure Save Data (Optional)¶
If the component stores player progress (e.g. selected item index, session state), configure the two save properties inherited from UMIPBaseSaveableComponent.
Open the Blueprint → Class Defaults → Saveable Component category:
| Property | What to set |
|---|---|
UniqueSaveIdentifier |
A unique tag from the SaveIdentifier.* category. Create a new tag if one does not exist yet (e.g. SaveIdentifier.Seal). No two components may share the same identifier. |
AccessibilityTag |
Save.Accessibility.Character — saved per-character (default). Use Save.Accessibility.Family only if the data should be shared across characters on the same account. |
Warning
UniqueSaveIdentifier must be globally unique across all saveable components. Reusing an identifier causes data to be read/written from the wrong component.
Step 4: Register in the Level-Based Features Asset¶
Open DA_LevelBasedFeatureDefs in the Content Browser (this is the UMIPLevelBasedFeaturesDefAsset instance assigned to LevelBasedFeaturesDefAsset on the UMIPBasePlayerLevelBasedFeaturesManager component of the Player Controller).
In the LevelBasedFeatureTagDefinitions map, add a new entry:
| Field | Value |
|---|---|
| Key (player level) | 20 (or whichever level should unlock this feature) |
LevelBasedFeatures → add array element |
— |
GivenTags |
Player.LevelBasedFeature.Seal |
GivenComponents |
BP_SealComponent (select your new Blueprint) |
Flow — what happens at runtime:
Player reaches level 20
│
▼
UMIPBasePlayerLevelBasedFeaturesManager::AddLevelBasedFeature()
│
├─► Appends GivenTags → Player now has Player.LevelBasedFeature.Seal
│
└─► SpawnLevelBasedFeatureComponents()
│
▼
BP_SealComponent spawned and added to the Player Controller
│
▼
Component's RequiredTags check passes → Feature is usable
Info
Each level key holds an array (LevelBasedFeatures) so you can grant multiple independent features at the same level by adding more array elements.
Step 5: Wire up NPC Interaction¶
UMIPApplyItemOnEquipmentComponent already implements IMIPInteractableComponentInterface. You still need to create the listener Blueprint and definition assets, then assign them to the component.
5a. Create an Interaction Definition Asset¶
Create a MIPInteractionInstanceDefinitionAsset and configure:
| Field | Example value |
|---|---|
DisplayName |
Seal |
ItemIcon |
(your icon texture) |
InteractionTag |
Interaction.Seal (unique tag for this feature) |
5b. Create an Interaction Listener Blueprint¶
Create a Blueprint derived from MIPInteractionListenerObject and configure InteractionAndTempTagMap:
| Key | Value |
|---|---|
Interaction.Seal |
Player.TempState.Seal (new unique temp-state tag) |
5c. Assign the Listener to the Component¶
Open BP_SealComponent → Class Defaults → set InteractionListenerObjectClass to the listener Blueprint created above.
5d. Add to the Interaction Instances Definition Asset¶
Open (or create) your MIPInteractionInstancesDefinitionAsset and add the definition asset from Step 5a to its list.
5e. Configure Widget Visibility¶
In the widget manager settings, add an entry to InteractionTagAndWidgetTags:
| Key | Value |
|---|---|
Interaction.Seal |
Widget tags to show (e.g. Widget.Toggleable.Seal, Widget.Toggleable.Inventory) |
Full interaction guide
For detailed screenshots and explanations of each interaction step, see Create a New NPC Interactable Component.
Existing Feature Blueprints (Reference)¶
The built-in features follow the same pattern:
| C++ Class | Feature | RequiredTags example |
|---|---|---|
UMIPEquipmentEnhancementComponent |
Enhancement | Player.LevelBasedFeature.Enhancement |
UMIPEquipmentReforgeComponent |
Reforge | Player.LevelBasedFeature.Reforge |
UMIPEquipmentRepairComponent |
Repair | Player.LevelBasedFeature.Repair |
UMIPEquipmentStatSealComponent |
Seal | Player.LevelBasedFeature.Seal |
Use these as references when implementing OnUseItem, PreEnhanceCheckForErrors, and CheckIfValidMaterial in your Blueprint.