Titan Quest Fans Forum

Titan Quest - Anniversary Edition => Modifications => Quest Modding => Topic started by: WNG on 04 April 2020, 19:36:42

Title: [Tutorial] Create your own quests!
Post by: WNG on 04 April 2020, 19:36:42
↜ Create your own quests! by WNG ↝

Introduction

In this tutorial, you will learn how to make and play your own quests and include them in your custom maps. Quests can be logged into your journal or used to control some events in the world every session, making them very powerful tools to make your world interactive.

I may assume you have some basic knowledge and overlook some manipulations. Feel free to tell me if anything is unclear.

Without further ado, let's get started.

I. Create a .qst file

This step will require:

Procedure:

I. Have a functioning mod (optional but recommended):
Prepare a mod that will include in its database all the new entries that will be used for your quests. If you need custom monsters or new rewards, you should prepare them before using the Quest Editor.

II. Load your mod in the Quest Editor:
Locate the Quest Editor in your game folder and open it. It might take a while to open. It may prompt you to select a mod; this allows the Quest Editor to use your mod's database and use any new ressources you've added. If you aren't prompted, you can still proceed by selecting File > Select Mod...

III. Create a .qst file:
You can now simply press on File > New Quest Document or the Two-pages icon to create a new quest document!

II. Understanding the quest components

I. Quest Steps:
(https://i.imgur.com/r8RR7rf.png)
Quest steps are the big sections of your quest. You can name them by clicking on them and leave comments on them too. Their only use is to contain triggers. Quest steps can contain multiple triggers at once, although I suggest you stick to using one trigger per quest step.

II. Triggers:
(https://i.imgur.com/7RU8XHv.png)
Triggers represent the events that can occur. You can name them by clicking on them and leave comments on them too. Triggers contain conditions and actions.

III. Conditions:
(https://i.imgur.com/F9xwSim.png)
Self-explanatory; conditions are criterias that need to be met to trigger the action below. All conditions must be fulfilled before proceeding.

IV. Actions:
(https://i.imgur.com/eP8IhVj.png)
Self-explanatory; actions are events that will occur once the conditions are fulfilled.

V. Tokens:
(https://i.imgur.com/Qg261xw.png)
Tokens are switches that can be used to keep track of the progress of the player's quests, enemies defeated, who it has talked to or not and a lot more. Unlike switches, however, tokens are not exactly booleans; they are granted to the player which means you can either own a token or miss a token (the difference is very subtle.)
You must create your own tokens; they are not generated automatically. Simply press on the wrench icon on the top bar and on the Create Token button.
!! If the window says the Tokens.bin file is not editable, make sure 1) the file exists in your mod directory, 2) the file itself (and its parent directories) are not set on Read-only. !!

III. Analyzing a quest example

To build a quest from scratch, it is necessary to understand how each action and condition operates, but we will get to that later. For now, let's make sure that you understand how a quest is built by looking at an example quest from one of my old custom maps.

The Broodmother : To complete this simple quest, the player must find a kill a huge spider. Here is the structure as seen in its .qst file.
(https://i.imgur.com/g3ak0k8.png)

Step 1: Initialization
Conditions
  • When the game loads
  • If the player does NOT own the token "sq1_complete" (which will be granted later upon finishing the quest)
Actions
  • Add the "!" indicator on the top of the head of the NPC "shanzung_qg1"
(https://i.imgur.com/y3Mi560.png)

Step 2: Receive quest
Conditions
  • When the player discusses with the NPC "shanzung_qg1"
  • If the player does NOT own the token "sq1_spiderkilled" (which will be granted later upon killing the spider)
Actions
  • Adds/updates the quest to the player's journal
(https://i.imgur.com/msWQQpi.png)

Step 3: Defeat spider
Conditions
  • Upon killing the creature "giantwidow_1"
Actions
  • Adds/updates the quest to the player's journal (with new information)
  • Grant the token "sq1_spiderkilled" to the player
  • Add the "!" indicator on the top of the head of the NPC "shanzung_qg1" anew
  • Changes the dialog package of the NPC "shanzung_qg1"
(https://i.imgur.com/9OGfPr6.png)

Step 4: Report back
Conditions
  • When the player discusses with the NPC "shanzung_qg1"
  • If the player does owns the token "sq1_spiderkilled" (which has been granted at step 3)
Actions
  • Updates the quest to the player's journal (with new information) and now tags it as completed
  • Give the player one instance of a random item from the referenced loot table (in this case, a relic shard)
  • Grant the player some experience points
  • Give the player the token "sq1_spiderkilled"
  • Changes the dialog package of the NPC "shanzung_qg1" once more
  • Completes the quest (the .qst file is now sealed)
(https://i.imgur.com/nkFRfNz.png)

IV. Implement a quest in your mod

We now know how a quest file looks like and how it is built. I will explain in the posts below the function of some conditions and actions, but before that, let's look how we include a new quest to our mod.

This step will require:

Procedure:

I. Make an asset of your .qst:
Once you have finished and saved your .qst file, open the ArtManager with your mod selected. In the Source tab, select the folder you want to store your quests in (every mod starts with a Quests folder by default.) Right-click on the window on the right and click Import... From there, find your quest. Once it's imported, right-click on it and press Auto-Create Asset.

II. Build the asset:
Visit the Assets tab and locate your quest file in the same folder you left it in Sources. Right click on it and click on Build. Once it's done (should display "added: ./_questname_.qst" in the console), press F7 to build your mod. The quest is now incorporated in your mod, but remains unused...

III. Add the quest in your map:
Launch your custom map. On the top bar, press on Quest > Selected Files... You will see the entirety of the quest files used by this map. Press Add and locate your quest. Once it's added, make sure to save your map (no need to rebuild pathing or maps.) For changes to take effect, you may need to rebuild your map and your mod with the Art Manager.
Title: Re: [Tutorial] Create your own quests!
Post by: WNG on 04 April 2020, 19:36:52
↜ Annex I : Function of basic conditions ↝

Here's the function of some conditions used in the Quest Editor. To my experience, not all of them work (or I don't know how they function?) but I will list down below the basic/essential conditions for starters.
Title: Re: [Tutorial] Create your own quests!
Post by: WNG on 04 April 2020, 19:37:01
↜ Annex II : Function of basic actions ↝

Here's the function of some actions used in the Quest Editor. To my experience, not all of them work (or I don't know how they function?) but I will list down below the basic/essential actions for starters.
Title: Re: [Tutorial] Create your own quests!
Post by: Bumbleguppy on 29 November 2020, 23:59:58
Excellent tutorial as always WNG. Good job.

Dirty cheats for hacker types like me:

It's possible to copy a quest step/trigger/condition, even though the QuestEditor interface doesn't have a selection for "copy" or "paste" in the menus. Select a quest step and hit Ctrl+C. Deselect or in the case of triggers, select the quest step you want it to appear under and hit Ctrl+V. Saved me a lot of time when I had similar quest steps with only a couple different conditions to differentiate them.

If you don't want to use the game map to add new quest files to your mod, simply commandeer an existing vanilla quest file, especially triggered scenes as these aren't game breaking if you screw up. For example, take one triggered scene's quest file and add it to your mod and create an asset of it. Open it in QuestEditor, select each quest step and ctrl+c/ctrl+v into another triggered scene quest file you add the same way to your mod and append the entire quest code at the bottom of the second quest file. Since triggered scenes use the "token you can never get" mechanic, they will not stop each other from firing. Delete the original quest file quest steps in QuestEditor and you now have a blank quest file that is already registered with the game map.
Title: Re: [Tutorial] Create your own quests!
Post by: rakshir on 06 January 2021, 18:22:06
Hey Bumbleguppy or anyone who can help. I gather from your post that we can edit existing quest files without using the game map. I've been trying to do this and failing. All I'm trying to do is simply change some quest rewards and stuff like that using Quest Editor, but I can't seem to get the game to read my files. If I simply put the originally named, modded quest files into Sources/Quests, create asset, build asset, and build mod, is the modded game supposed to read those files? That's what I've been doing, trying different variations of how I import, when I use the quest editor, etc. to no avail. Anyone know what I might be doing wrong? Thanks for any help!
Title: Re: [Tutorial] Create your own quests!
Post by: Bumbleguppy on 06 January 2021, 18:49:02
Have you tested it with a fresh new character? Quests and their tags are in the character save file so changing a quest for an existing character can give weird results.

EDIT: Also check the QUestEditor.ini in Documents/My Games/Titan Quest - Immortal Throne folder. THe first entry is "tokenFile".
Make sure that points to your mod's Tokens.bin I think.
Title: Re: [Tutorial] Create your own quests!
Post by: rakshir on 06 January 2021, 21:35:21
@Bumbleguppy Thanks for responding! After hours of frustration I finally got my first quest to be read. I'd love to share what worked but I'm honestly not one hundred percent sure. One of the actions I was looking for I had put in the wrong place in the file. Also, I had copied my Sources/Quests folder and an unused Token.bin from another mod because for some reason mine didn't have them. So I made my mod new and added the files. Anyway, something worked. Your response helped me to keep plugging away at it!
Title: Re: [Tutorial] Create your own quests!
Post by: Bumbleguppy on 06 January 2021, 22:38:46
The best advice is that which yields results and not necessarily what you would always expect I suppose.

Glad things worked out.

BTW, welcome to the mod world lol

"It doesn't work and I don't know why" becomes "It worked and I don't know why" lol
Title: Re: [Tutorial] Create your own quests!
Post by: rakshir on 18 January 2021, 15:36:27
Hello again @Bumbleguppy or anyone else who might be able to help. After successfully modding several quests, I've hit a roadblock again. I've spent an entire day trying to figure out why the game isn't reading the last quest I'm working on. Not a fun way to spend a day :(. I should have thought of this sooner but I only recently began suspecting that the reason the game isn't reading my latest quest is that it's the only "Immortal Throne" quest. The game keeps those quests in a different arc file: "Resources/Xpack/quests.qst. instead of Resources/quests.qst. My thought was to create a new directory in the source tab of Art Manager. I've tried source/xpack/quests/quests.qst, source/xpack quests/quests.qst, source/quests/xpack/quests.qst. At this point I'm going out of my mind. Can anyone tell me how "Immortal Throne" quests should be set up in Art Manager? Any other suggestions on why the game isn't reading this particular quest?

As a side note, in my testing, I've seen that the game is reading from my new quest reward skill tree and yet somehow still giving me a reward that has been removed from the tree. What the heck!
Title: Re: [Tutorial] Create your own quests!
Post by: Bumbleguppy on 18 January 2021, 21:19:26
For my mod, I placed
the XPack quests in source/XPack/Quests
the Ragnarok Quests in source/XPack2/Quests

XPack quests in modding have always been a problem, it's only one of the recent patches that made them available to mod at all without adding the game map, removing the quest reference and placing them in source/quests.

Haven't tried Atlantis.

As for the quest rewards, no idea.
Title: Re: [Tutorial] Create your own quests!
Post by: rakshir on 18 January 2021, 22:15:03
Thanks again for the reply. So with the most recent patch it should be possible to modify a quest by adding an "xpack" directory to the source tab, a "quests" directory in it and then placing the .qst file in it, create asset, build and build? Tried it again and  nothing. In your experience does it just not work for some quests? The Stygian Lurker side quest is the one I'm trying to mod and I can change my plans for it but later I really need to mod the end of the main Act 4 quest to accomplish one of my main goals.
Title: Re: [Tutorial] Create your own quests!
Post by: Bumbleguppy on 19 January 2021, 00:15:11
Sorry, that's all I know. I used the stygian lurker quest in my mod in the directory source/xpack/quests. I used to have problems, then I didn't and I don't remember any more than that.

The only other people I think may help is @WNG maybe. All the others that modded quests are years ago gone. Maybe @sauruz has crashed against the xpack quests? I don't know.
Title: Re: [Tutorial] Create your own quests!
Post by: sauruz on 19 January 2021, 01:21:30
Sorry , im not able to help with quests, as the only i edited was the starting one in helos ( and isnt even a quest).

Speaking about that quest, idk but time to time, when i log with a character i still receive the pop up telling that i get the bonus from that quest, even after i complted from last play season.

I advice you to try on another xpac quest to see the results.
Title: Re: [Tutorial] Create your own quests!
Post by: rakshir on 19 January 2021, 02:12:32
Thanks @Bumbleguppy and @sauruz for responding. Hopefully I'll get it figured out when I've got some more time. I'll post it if I figure anything out.
SimplePortal 2.3.7 © 2008-2024, SimplePortal