How to Add a Quest NPC

This guide explains how to create an NPC that can give quests to the player using the BP_RPG_AI_Quest base class.


Prerequisites

Before you start, make sure that:

  • The quest system is configured (BP_QuestComponent on the player, DT_Quests populated with quest data).
  • The quests you want this NPC to offer already exist in DT_Quests.
  • For each quest you want to assign, the QuestEngineData.ByNPC field in DT_Quests is set to true.

Step 1 – Create the Quest NPC Blueprint

  1. In the Content Browser, locate the BP_RPG_AI_Quest Blueprint.
  2. Right‑click on BP_RPG_AI_Quest and choose Create Child Blueprint Class.
  3. Name the new blueprint (e.g., BP_NPC_Quest_Trader, BP_NPC_Quest_Guard).
  4. Open the new child blueprint.

Step 2 – Configure the NPC Skin

  1. In the Components panel, select the BP_CharacterSkinComponent.
  2. In the Details panel, find the Start Character Skin parameter.
  3. Assign the desired character skin DataAsset (e.g., DA_CS_Guard_01, DA_CS_Villager_Female). This determines the NPC’s appearance in the world.
  4. Compile and save the blueprint.

Step 3 – Place the NPC in the Level

  1. Drag your new quest NPC blueprint from the Content Browser into the level.
  2. Position and rotate the NPC where you want them to stand.
  3. With the placed actor selected, open the Details panel to configure quest‑specific settings.

Step 4 – Configure Quests in BP_QuestComponentNPC

  1. In the Details panel of the placed NPC actor, locate the BP_QuestComponentNPC component.
  2. Expand it to see its parameters.

4.1. Add Quests

  1. Find the Quests parameter (array of DataTableRowHandle).
  2. Click the + button to add a new element.
  3. For each element:
    • Set the Row Name to the RowName of the quest in DT_Quests that this NPC should offer.

Important: Only quests with QuestEngineData.ByNPC = true in DT_Quests will work correctly. Quests with ByNPC = false are intended for the journal UI and may not function properly when given by an NPC.

4.2. Configure MovePlayerToSpeakerPosition

  1. Find the MovePlayerToSpeakerPosition parameter (bool).
  2. Set it to:
    • true – During dialogue, the player will:
      • Lose control of movement.
      • Be automatically moved to the location of the SpeakerPosition component on this NPC.
    • false – The player will stay in place during dialogue (no forced movement).

The SpeakerPosition is a BillboardComponent already present on the BP_RPG_AI_Quest parent. You can adjust its position in the viewport to control where the player stands when talking to this NPC.


Step 5 – Test the Quest NPC

  1. Start the game in PIE.
  2. Approach the NPC and press the interaction key.
  3. Verify that:
    • The NPC opens the dialogue UI (if dialogue is configured).
    • The quest appears in the dialogue options.
    • Accepting the quest adds it to the player’s journal.
    • The quest can be completed and turned in.
  4. If MovePlayerToSpeakerPosition = true, confirm that the player is moved to the correct position and cannot move during the dialogue.

Summary Checklist


  • docs/systems/quests-and-dialogues.md – quest system architecture and runtime behavior.
  • docs/how-to/progression-and-quests/how-to-add-quest.md – creating a new quest.
  • docs/how-to/progression-and-quests/how-to-add-dialogue.md – setting up dialogue for quest NPCs.
  • docs/reference/data-assets-reference.md – reference for DT_Quests and related structures.