Quest Creation

Quest creation is a type of Daggerfall Unity modding that anyone can do. As long as you can follow this guide, you will produce multiple functional quests for Daggerfall Unity.

## Step One: Prepare the Environment

Boot up Daggerfall Unity and your text editor. You can choose any from Notepad up to any code writer, but you will greatly benefit from TheLacus' quest-writing utilities. They will drastically reduce the work for each quest.

In Daggerfall Unity, move your character to the region of Ilessan Hills, to the town called Aldingdale. It'll provide a perfect testing environment to begin with. Go into the Fighters Guild there and save your game in front of the quest giver.

Now, open your quest editor and create a new file. Save it as **TESTING1.txt.** Save it in the folder /DaggerfallUnity\_Data/StreamingAssets/QuestPacks.

In a separate instance, create a new file called **QuestList-TESTING.txt** in the same folder and write the following inside it:

```
schema: *name, group, membership, minReq, flag, notes

TESTING1, FightersGuild, N, 0, 0, Test quest

```

This QuestList file determines who the quest is offered to. In this case, it's a Fighters Guild quest, and it's offered to non-members. If your character is a member of the Fighters Guild and you want to test this quest, change the N to an M in the scheme above.

Make sure not to add a comma to the end of "Test quest". If you do, the game will refuse to run the quest and give an index error instead.

In order for Daggerfall Unity to offer any quest you create, it must be put within a QuestList file, with the appropriate scheme as designed above.

## Step Two: Using a Template

To save yourself time, you can use a template that contains all the major elements for a Daggerfall Unity quest. Copy and paste this information into **TESTING1.txt**:

```
-- Message panels
QRC:

QuestorOffer:  [1000]
<ce>

RefuseQuest:  [1001]
<ce>

AcceptQuest:  [1002]
<ce>

QuestFail:  [1003]
<ce>

QuestComplete:  [1004]
<ce>

QBN:
Item _reward_ gold

Person _questgiver_ group Questor male

Clock _timer_ 00:00 0 flag 17 range 0 2

--	Quest start-up:
	start timer _timer_
	log 1030 step 0
	place _mondung_

variable _slain_
_qgclicked_ task:
    clicked npc _questgiver_

_timer_ task:
    end quest

_clearclick_ task:
    when _qgclicked_ and not _slain_
    clear _qgclicked_ _clearclick_

```

Before you proceed, write **TESTING1** after the "Quest:" field above. It must match the name of your quest file, without the .txt extension.

After "DisplayName:", write the official name that you're giving to your quest. This will be visible to some players, so make it human-legible and appropriate. For this tutorial, you could try **A Tutorial Quest**.

```
Quest: TESTING1
DisplayName: A Tutorial Quest

```

## Step Three: Filling in the Dialogue

Below that, the first half of the quest file contains a series of message blocks, with numbers attached to them like [1000] and [1004]. Write some kind of unique dialogue in every one of these fields. For this tutorial, it can be something simple and short.

```
QuestorOffer:  [1000]
<ce>          We need to kill one enemy.

```
The <ce> at the start of each line will make the text centered on the screen. You usually want to do this, though there are some cases where left-justified text will look better. For all the message blocks in your quest file, create a short and unique message, to get this part over with. This is an example of how it could look:

```
QuestorOffer:  [1000]
<ce>          We need to kill one enemy.

RefuseQuest:  [1001]
<ce>              Don't be like that, %pcn.

AcceptQuest:  [1002]
<ce>                   Kill it then.

QuestFail:  [1003]
<ce>               Just ridiculous.

QuestComplete:  [1004]
<ce>                Good job.

```

## Step Four: Defining Objects

Nearly all quests use an object of some kind. These can be people, places, things, timers, and monsters. This is defined in the QBN section.

There must be a field called **QBN:** below the message boxes, or the quest file will not work. See the example posted above for a proper formatting.

Define the following objects inside your quest file, after the message boxes.

```
Item _reward_ gold

Person _questgiver_ group Questor male

Clock _timer_ 00:20

Foe _enemy_ is Orc

Place _guild_ local fighters

```

## Step Five: Quest Actions

Now that we have defined several objects we'll use in this quest, we have to put them into action. In the template posted above, there's a line written, **--Quest start-up:**. Because it has hyphens in front of it, that line is optional, acting as a comment. This can help you organize and annotate your quests.

Below **--Quest start-up:**, write the following:

```
	start timer _timer_
	place foe _enemy_ at _guild_

_timer_ task:
    end quest

_mondead_ task:
	killed 1 _enemy_
	give pc _reward_
	end quest

```
The quest now has everything it needs to run. We'll do some explanations after you test this quest.

## Step Six: Testing the Quest

First, remember that the quest file and the QuestList need to be in your /DaggerfallUnity\_Data/StreamingAssets/QuestPacks folder. Second, go to the Fighters Guild questor in the town of Aldingdale, in Ilessan Hills. Third, remember to change the N to an M in the QuestList file if your character is a member of the Fighters Guild.

Now, ask for quests until you see a quest being offered with the dialogue you wrote in Message Block 1000. Accept that quest. Once you do, a hostile orc will appear inside the Fighters Guild building. Kill it, and you will be rewarded.

## Postmortem: Understanding the Test Quest

We'll now look at some of the elements included in the quest file.

When a quest is offered by a questgiver, it always uses Message Block 1000. If you refuse the quest, it always shows Message 1001. If you accept it, it always shows Message 1002.

Message 1003 is not hard-coded to any specific action in a quest. If you want to show that message, you can use the quest action **say 1003**, which is the standard format for showing any quest message block.

Message 1004 is forcibly shown whenever you use the quest action **give pc \_reward\_** and **give pc nothing**. If you use that action multiple times, 1004 will be shown multiple times. This is the only case you can repeat a message block in the DFU quest system.

DFU is hard-coded to not allow the same message to show up more than once, with the exception of the 1004 event described above. Therefore, if you use **say 1010** at two different points in the quest, it will only appear the first time.

```
Item _reward_ gold

```
This section of the QBN was used to define an item called \_reward\_. All DFU variables should use underscores on each side, as proper syntax. We defined it as **gold**, which is a reward run by the quest system; it is a gold amount roughly equivalent to 100 times the player's level.

```
Person _questgiver_ group Questor male

```
We did not use the questgiver this time, but most quests will have you interact with the questgiver in some way. This line has defined a person called \_questgiver\_ who belongs to the **group Questor** and is a **male** NPC; all Fighters Guild questors are males. When an NPC is defined as **questor**, the game automatically attaches this identity to the person who gave you the quest.

```
Clock _timer_ 00:20

```
We included a timer in this quest, which was not relevant but still ran in the background. The number on this timer counts downwards after it begins, and each one is a combat round of five seconds. Therefore, 20 rounds of five seconds makes for 100 real-time seconds. If you chose to escape the orc, the timer would count down 20 rounds (100 seconds), and trigger the quest task called **\_timer\_**. This will be further explained below.

```
Foe _enemy_ is Orc

```
This line defines an enemy entity that is called **\_enemy\_** and is an Orc. An enemy can be used multiple times, if necessary.

```
Place _guild_ local fighters

```
This defines a location called **\_guild\_**. The attributes we gave it were that it was **local**, meaning it is in the same town you are in; and it must be a **Fighters Guild**. Because you were already in the only Fighters Guild in Aldingdale, the game could only spawn the orc in that building. If you do not want a location in your same town, you can use **remote** instead of **local**. Also, there are some defined **permanent** locations in the game.

```
	start timer _timer_

```
This is the first quest action, which will start automatically when the quest begins. Anything below **--Quest startup** and not assigned to a task will automatically launch when the quest begins. In this case, it began counting down the timer we defined as **\_timer\_**.

```
	place foe _enemy_ at _guild_

```
The other quest action that was automatically launched was this one: **place foe**. We told it to place the previously-defined **\_enemy\_** into the location we previously defined as **\_guild\_**.

```
_timer_ task:
    end quest

```
This is a task we have given the name **\_timer\_** to. This is the same name as the timer event we defined previously. Once the **\_timer\_** clock runs out, it will activate this task. This task's only action is to end the quest immediately.

```
_mondead_ task:
	killed 1 _enemy_
	give pc _reward_
	end quest

```
This is the final event written into this quest. The **\_mondead\_** task has no external trigger, and instead carries a **condition** inside it, called **killed**. The **killed** condition will automatically activate when the specific enemy is slain: in this case, one **\_enemy\_**, which was defined previously. Once one \_enemy\_ is slain, the **\_mondead\_** task will automatically launch each of its actions in sequential order. Therefore:

1. The quest system will give the player a **\_reward\_**, previously defined above; and
2. will end the quest.

## Further Experimentation

Now you can take this same quest and change some characteristics about it to widen your capabilities. For example, instead of defining \_enemy\_ as an Orc, try this:

```
Foe _enemy_ is Imp

```
Or if you want the enemy to spawn in a location that isn't the Fighters Guild, this will instead make it spawn in the temple inside the city:

```
Place _guild_ local temple

```
Change other parameters to get some experience on the kinds of things you can do with this basic format.

## References and notes

* TBD

 GENERAL

 GRAPHICS

 WORLD EDITING