Part 4: Tying It All Together

Tying It All Together

Quest Journal Updating

My simple quest is almost done! The last thing I need to do is make sure the journal is updating to the next index as the player completes the steps. First, I take a look back at my journal indexes to see what steps I need to be sure to include. I have three:

That is, in plain text:

Journal Index 10
"Kevaar found an abandoned ring. He's asked me to find its owner."
Journal Index 50
"Fargoth says he is the owner of the ring Kevaar found. I should make sure Kevaar knows this."
Journal Index 60
"Kevaar thanked me for finding the owner of the ring and assures he will give it to Fargoth."

As this setup includes three journal entries, I will need to be sure to add at least three update scripts somewhere in my quest. Some quests will put these updates in scripts attached to Objects or specific events, but as my quest setup is simple, I will put them in the dialogue. This is done by going to the Results window of the appropriate dialogue Responses and adding in this line of script:

Journal "TR_KevaarShiny" #
...where # is the journal index that I want the quest to be updated to.

In my quest setup, the first update comes when Kevaar offers the quest. I will then navigate to the Response that reads "Yes! I found it in a barrel on the dock..." and add Journal "TR_KevaarShiny" 10 to the Results window, like so:

Then I will go on to add the update script for index 50 to Fargoth's Response that reads "Kevaar what? He found a ring? It's m..." and the update script for index 60 to Kevaar's Response that reads "You know who it belongs to? Excelle..."

After I have done this, I will want to SAVE my mod and test it out ingame. This way I can also judge if I need to add any more Responses, Secondary Topics, or Greetings to improve the flow of the quest.

Giving the Player a Reward

Finally, I want to give the player a little something for finishing up my simple quest. I refer back to my simple quest design, which says I wanted to give the player a silver staff and 50 gold pieces for completing the quest. In the same Response that finishes the quest ("You know who it belongs to? Excellent..."), I will then add this line of script to the Results box, in a separate line from the script that updates the quest journal:

"player"->AddItem, "silver staff", 1

This tells the game engine to give 1 (one) item with the ID of "silver staff" to the player. I also see in my quest design that I wanted to give the player 50 gold pieces. Gold pieces are objects just like an other item ingame, and so I add this in another line of script:

"player"->AddItem, "gold_001", 50

Now the player should get 1 silver staff and 50 gold pieces for their trouble. Brilliant!

After doing one more playtest to make sure everything is implemented correctly and Kevaar isn't shy about giving out the quest rewards, I have finished my simple quest!

Congratulations! You've finished this simple quest tutorial in which you've learned how to create dialogue, NPCs, items, and tie them all together into a quest using the quest journal. To look at some other ways of implementing more complicated quests, including why I bothered making a ring when I never actually used it in this quest, please refer to the Questing and Dialogue Tutorial page. Happy modding!