Player Level Components¶
Overview¶
The level system provides experience and level (base component) and player-level-specific behavior: UMIPPlayerLevelComponent adds attribute points (allocate/confirm/reset) and UMIPAbilityPointsLevelComponent adds ability-point spending, learn/unlearn, and level-up checks. All are saveable and replicate where needed.
Key traits:
- UMIPBaseLevelComponent – Exp/level (replicated), ServerGiveEXP, delegates for level-up and exp change; uses
UMIPBasePlayerExperienceCalculationfor exp-to-level curve. - UMIPPlayerLevelComponent – Attribute points: client allocate/confirm, server apply; reset single or all; delegates for points changed and client allocation.
- UMIPAbilityPointsLevelComponent – Ability points; learn/confirm/reset; implements
IMIPInteractableComponentInterfacefor interaction-driven UI; level-up ability checks with requirements.
All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.
Key Classes & Files¶
| Class | File |
|---|---|
UMIPBaseLevelComponent |
Public/PlayerLevel/MIPBaseLevelComponent.h |
UMIPPlayerLevelComponent |
Public/PlayerLevel/MIPPlayerLevelComponent.h |
UMIPAbilityPointsLevelComponent |
Public/PlayerLevel/MIPAbilityPointsLevelComponent.h |
UMIPBaseLevelComponent¶
- Base: UMIPBaseSaveableComponent.
- Properties:
Level(ReplicatedUsing, SaveGame),ExpCurrent,ExpMax,ExpTotal(SaveGame),PlayerExperienceCalculationClass. - API:
GetExpMax(),GetExpCurrent(),GetExpNormalized(),GetLevel(). Server:ServerGiveEXP(InGivenEXP),GiveEXP(InGivenEXP). - Delegates:
OnLevelUpDelegate(two int params),OnPlayerExpChangedDelegate,OnPlayerExpMaxChangedDelegate. - Override:
OnLoaded_Implementation,OnVersionChanged_Implementation; BlueprintNativeEventOnLevelUp(). Exp calculation viaGetPlayerExperienceCalculationObject().
UMIPPlayerLevelComponent¶
- Base: UMIPBaseLevelComponent.
- Attribute allocation:
AllocateAttributePointsClient(InTag, InDelta, bAdd)(client-side pending),ConfirmAllocateAttributePoints()→ServerAllocateAttributePoints(InTags, InPoints);CancelAllocatedAttributePoints(). Internal:AllocateAttributePointsInternal(..., bInLoaded),ClientOnAllocatedAttributePoints(RPC). Reset:ResetAllAllocatedAttributes(),ResetAllocatedAttribute(InAttributeTag). - Helpers:
GetAttributePoints(),GetMaxAllocatableAttributePoints,GetCurrentAllocatingAttributePoints,GetCurrentAllocatedAttributePoints; apply/load/save logic for allocated attributes. - Delegates:
OnAttributePointsChangedDelegate(two int params),OnClientAllocatedAttributePointsDelegate.
UMIPAbilityPointsLevelComponent¶
- Base: UMIPBaseLevelComponent; implements
IMIPInteractableComponentInterface,ISaveableLoadableObjectInterface(OnPostLoaded). - API:
UnlearnAllAbilities(),ResetTempLearning(),BeginLearning(),TryLevelUpAbility(...),LevelDownAbility(...),ConfirmLearningAbilities().CheckCanLevelUpAbilityWithErrorTexts(...)for UI validation. - Delegates:
OnAbilityPointsChangedDelegate,OnAbilityLevelUpDelegate. - Interaction:
OnInteractedClient_Implementation,OnEndInteractedClient_Implementation– used for NPC or UI that opens ability-learning flow.
Integration¶
- Level and exp are used for level gates (equipment, abilities, features). Attribute points are applied to the ability system (e.g. attribute set) after confirm.
- Ability points and learn/unlearn integrate with UMIPAbilitySystemComponent / gameplay abilities; requirements (player level, ability points, tags) are checked in
TryLevelUpAbilityandCheckCanLevelUpAbilityWithErrorTexts.