Dialogue Tutorial
Let's
start by making a greeting for everyone in Neverland.
|
Greetings sections Greetings are divided into nine sections. From the computer's point of view, though, it's really just one long list; the sections are just for convenience. Each Greetings area has its own conventional use, as follows: Greetings 0: NPC is alarmed Does it matter where you put a new greeting? Yes, it does. When you activate an NPC, the computer starts at the top of the list in Greeting 0, and keeps going through the list towards the end of Greeting 9, looking for a greeting whose conditions are met. That means, for instance, that if you put a greeting in Greetings 1, it will be said even if the player is nude; if you put it in Greetings 3, it won't be said if the player is nude, since the conditions for one of the greetings in 2 will have been met. Since the greeting for the Nerevarine is in Greetings 7 ("Endgame"), greetings in 8 and 9 will never be said to a player who is the Nerevarine. |
With
that in mind, let's put our greeting in Greetings 1, so that you'll be able
to see it no matter what your character has done. We'll need to put it (and
all the other greetings we add in this tutorial) after the first greeting on
that list, since that one is crucial for the Sanctus quest. So:
Welcome to Neverland!
When you move your cursor off the field, this text will show up in the Info/Response table.
Notice that the entries above and below this entry have acquired asterisks, meaning that they've been modified. Why?
|
Dialogue is stored as a "Linked List" This means that each entry contains a pointer to the next entry and the previous entry. So if you insert an entry, you modify the previous and following entries as well by changing their pointers. This is normal and doesn't indicate a "dirty mod". |
So far, so good. Everyone in Neverland will say your new greeting. The only problem is that everyone else in Morrowind will say it too. Why is this?
|
Dialogue is universal
|
Clearly we need to make sure that only Neverlanders say "Welcome to Neverland".
|
Saving dialogue changes Changes to the dialogue database are recorded as soon as you leave a field you've altered. You don't have to click the OK button to save your changes, as you do with other objects. Therefore, since the dialogue window takes a little while to load, you can just leave it open when you test your mod. You do of course have to save the mod itself before testing. |
|
Update Shared By At any time, you can see who can say a particular info/response item. Click the "Update Shared By" button on the right of the dialgoue window, and you'll see a list of NPCs who are included by the current set of conditions. This is a good way to check whether your conditions work the way you intended. |
Under "Shared By", you should see a list that contains all the NPCs in Neverland, and no other NPCs. Neverland NPCs all have IDs starting with DT_, so this should be easy to verify.
All right, now it's time for a test. You should always test from a "clean save", that is, using a character who has never played using your mod; that prevents possible conflicts between mod data and data in your save game. Safest is to test with a brand-new character, and don't save while testing -- each test should be done with a character who is seeing Neverland through fresh eyes.
We'll be using the "Neverland" filter on all the dialogue we do in this tutorial (except dialogue for unique NPCs), since we don't want to affect the rest of the game.
While testing, you may have noticed that actually there are NPCs in several cells that have the new dialogue: "Neverland", and all the interior cells within Neverland, such as "Neverland, Midnight Star Inn". That's because the Cell filter allows partial matches.
|
Cell name matching When you specify a cell name in a dialogue condition, you actually match the cell itself and any other cells whose IDs start with that name. In other words, Neverland matches both "Neverland" and "Neverland" and "Neverland, Midnight Star Inn"; but "Neverland, Midnight Star Inn" wouldn't match any other cell. This is something to keep in mind when naming cells in your mod; in particular, in the case of interiors, it's a good idea to use the name of the exterior cell at the beginning of the cell name. |
Personalizing Dialogue: Text Defines
It's boring when everyone says the same thing. Let's personalize this greeting a bit. There are two ways to do this: we can add more conditions, or we can use "Text Defines". Let's start with Text Defines, which don't require adding extra info/response entries.
|
Text Defines Text Defines are strings that can be inserted into dialogue by using a special code. Those codes are given below. The same codes can be used in messageboxes; in that case the "%" is replaced by a "^".
|
||||||||||||||||||||||||||||||||||||||
Welcome to Neverland, %PCRace. My name is %Name, and my profession is %Class.
Test your dialogue again. Save, go to Neverland, walk around town and talk to everybody, and find out who they are.
Ordering conditions
There's something a little funny about this dialogue. For one thing, "commoner" isn't really a profession. So let's have the commoners say something different. Note: I'm going to give you some flawed instructions, and then show you how to fix it.
Hello, %PCRace. Welcome to our stagnant little backwater, Neverland.
Sounds good -- Neverland commoners say one thing, other Neverlanders say something else. Try testing this in the game.
See the problem? The commoners never say what you want them to say. Instead, they have the standard Neverland greeting. Why is this?
It's because the game starts at the top of the list and stops at the first applicable greeting. In this case, that's the greeting that applies to all Neverlanders. To get the commoners to say something different, we'll have to move their greeting ABOVE the other one. That way, they'll say their greeting, and everybody else in the cell will say the "default". The more specific set of conditions should always go above the more general set of conditions.
To fix the error:
Save and test. The commoners should now give their special greeting.
Disposition
So far everyone is a little too friendly. That's fine if they like you, but if they don't, that should be reflected in their greeting. Let's add a "disposition" condition. This is the box marked "Disp" in the top right corner. Any dialogue with a disposition value will only be said by people whose disposition is higher than this number, so the greeting for people who don't like you should go under all the others.
I don't know who you are or how you got here, but I hope you're not staying.
This will ensure that your new greeting is said only by people whose disposition is less than 40... since they're the only ones who haven't already said something else.
Competing conditions
Let's do one more, just to really drive the point home -- since ordering is the cause of more dialogue trouble than anything else. Let's change the greeting that Bretons give.
Welcome to Neverland, %PCRace. This village was built by Bretons, and we Bretons feel especially at home here.
Like the Commoner greeting, this one clearly has to go above the general Neverland greeting. But does it go before or after the Commoner greeting?
Well, that depends. There are some Breton commoners in the village. If you want them to give the Breton greeting, that should go first. If you want them to give the Commoner greeting, THAT should go first.
Or, you could add a greeting specifically for Breton commoners, and filter it for both categories -- something like "Even though I'm a Breton, I'm getting tired of this place". In that case, your Breton Commoner greeting would have to go above all the others.
I'll leave it up to you which you prefer. Use the arrow keys to move it where you want it, save, and test.
![]()