The dialog window in Morrowind is split into four parts: tabs, info/response, speaker condition, and results box.
The Topic tab is where all of the topics available for the player to click on are located. You can create new topics here or use existing one.
To create a new topic, right click on any topic and select new.
Type in the topic name and then press enter.
Your topic will be added and the list will repopulate in alphabetical order.
The Info/Response box is where the NPC replies to topics are located. In here you can: add new responses, change existing responses or delete responses.
Adding new responses To add a new response for an NPC, right click on an empty line and select new. An empty line will be created and you can start typing.
Tip: I recommend that you click on the white box just below the response box because the line editor will truncate your entry if you exceed its character limit; the response box has a larger limit (512 characters).
Speaker conditions: The speaker conditions section contains filters that determine when a particular NPC dialog line will show. All NPCs share the dialog database, even dialog added by other mods, so it's important to ensure that your dialog will only be available to the NPCs you want it to and only under the conditions that you set.
ID: The id of the NPC that speaks this line (e.g. the id of caius cosades) means that only Caius Cosades will have those lines available.
Note: Setting this filter prevents the race, class, faction and rank filters from being used.
Race: The race that will have that line available (e.g. Breton, Imperial): All members of that race can potentially speak that line.
Class: Same as race, but filters by class (e.g. warrior, knight).
Faction: Same as race, but based upon the faction the NPC belongs to (e.g. Thieves' Guild, Fighter's Guild, etc.)
Rank: Used in conjunction with the faction filter. This is used to limit the NPC response to any member of the rank within a faction and above.
Example: a Knight of the Legion and any NPC with a rank above that will have that response available.
Cell: The NPC has to be in the cell listed to have that dialog response.
Example: The members of the Thieves' Guild will only have their dialog available if they are in one of the guild halls. If you commanded one of the members to follow you outside of the guild hall, they would loose the dialog that refers to the Thieves' Guild (i.e. Join the Thieves' Guild).
PCFaction Similar to faction, but this applies to the player character. The NPC will only have this response if the player is in the faction listed here.
Example: Imperial Legion NPCs have a different response for players that are members of the Legion versus those that are not when the player asks about joining the Legion.
PCRank: Same as Rank (see above), but it applies to the player character instead of the NPC.
Sex: The NPC's gender.
Disp: The NPC's disposition. The NPC's disposition must be this number or higher for the response to be listed. A disposition of 0 means that the response is always available provided that the other filter conditions are met.
Function/variable: This holds the functions and variables that can be used to further refine when a response is available. Each filter in this function has different mathematical operators available: greater than, less than, equal to, not equal to, greater than or equal to, and less than or equal to.
- Journal: filters the response by journal index. Can be greater than, less than, equal to, greater than or equal to, less than or equal to, or not equal to.
- Item: The item in the player's inventory. Can be used for if the player has or doesn't have an item, and also item quantity.
Example: Freeing slaves: if the player has one or more keys that fit a slave's bracers, the slave will ask them to unlock the bracers. If the player does not have a key, then the slave will mention that. If you are checking for more than one type of item, each item type (key, ingredient, etc) needs to be on a separate line.
- Dead: The dead count of an NPC.
Note: some NPCs, like guards, are generic and can have more than one in the dead count. NPCs with names are unique and there's only one copy of each.
- Not id: when set to equal to 1, this means that the NPC does not have the id listed.
Example: the Master Barelo topic. When talking to any Dissident Priest other than Gilvas Barelo will give you the response â€œMaster Gilvas Barelo is the abbot of our monastery, and the head of our secret order.â€� You can also set this to 0 for non-unique NPCs like guards.
- Global/local This is for local and global variables. These are used primarily in companion and quest mods and will be discussed in a later chapter.
- Not faction When set to equal 1, the NPC is not in the faction listed.
- Not cell When set to equal 1, the NPC is not in the cell listed.
- Not class When set to equal 1, the NPC is not a member of the class listed.
- Not race When set to equal 1, the NPC is not a member of the race listed.
- Not local Used primarily for the NoLore variable to prevent the NPC from having the generic responses to certain topics such as â€œlatest rumors,â€� â€œlittle advice,â€� etc. Will be covered later.
- Choice Allows you to include choices. Usage covered later.
The voices tab is where the game stores the spoken voices for the NPCs (alarm, hello, etc.). You'll be adding to this tab if you're adding new spoken dialog for NPCs. This tab is not covered by this tutorial.
This tab has all of the initial written greetings used by NPCs. It functions similar to the topics tab in that the speaker conditions can be set so that the greeting is only present when the filters are met.
Example: When Caius greets you for the first time, he asks if you're the one that was to report to him.
The greetings tab is subdivided into ten greetings numbered 0-9. Technically each greeting division is for a specific purpose: Greeting 0 is used by the guard NPCs for the purpose of handling punishments for crimes committed, while another one of the Greetings is for when an NPC greets a player vampire.
Tip: New greetings can be placed in any of the subdivisions, but Greetings 1 seems to be the best place.
Guideline: NPCs using the guard class should have their greetings in Greetings 0, especially companions to prevent them from trying to arrest the player. Other NPCs can have their greetings in Greetings 1.
This tab holds all of the NPC responses to persuasion attempts (admire, intimate and bribe). Like the other tabs, you can limit the responses to a particular NPC, a class, a race, a gender or leave it open to any NPC.
This tab contains all of the journal entries available to the player.
To add a journal entry:
- First create a new journal topic by clicking in the tab window and selecting new. Give your new journal topic a unique name (usually your initials and whatever else you like to use. For example, I use jac_jasmine as a journal name).
- In the blank info/response window, select new and then type in the quest/journal name â€“ this is what shows up in the journal's topic name screen in game.
- Click the box in the Speaker Condition window that says "Quest Name" and give it an index of zero (0).
- Add journal entries with the first entry starting just under the quest name (this is usually the initial entry the player gets when starting a quest) and give it an index number of ten (10).
- Additional entries should go in order below it, starting with index twenty (20) and increasing by ten for each entry. This will give you nine (9) possible entries between entries should find you need them.
· Quest name (index 0)
· Initial entry - gives the player the quest and where to start (index 10)
· Mid quest entry - the player got the item/killed the monster/went somewhere but hasn't finished yet (index 20)
· Finished entry - the player finished the quest (index 30, also the finished box was checked in speaker condition).
Adding dialog is a very straightforward process depending upon what and where you're adding dialog to.
To add dialog to an existing topic (e.g. latest rumors):
- Find and select the topic from the topics tab.
- In the info/response box, right-click on an existing topic response and select new.
- Type in your new dialog and select any filters you want for the topic.
Adding dialog to a new topic is the same but you must add the topic first:
- To add a new topic, right click in the tab window and select new.
- Type in your topic name, and then add the dialog to the info/response window.
A note on the info/response window: Dialog is read from the very top line to the bottom, line by line, until the very first line that meets all of the speaker condition filters. This includes the disposition. An easy mistake to make is to have a line with disposition filter set at zero and have a line below it with a higher disposition. In this case, the line with the disposition filter of zero will always show while the line below it never will. These two lines would need to be swapped around for them to show properly.
THE CHOICE FUNCTION
The choice function is a very powerful and versatile dialog tool. It allows you to:
- Split long dialog into more manageable chunks by adding a continue choice.
- Add options for the player to select, which adds to role playing.
- Add functionality to NPCs, like companions and others (e.g. give your orders mods).
You can have from 1 to 999 choices, but remember that you have to enter each choice so choose how many you want before you implement them.
The format is Function->choice = <choice #>. Choices should be in reverse numerical order, with the highest number at top counting down to the line that gives the choice. The results box for the info/response line with the choice command is Choice =< choice 1>= 1 , choice 2>=2, etc.
Tip: You do not have to start with 1 as your first choice, but I find it's easier to keep track of them that way.
A simple choice: the continue choice The continue choice is used to split up dialog that exceeds the 512 character limit into two or more paragraphs.
To implement this:
- Enter the first paragraph, and then use the above choice command in the results box: Choice Continueâ€� 1.
- Insert a blank line above this info line and then enter the second paragraph. Set the filters as follows: <NPC ID>, Disp 0, Function->Choice=1
Adding additional choices is a matter of adding them to the Choice command and inserting the choices above the choice line as shown in the simple choice example.
Tip: A good rule of thumb is to filter by NPC ID so that you do not have to worry about your choices overlapping with those from other mods or from the ones Bethesda has already entered.
Note: Two lines can use the same choice # provided they have a different NPC ID or other filters set. Otherwise, the line that's on top will be displayed while the one below will not. If you're having issues with choices not being shown, make sure that you do not have two lines with the same filters set.
SIMPLE QUEST TUTORIAL
This tutorial will introduce how to write a simple quest. It will include creating journal entries, filtering, and adding info/responses to dialog topics.
First, open up the Construction Set (CS) and then the dialog window (either by selecting Character->Dialog or by clicking on the text balloon at the top).
Second, click on the journal tab and add the journal topic "<your initials>_mudcrab".
Add a new info/response line of "Finding mudcrab meat" and set that to the quest name. (Note: journal topic names and dialog topics names CANNOT be the same. If they are, you will receive errors.)
Below the quest name, add a new line "Teleri has asked me to retrieve some mudcrab meat for her." Set the index to 10.
Below that, add another line: "I returned some meat to Teleri and she gave some gold in exchange." Set the index to 20 and click the finished box. This tells the game that this is the finished entry and it's to be moved off of the player's active quests list.
Third, add the topic "mudcrab meat" by clicking on any dialog topic and selecting "new". In the info/response box, add a new dialog line and type "Yes, I am short of mudcrab meat. I'll pay you if you find me some, %PCName."
Note: %PCName will show the player's name in dialog.
Set the filters to:
- ID: Teleri Helvi
- Function/Variable: Journal->"your journal entry id" < 10.
- Results box: journal <your journal id> 10
Fourth, click on the entry and select new to create a blank entry above it.
Type: "I don't see any mudcrab meat on you, %PCName."
Set the filters to:
- ID: Teleri Helvi
- Function/Variable: Journal->"your journal entry id" = 10.
- Function/Variable: Item->ingred_crab_meat_01 < 1.
Finally, add a new line to the very top and type, "Oh, thank you, %PCName. Here's some gold for your troubles." (Note, you can copy the previous line and change the filters).
Set the filters to:
- ID: Teleri Helvi
- Function/Variable: Journal->"your journal entry id" = 10.
- Function/Variable: Item->ingred_crab_meat_01 >= 1. (This is so the quest will end if the player has more than one piece of mudcrab meat.)
In the Results box, add:
- journal "jac_mudcrab" 20 (sets the journal to the finished entry).
- player->additem "gold_001" 20 (gives the player 20 gold).
- player->removeitem "ingred_crab_meat_01" 1 (removes one piece of mudcrab meat).
Click the ok button to save your dialog. Save your plugin and load it up to make sure you didn't miss anything.
TIPS ON ADDING AND CREATING DIALOG
When creating dialog topics, try to keep them as unique as possible. The reason for this is best explained by Psyringe:
In conversation, topics are available when both the player and the NPC know it. The NPC "knows" a topic when there is at least one line of dialog for this topic of which he can fulfill the conditions associated with it. The player knows a topic when it has been added to him with the "AddTopic" command, or when the topic has been mentioned to him by an NPC who knows it. The last bit is the important part.
When writing dialog, we can do it this way:
- Give an NPC a greeting "I need some meteor slime."
- Make a topic "meteor slime", filter it for this NPC, and add the response "Meteor slime tastes great when mixed with scrib jelly. I'll give you a recipe.", and add a meteor slime jelly recipe to the player's inventory.
Now when the player encounters the NPC, the NPC will say his greeting. The game *parses* this greeting and checks whether it contains any topics. It finds the topic "meteor slime" in the text. Since the NPC knows the topic "meteor slime", and the text "meteor slime" is being uttered by this NPC, the topic will automatically be added to the player's list of known topics, and the the topic will be printed in blue, be clickable, and will also appear in the list of available topics for this conversation.
This works well as long as the game can correctly determine that the text uttered by the NPC actually does contain the topic "meteor slime". It can fail when other topics exist which overlap this one - like "slime", or "some meteor slime". The exact parsing algorithm of the game is unknown, but overlaps can cause it to fail, like this:
- Let's say that a topic "some meteor slime" exists, added by some other mod.
- The game now parses our NPC's greeting and sees the topic "some meteor slime" there.
- It checks whether the NPC knows this topic, which he doesn't, so it doesn't get activated.
- The game *does not* check whether the text "some meteor slime" might also contain other topics as well.
- Therefore, the game fails to see that the dialog contains the topic "meteor slime"
- Therefore, the topic "meteor slime" never gets added to the player's list of known topics, doesn't get activated, and the player cannot click on it and cannot receive the recipe.
Etiquette: Some modders use symbols (+ = * / - ) at the front of their topics while others use short phrases or change the letters of a topic name (e.g. t0gether). Whichever method you choose, it's important to make it unique. Remember that topic names will show up in dialog as hyperlinked (in blue) if an NPC's info/response line contains the same words or phrase.
Tip: AddTopic should be avoided if you want the NPC adding the topic to be able to talk about it after it has added because topics added with that function won't show up until the player quits dialog and reenters it. If you're adding a topic that another NPC will talk about, then AddTopic is fine.
Etiquette: When adding info/response lines to an existing topic (i.e. one you did not add) or a greeting, it's preferable to place the new line(s) somewhere in the middle of the topic or greeting if possible and to clean the insertion points. Adding lines to existing topics causes the CS to mark the line above and below as changed and this could lead to conflicts with other mods that add dialog to that topic or greeting.
The best way to do this is to highlight the "changed" line(s) and replace the text with something that's visible, such as [DELETE]. After you're done adding dialog and are ready to test, use the TES Advanced Mod Editor (TESAME) program to "erase" these changed lines and revert them back to their original condition. After you do this, the lines will no longer have an asterisk by them and the game engine will no longer consider them changed.
To use TESAME, save your mod and close the CS. Open up TESAME and load your mod. Click on the Type tab to sort by type and scroll down until you see the [DELETE] lines. Click on each one, press the space bar to select it, and then press the <delete> key. Note: you can select and delete multiple entries. After you have cleaned your dialog, save the mod and test it to make sure the dialog still works.