Skip to content

World Level Component

Overview

UMIPWorldLevelComponent holds the world level (replicated) and broadcasts when it changes. It supports deferred execution via IMIPWithPendingFunctionsInterface (e.g. wait for first player login before using level). World level is used for mob scaling, difficulty, or other world-wide scaling. It listens to the first player login and can initialize level from that player's level (OnPlayerLevelPostLoaded) or from server data.

Key traits:

  • Attachment: Typically GameState or GameMode (authority).
  • Replication: WorldLevel (ReplicatedUsing=OnRep_WorldLevel).
  • API: SetWorldLevel(InWorldLevel), IncrementWorldLevel(), GetWorldLevel(); WaitForFirstPlayerLogin().
  • Delegate: OnWorldLevelChangedDelegate(int32).

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


Key Classes & Files

Class File
UMIPWorldLevelComponent Public/WorldLevel/MIPWorldLevelComponent.h

UMIPWorldLevelComponent

  • Base: UActorComponent; implements IMIPWithPendingFunctionsInterface.
  • Flow: BeginPlay → WaitForFirstPlayerLogin; OnFirstPlayerLoggedIn → get player level component, OnPlayerLevelPostLoaded sets world level (or from async); SetWorldLevel/IncrementWorldLevel trigger OnWorldLevelChangedDelegate and OnRep_WorldLevel (replication). Uses UMIPWaitForMIPPCValidBPAsync to get valid MIP PC.
  • Integration: UMIPWorldLevelScaledMobInfoComponent subscribes to OnWorldLevelChanged to rescale mob combat info.