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:
- Quests are defined as
FCQuestStructcontaining a condition delegate and an ordered map ofUCQuestStepobjects. UCQuestManageris aUGameInstanceSubsystemregistered as a singleton viaCNAME_Singleton_QuestManager.- When
createQuestis called, the manager stores the quest map, assigns quest/step IDs, and sets the first step as the current active step. - On each quest action (actor overlap, room enter/leave),
activateAnyQuestchecks unactivated quests against their condition delegate. If the condition returns true, the quest becomesACTIVATED. - For activated quests, the manager iterates current steps and fires the matching delegate (
stepActorActionorstepRoomAction) when the step’sthingToInteractWithmatches the initiator (or is*for any source). QuestUtilityprovides a global entry point viaICQuestMakersingleton lookup, so any system can trigger quest actions without direct manager access.