Skip to content

Player Level-Based Features

Overview

UMIPBasePlayerLevelBasedFeaturesManager grants level-based feature tags (and spawns feature components) when the player levels up, using UMIPLevelBasedFeaturesDefAsset and optional default levels. UMIPApplyItemOnEquipmentComponent is the base for features that apply items to equipment (enhance, repair, reforge): it implements IMIPCurrencyFeeInterface and IMIPInteractableComponentInterface, uses item selection and action progress bar, and runs ServerDoThisFeature/DoThisFeature. Concrete implementations: UMIPEquipmentEnhancementComponent, UMIPEquipmentRepairComponent, UMIPEquipmentAttributeReforgeComponent.

Key traits:

  • Manager: Replicated LevelBasedFeatureTags; OnPlayerLevelUp adds tags and spawns components from LevelBasedFeaturesDefAsset; DefaultLevelsToGrantFeatures for initial grant.
  • Apply item on equipment: Fee check, OnUseItem (material/item consumption), interaction open/close, SetApplyItemIndex; FOnApplied delegate (bSuccess, ItemInstance, AdditionalData).

All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.


Key Classes & Files

Class File
UMIPBasePlayerLevelBasedFeaturesManager Public/PlayerLevelBasedFeatures/MIPBasePlayerLevelBasedFeaturesManager.h
UMIPApplyItemOnEquipmentComponent Public/PlayerLevelBasedFeatures/MIPApplyItemOnEquipmentComponent.h

UMIPBasePlayerLevelBasedFeaturesManager

  • Base: UMIPBasePlayerControllerComponent.
  • API: GetLevelBasedFeatureTags().
  • Properties: LevelBasedFeaturesDefAsset, LevelBasedFeatureTags (ReplicatedUsing), LevelBasedFeatureTagDefinitions (level → feature array), DefaultLevelsToGrantFeatures.
  • Flow: BeginPlay → GrantDefaultLevelFeatures; OnPlayerLevelUp → AddLevelBasedFeatures, SpawnLevelBasedFeatureComponents. OnRep_LevelBasedFeatureTags for client sync.

UMIPApplyItemOnEquipmentComponent

  • Base: UMIPBasePlayerLevelBasedFeatureComponent; implements IMIPCurrencyFeeInterface, IMIPInteractableComponentInterface.
  • API: GetFeeInfo_Implementation, HasEnoughForFee_Implementation; OnUseItem, SetApplyItemIndex (BlueprintNativeEvent); CheckIfValidMaterial, PreCheckForErrorsForCurrentItem (overrides in subclasses).
  • Delegate: FOnApplied(bSuccess, InItemInstance, InAdditionalData).
  • Interaction: OnInteractionTag, OnInteractedClient/Server, OnEndInteractionTag, OnEndInteractedClient/Server – open/close widget and bind closing behavior.
  • Integration: UMIPPlayerServerIMC (item index, equipment), UMIPCurrencyComponent (fee), UMIPItemSelectionComponent (select item), UMIPClientWidgetsManagerComponent (widget).