Skip to content

Quest Component

Overview

UMIPBaseQuestComponent is the main quest manager: it is saveable, loads/saves quest instances from JSON, and handles accept/complete/claim rewards. It communicates with a server quest manager, broadcasts quest/task/NPC nameplate updates, and integrates with NPC interaction, item use, mob elimination, and map tasks.

Key traits:

  • Save/Load: Implements saveable; LoadThisUObjectFromJsonObject; ClientLoadQuests RPC to sync quest list to client.
  • Flow: Accept quest (ServerAcceptQuest), complete/claim (ServerClaimQuestRewards, ClientClaimQuestRewards), grant rewards (items, EXP). NPC nameplate status type can change (delegate).
  • Tasks: Quest tasks (chat with NPC, go to map, use item, eliminate mob, etc.) are updated and broadcast via FOnQuestTaskUpdated.

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


Key Classes & Files

Class File
UMIPBaseQuestComponent Public/Quest/MIPBaseQuestComponent.h

UMIPBaseQuestComponent

  • Base: UMIPBaseSaveableComponent.
  • Attachment: PlayerController or Pawn (where saveable player data lives).
  • Delegates: OnQuestUpdated(QuestInstance, QuestList), OnPreQuestRewardsClaimed(QuestInstance), OnQuestListUpdated(QuestList), OnQuestTaskUpdated(QuestInstance, Task, TaskIndex), OnNPCNameplateStatusTypeChanged(NPCTag, Type).
  • Accept: AcceptQuest(InNPCTag, InQuestChoiceIndex)ServerAcceptQuest.
  • Claim: ClaimQuestRewards(InNPCTag)ServerClaimQuestRewardsClaimedQuestRewardsInternal, GrantQuestRewards, GrantQuestEXPRewards. CheckClaimQuestRewards, CountRewardSlots, CheckIfCountRewardSlot.
  • Load: LoadQuestInternal, ClientLoadQuests / ClientLoadQuestsInternal.
  • Override: OnLoggingOut, OnPostLoaded, LoadThisUObjectFromJsonObject.

Integration

  • UMIPNPCInteractionManager / UMIPNPCsManager – accept/complete flows and NPC nameplate status.
  • UMIPPlayerServerIMC – grant item rewards.
  • UMIPClientWidgetsManagerComponent – quest UI.
  • Server: UMIPServerQuestManager for authoritative quest state.