CQUESTUMODULE

Overview

The CQUESTUMODULE is a quest management system that handles quest creation, step progression, and conditional activation. Quests are composed of ordered steps, each triggered by interactions with actors or rooms. The system supports condition-based activation, multi-step branching, and both actor-based and room-based triggers.

Depends on CCOREUMODULE.

Functionalities Overview
Data Quest data structures (UCQuestStep, FCQuestStruct, CQuestStatus, CQuestInnerStatus) and custom node structs (FCNTriggerByActorStruct, FCNTriggerByRoomStruct)
Manager UCQuestManager subsystem that creates, activates, and processes quests. QuestUtility static helper for global quest action dispatch
Blueprint Blueprint-callable functions for quest status checks, step activation/deactivation, quest creation, and reset (UCQuestBPLibrary, UCQuestManager)

Architecture

The quest execution pipeline works as follows:

  1. Quests are defined as FCQuestStruct containing a condition delegate and an ordered map of UCQuestStep objects.
  2. UCQuestManager is a UGameInstanceSubsystem registered as a singleton via CNAME_Singleton_QuestManager.
  3. When createQuest is called, the manager stores the quest map, assigns quest/step IDs, and sets the first step as the current active step.
  4. On each quest action (actor overlap, room enter/leave), activateAnyQuest checks unactivated quests against their condition delegate. If the condition returns true, the quest becomes ACTIVATED.
  5. For activated quests, the manager iterates current steps and fires the matching delegate (stepActorAction or stepRoomAction) when the step’s thingToInteractWith matches the initiator (or is * for any source).
  6. QuestUtility provides a global entry point via ICQuestMaker singleton lookup, so any system can trigger quest actions without direct manager access.