Morrowind Mod:Creating dialogue in Morrowind

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

Based on "Morrowind dialog tutorial" by Jac. The original can be found at GHF.

Note: Before creating new dialogue, it is recommended that you familiarize yourself with the Dialogue Window of the Construction Set first.

Adding dialogue[edit]

Adding dialogue is a very straightforward process depending upon what and where you're adding dialogue to.

To add dialogue 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 dialogue and select any filters you want for the topic.

Adding dialogue 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 dialogue to the info/response window.
  • Your topic will be added and the list will repopulate in alphabetical order.

A note on the info/response window: dialogue 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.

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, e.g. jac_jasmine).
  • 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 and increasing by ten for each entry. This will give you nine possible entries.

Example:

  • 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 or killed the monster, or went somewhere, but hasn't finished the quest yet (index 20)
  • Finished entry – The player finished the quest (index 30, also the finished box was checked in speaker condition).

The Choice function[edit]

The choice function is a very powerful and versatile dialogue tool. It allows you to:

  • Split long dialogue 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 it's easier to keep track of them that way.

The "continue" choice[edit]

The continue choice is used to split up dialogue that exceeds the 512 character limit into two or more "paragraphs."

To implement this:

  • Enter the first paragraph, and then use the abovementioned 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[edit]

Adding additional choices is a matter of adding them to the choice command and inserting the choices above the choice line.

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[edit]

This tutorial will show how to write a simple quest. It includes creating journal entries, filtering, and adding info/responses to dialogue topics.

First, open up the Construction Set (CS) and then the dialogue window (either by selecting Character->Dialogue 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 that journal topic names and dialogue 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 dialogue topic and selecting "new". In the info/response box, add a new dialogue line and type "Yes, I am short of mudcrab meat. I'll pay you if you find me some, %PCName." (%PCName will show the player's name in dialogue.) 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 dialogue. Save your plugin and load it up to make sure you didn't miss anything.

Tips on adding and creating dialogue[edit]

When creating dialogue 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 dialogue 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 dialogue, 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 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 dialogue 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 dialogue 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 dialogue 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 dialogue 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 dialogue 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 dialogue, save the mod and test it to make sure the dialogue still works.


Tip: Sometimes you need to make a greeting, that will start a script, and you want it to be filtered not for a single NPC but for a class or a faction. Such a greeting will, of course, block some vanilla greetings and may conflict with other mods, but there is a way to avoid this. As a condition for your greeting add a unique global variable and in the result window start a script that begins with these lines:

short state
if ( state == 0 )
        set state to 1
        togglemenus
        togglemenus
        forcegreeting
endif

In the same frame that the player starts a dialogue with an NPC, the dialogue window will close (player will not see your greeting) and the NPC will greet the player using vanilla greeting.

See also[edit]

Dialogue Window
Morrowind Mod Maker's Manual (Dialogue window)
Creation and Management of Factions