Skip to content

Server Components

Overview

Server-side components attach to the GameMode (or authority actor) and handle item pickup spawning and mob scaling by world level. UMIPItemPickupSpawnerComponent spawns pickups (e.g. loot drops) around an actor and rolls loot from definitions. UMIPBaseScalableMobInfoComponent and UMIPWorldLevelScaledMobInfoComponent provide scaled mob combat info (stats, etc.) based on world level for use by mobs and difficulty.

Key traits:

  • UMIPItemPickupSpawnerComponent – GameMode component; SpawnPickupAroundActor(InLastHitBy, InSpawnerActor, PickupSpawnParams); RollLoots for loot table roll.
  • UMIPBaseScalableMobInfoComponent – GameMode component; SetMobCombatScalingFactor; FindScaledMobCombatInfo(InMob); holds FMIPMobCombatScalingFactor.
  • UMIPWorldLevelScaledMobInfoComponent – Extends base; scales mob info by world level; OnWorldLevelChanged; TMap of scaled mob combat info objects.

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


Key Classes & Files

Class File
UMIPItemPickupSpawnerComponent Public/ServerComponents/MIPItemPickupSpawnerComponent.h
UMIPBaseScalableMobInfoComponent Public/ServerComponents/MobScaledInfo/MIPBaseScalableMobInfoComponent.h
UMIPWorldLevelScaledMobInfoComponent Public/ServerComponents/MobScaledInfo/MIPWorldLevelScaledMobInfoComponent.h

UMIPItemPickupSpawnerComponent

  • Base: UMIPBaseGameModeComponent.
  • Struct: FMIPSpawnPickupAroundPlayerParams – PickupActorClass, MinDistanceAwayFromPlayer, MaxDistanceAwayFromPlayer, LootDefinitions.
  • API: SpawnPickupAroundActor(InLastHitBy, InSpawnerActor, PickupSpawnParams) – spawns pickup in range and rolls loot; RollLoots(InLootDefinitions, InOwner, RolledItemLoots) (virtual).

UMIPBaseScalableMobInfoComponent

  • Base: UMIPBaseGameModeComponent.
  • API: SetMobCombatScalingFactor() (virtual), GetMobCombatScalingFactor(), FindScaledMobCombatInfo(InMob) (virtual, returns UMIPWorldLevelScaledMobInfoObject*).
  • Properties: MobCombatScalingFactor (EditAnywhere).

UMIPWorldLevelScaledMobInfoComponent

  • Base: UMIPBaseScalableMobInfoComponent.
  • Override: SetMobCombatScalingFactor (uses world level); FindScaledMobCombatInfo (lookup in ScaledMobCombatInfoMap). OnWorldLevelChanged rebuilds or updates map. ScaleMobCombatInfo, CalculateModifiedBaseValue for scaling math.
  • Properties: ScaledMobCombatInfoMap (FString → UMIPWorldLevelScaledMobInfoObject*), WorldLevel.

Integration

  • UMIPMobHealthComponent / AMIPBaseMob – can query FindScaledMobCombatInfo for scaled stats (e.g. health, damage).
  • UMIPWorldLevelComponent – world level source; UMIPWorldLevelScaledMobInfoComponent subscribes to OnWorldLevelChanged.
  • Loot drops (e.g. on mob death) call SpawnPickupAroundActor with appropriate params and loot definitions.