Custom K2Nodes

Overview

The module provides custom K2Nodes that appear in the Blueprint graph editor under Cdryx|Quest|CCreateQuest. These nodes replace standard function calls with a richer interface supporting dynamic pin addition and removal for quest steps.

All nodes inherit from UCAbstractCreateQuest, which extends UK2Node and implements IK2Node_AddPinInterface. During compilation, the node expands into intermediate nodes (UK2Node_CallFunction, UK2Node_MakeMap, UK2Node_MakeStruct) that call the corresponding UCQuestBPLibrary functions.

Classes

Name Description
UCAbstractCreateQuest Abstract base class for quest creation nodes. Handles dynamic pin management, context menu actions, and node expansion.
UCCreateActorQuest Concrete node for creating actor-triggered quests. Calls createActorQuest_customNodeOnly and uses FCNTriggerByActorStruct.
UCCreateRoomQuest Concrete node for creating room-triggered quests. Calls createRoomQuest_customNodeOnly and uses FCNTriggerByRoomStruct.

UCAbstractCreateQuest

Base class providing the core logic shared by all quest creation nodes.

Input Pins

Pin Type Description
InputExec exec Execution input
QuestId FName Unique identifier for the quest
QuestCondition delegate (FCBP_questCondition) Delegate evaluated to determine if the quest can proceed
QuestStepId N FName Identifier for quest step N (dynamic, one per step)
TriggeredByMainTag N FName Tag identifying the trigger source for step N (dynamic)
QuestStepAction N delegate Action delegate executed when step N triggers (dynamic)

Output Pins

Pin Type Description
OutputExec exec Execution output

Key Functions

Name Description
AllocateDefaultPins Creates the initial set of pins (exec, QuestId, QuestCondition, one step group, output exec).
AddInputPin Adds a new quest step group (QuestStepId, TriggeredByMainTag, QuestStepAction).
removeInputPin Removes a quest step group via context menu and re-indexes remaining groups.
ExpandNode Compiles the node into intermediate nodes: spawns a UK2Node_CallFunction, a UK2Node_MakeMap, and one UK2Node_MakeStruct per step.
GetNodeContextMenuActions Adds a “Remove quest” context menu entry for each step pin group.
// AllocateDefaultPins creates the base pin layout:
// - InputExec (exec input)
// - QuestId (FName input)
// - QuestCondition (delegate input)
// - QuestStepId 0, TriggeredByMainTag 0, QuestStepAction 0 (first step group)
// - OutputExec (exec output)
virtual void AllocateDefaultPins() override;

// AddInputPin appends a new step group (QuestStepId N, TriggeredByMainTag N, QuestStepAction N)
// Called via the "Add pin" button on the node (IK2Node_AddPinInterface)
virtual void AddInputPin() override;

// removeInputPin removes the step group containing the given pin
// and re-indexes all subsequent step groups
// Triggered from the node context menu
void removeInputPin(UEdGraphPin* pin);

// ExpandNode compiles the custom node into intermediate nodes:
// 1. UK2Node_CallFunction targeting UCQuestBPLibrary::<functionName>
// 2. UK2Node_MakeMap for the step map (FName -> struct)
// 3. UK2Node_MakeStruct per step (triggeredBy + action properties)
virtual void ExpandNode(FKismetCompilerContext& context, UEdGraph* graph) override;

UCCreateActorQuest

Quest creation node for actor-based triggers. Appears with a green title bar and magenta body in the Blueprint graph.

  • Category: Cdryx|Quest|CCreateQuest
  • Calls: UCQuestBPLibrary::createActorQuest_customNodeOnly
  • Struct type: FCNTriggerByActorStruct (contains triggeredBy_properties FName + action_properties FCBP_questStepActorAction)
  • Step action delegate: FCBP_questStepActorAction

UCCreateRoomQuest

Quest creation node for room-based triggers. Appears with a blue title bar and yellow body in the Blueprint graph.

  • Category: Cdryx|Quest|CCreateQuest
  • Calls: UCQuestBPLibrary::createRoomQuest_customNodeOnly
  • Struct type: FCNTriggerByRoomStruct (contains triggeredBy_properties FName + action_properties FCBP_questStepRoomAction)
  • Step action delegate: FCBP_questStepRoomAction