Quest Tutorial (basics)

This tutorial shows how to create a small quest.
In the shown example, you will talk to Walter, a guy standing in the middle of nowhere, crying for help, as some harpies have taken his horse. Your task will be to kill the queen of these monsters and get back to him in order to get 100Orens reward.

This tutorial includes: changing the FactsDB, requesting these facts, conditions in quest and dialogs, getting rewards like money, writing into the journal.

Note: you should already be able to
  • Spawn NPCs
  • Create an interactive dialogue
  • Spawn enemies (a strong Harpy) with one minor difference to the tutorial: copy the Harpy entity to your level, e.g into the folder monsters and give her a tag named harpy_queen. Link your encounter with this entity.



1. Dialog


  • Open your dialogue with Walter and remove everything except Input.
  • Now create a section where Walter tells Geralt about his problem. (Sometime the nodes don’t appear right away, if so just click on the gray area and it will)
  • Then create another section. Right-click right under the sections name and Add element/ Choice. Write one choice that say you will go and kill it, and another one that say you are have to decide.
  • A third section is needed , that will appear after killing the harpy. So create a section and write some dialog lines saying Geralt gets his money.
  • Create three Ouputs. Name one agree to kill the other one later and the third one get Orens.
  • Now right-click on the gray area and Add flow condition. This will check if the harpy is killed or not.
  • Click on the new, blue arrow-lilke node.
  • In the upper left window: click on the field with NULL in it and choose CQuestFactsDBCondition
  • In factId: write harpy_killed
  • Change queryFact to QF_DoesExist
  • Change value to 1
  • Connect the nodes like in the picture below and save, close the file:

2. Journal entry


Before doing anything related to quests logic, a journal entry has to be created first. In the Asset Browser, go to the directory of your level.
  • Right-click, Create/Quest log.
  • Give it a name, for example myjournal and open it.
  • In the left window: right-click on Quest then Add new group. A group is an Act. Write A name for the Act in the right window, e.g. Act 1
  • Right-click in the left window on Act 1, choose Add new entry. An entry of a group is a Quest in this Act. So in our case it would be Hungry harpies leave the other fields empty.
  • Now right-click on Hungry harpies and choose Add new phase.
  • Give the phase a name e.g. A greedy queen, write something into the description field. And into the Short TODO. e.g A harpy queen must be found and killed, thus the great Walter shall get his revenge and Find and kill the harpy queen
  • A phase is a step in your quest. The description is the text that appears in the ingame journals right window. The Short description appears right after you get the quest, as a short info popup.
  • Add another phase in this quest named Victory!, the description could be: Geralt killed the mighty beast and went to the great Walter to get his reward. And the short one: Tell Walter the good news to get your reward.
  • SAVE and close.
  • Now as a last step open your quest entity-file and click on the CQuestComponent-Node.
  • In Node properties link your journal in the field questLog at the bottom of Node Properties.
At the end it should look like this:

3. The Quest logic (see also the image below)


3.1 Dialog


  • Open your quest.
  • Create an Interaction Dialog and link it with your dialog of §1. Remember to write an actorTag!
  • Right-click/Game Systems Control/Pause
  • Click on the pause node.
  • Add a condition: CQuestRealtimeDelayCondition
  • Connect the In of Pause with the outputs agree to kill and later of the dialog-node.
  • Connect none of Pause with Input of Interaction dialog.
  • With these connection we make sure that the dialog can start again even though we said yes (so we can hear the infos again) or no (so we can still say yes). Also we won’t be able to talk to him again after the quest is finished.

3.2 Check if harpy is dead


  • Right-click on the grey area and choose Flow Control/Condition.
  • Click on the condition node.
  • In the left window, choose the questCondition CQuestActorCondition. Write harpy_queen into actorTag (this is the reason why you needed to copy the entity and tag it).
  • For checkType choose CQCIsDead, so the condition will check if the harpy is dead or not.
  • Now link agreed to kill of the interaction dialogue node with In of the condition node.
  • No right-click on the grey area and Game systems control/FactsDB Change. We will now add a fact to the Database.
  • Click on the new node.
  • In factID write harpy_killed, remember this? Yes it is the factId that we wrote in our dialog before.
  • Value must be 1.
  • Connect True of the condition node with In of the FactsDB Change node.
  • Till now it is only checked ones(directly after the dialog) if the harpy is kille. But we want the system to be aware of this all the time. So we have to add a Pause. Just copy the Pause of the Interaction dialog.
  • Connect False of the condition node with In of the Pause.
  • Connect None of the Pause with in of the condition node.

3.3 Get Rewards


There are two ways to get rewards. The first one ignores the journal and the second one only works with the journal, which means you only get the reward when the whole quest is finished.
So the first comes to use whenever you want Geralt to get something while quest isn't finished (like getting some quest-item, that he has to bring to someone to finish the quest).
The first way is described below (checkout §3.4 for the other way around):
  • Right-click and Gameplay/ Player Reward.
  • Click on the new node.
  • Click on the plus and then on the red arrow.
  • Choose CQuestRewardCash, write 100 as cashAmount.
  • Connect get Orens of the dialog with In of the Player Reward node.

3.4 Journal


  • Right-click Quest Log/Quest log Phase. Make 4 of them, 2 for each phase in your journal.
  • Click on one of them.
  • Link your journal with the field questLog.
  • Click in the field next to phaseGuid and select A greedy queen.
  • Do so for a second one.
  • The phaseGuid of the third and fourth one is Victory.
  • Write something into the comment field of the nodes so you won’t get confused.
  • Connect everything like in the image below.
  • Now Add a Quest Log Entry to end your quest.
  • Click on the node.
  • Link the journal.
  • Select as entryGuid Hungry Harpies.
  • Click on the plus in the field next to rewards.
  • Select CQuestRewardExperiance and give it the amount of 200.

Don't forget to SAVE!