Dialogue Tutorial

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Getting Started[edit | edit source]

Ok, so you have an idea for a quest or such like and you want to give your NPCs some new stuff to say, but how do you do that? Hopefully this tutorial should point you in the right direction. Firstly what is a quest? Basically quests are used for three main things in the game:

  • Providing general dialogue to the NPCs in Tamriel
  • Quests the player can do in the game
  • Global Scripts.

We'll be focusing primarily on the first of these in this tutorial, though there is often extensive overlap with the second as well.


Ok, so now we have an idea of what a quest is, how do you make your own? This is done in the Quest window, which can be opened by clicking on the 'Q' icon in the icon bar, or via Character->Quests....


When the window opens you will notice a few things. First is the list of tabs across the top. By default the quest window opens at the Quest Data tab. Here is where you set the priorities, name and conditions for your quest, which we will come to shortly. The other thing you will notice is the long list on the left-hand side. This is a list of all the quests in the game, some are simply used for holding references for other things, many are the various quests in the game and some are the generic dialogue.


To create your new quest simply right click somewhere on the list and select new, then enter in the ID you want for your quest (either create a new NPC or use an existing one). I suggest you start with something unique to you, eg a shortened form of your user-name, followed by a mod identifier of the mod you are working on, then the specific quest (you may have more than one in a mod!).


For example, if your user-name is MrOblivion and you are working on a mod to add new quests to the Fighters Guild you could prefix each thing in your mod with MObFG followed by something more descriptive for the quest. In this tutorial we'll have a bash at good old crab killing, so we could call our quest MObFGCrabKill. The advantage of doing things like this, is that it makes all your quests etc. easy to find.


Also before we go much farther, save! Doing so regularly is a good idea.

The Quest Begins[edit | edit source]

Ok, so now we have a nice new quest we need to give it a good name. In the Quest Name box name it something exciting as this is what appears in the player's journal (Note: If you are adding dialogue to things that don't appear in the journal, it isn't strictly necessary to fill this in).

Outline of the Quest Data Tab


Once that's done, you need to set the priority of the quest. This tells the game how important your dialogue is compared to the other stuff in the game. Quests with a high priority have precedence over quests with lower priorities. For example, the greetings that NPCs give you if you are a wanted criminal and those for the main quest are very high and as such will be used over most other quests. Generic greetings and such are low priority and so are only usually said if nothing else applies. For an idea of what priorities quests have see here. I suggest a value of 75 to be about right for most things.


Once that's done you may notice the Script drop-down menu. This is for associating scripts with a quest that will run when the quest is running. The other major feature is the white box grid. This is for general conditions that apply to each line of dialogue within the selected quest. Bethesda seems to add the same condition to each of its quests so we'll do that now. Either right click on the white grid and select new, or click on the new button. You'll see a new condition appear. The one we are interested in is called GetIsPlayableRace. To change it select the new condition then in the drop down menu in the bottom of the grid find the relevant condition.


The rest of the settings should be ok, but we'll run through what they are now so you know for later.

  • The Function Parameters box is used to specify specific reference for various conditions but isn't needed here.
  • The comparison box is your basic mathematical operators: equals, doesn't equal, greater than etc. (See point 7.2 for table). For our GetIsPlayableRace condition, ensure it's set it to ==, so that our NPC can say the line.
  • The value in most cases is binary 1 for yes and 0 for no, but for things like GetGold you would use the amount of gold you want to compare. Just use your common sense to determine whether it's a binary condition or not. In the case of our GetIsPlayableRace condition, make sure it's set it to 1, so that our NPC can say the line.
  • The OR checkbox allows you to check between two conditions to see if either is satisfied, else the game will use AND to check that all conditions apply (Note: The game analyzes OR comparisons first, before AND, so be careful in setting up conditions to do what you want).
  • The Run on target checkbox forces the condition to run on the character that activated the NPC (usually the player) instead of the NPC itself. This is useful for checking to see if a player has got a certain item before saying a relevant line.


We'll be using these more later, so keep them in mind. For the other bits of the quest data tab see here, but for now onto the Topics tab....

I want you to say something![edit | edit source]

This is where the majority of dialogue creation takes place and at first glance can be a bit overwhelming, but don't worry it's not as bad as it looks! There are four main sections to the Topics Tab:

File:DialogTute-topics tab.jpg
Outline of the Topics Tab
  • The Topics List (to the right of the quest list)
  • The Info List (the grid at the top third of the right hand side)
  • The Topic Text (just below the list of tabs)
  • The Response Details (contains several bits we'll cover in due course).


The Greeting[edit | edit source]

Topics are the things that appear as clickable options when speaking to an NPC. Each topic can have several lines of 'Info' assigned, depending on who you're speaking to, the stage of the game/quest etc. One very important topic is the GREETING topic. This is the topic that NPCs say when you first activate them to greet you! Let's add the GREETING topic to our quest now. Right click on the Topics List and select 'Add Topic', then scroll down until you find GREETING select it then click Ok.


Right now the topic is added let's add a line to say. To do this right click (bet you never saw that one coming!) on the Info List grid and select new. This will bring up a new window called the 'Response Window'. The top bit of this is where you want to add the line of greeting you want your NPC to say. Enter in the greeting now and hit enter (don't worry about the other sections for now). If you make a mistake and want to change what the line says just double click on the relevant line.

File:DialogTute-Response.jpg
Our new line in the response window, don't worry about the bottom bit for now


Now we have a line of greeting! Unfortunately as it is now, everyone in Tamriel will say this greeting, so we turn again to those conditions. You'll notice the bottom third of the Topics Tab is very similar to the conditions bit we looked at earlier. Make sure the line is selected then create a new condition. This time we are looking for the GetIsID condition (remember the GetIsPlayableRace condition is already being applied to every line we add in this quest). For the 'function parameter' of the GetIsID condition click the button (will be labeled INVALID) then find the NPC you want to say the line and select it. Now only that specific NPC will say the line. By playing around with the various conditions used you can specify who says what and when.



A new topic of conversation![edit | edit source]

Now we have the NPC greeting sorted, but what about other lines and topics we want to speak to them about? For that we need to create a new topic. To do this go back to the Add Topic window (where you found GREETING), then right click in there and select new. Name your topic (I'll use MObFGAboutCrabs), select it and hit OK and we have a nice new topic. Now, let's add a few bits of info in there, eg. say we have a topic about 'Mudcrabs' you could have one line saying how they had some for dinner earlier and another about how irritating they are when you are sunbathing on the beach.

Making our new topic


Now we have two different lines for the topic, but which one will the NPC say? First of all let's ensure that only the NPC we want says the lines, so add the GetIsID condition to both lines. Now, when determining which line to play, the game starts at the top of the list of info lines and proceeds done until it finds one that satisfies current conditions (If a topic has no lines in it that have all their conditions met, then the topic will not appear in the list of options presented to the player.) In this case, only the top line will ever play; however, we can change that. In the 'Response Details' section of the tab, you will notice a column of checkboxes. The ones we are interested in at the moment are the ones to do with random (i.e. 'Random' and 'Random End'). If you check the random flag on a line of info, the game will check all random Infos that appear sequentially in the NPC's list of possible Infos and chose one at random to be spoken. The 'Random End' checkbox is used if you have two sequences of random Infos end up adjacent to one another. An Info marked Random End will terminate the random set even if the next info is also marked Random.


Now we have our topic and our lines but it will not appear in game until the topic has been added. Now you may have noticed a little box titled 'Add Topics' to the right of the tab. What this does is when the line is spoken it adds any topics listed there to the game, however Do NOT use this to add topics from a default Oblivion topic. By that I mean, if you have a line in a default Oblivion topic, like GREETING, that you want to add a topic from do not use this box. this is due to a bug in the game which fails to utilize this box properly from default topics, such that in game your topics may not be added (for more details of the bug see here). Using the 'Add Topics' box from your own created topics should work fine though. Now you may be thinking how do we add our topic to the game then? We use the result script box, found to the left of the checkboxes.


The Result Script box is used for scripting commands that will run as soon as the line is said. Whilst most functions can be used it is important to note that references can not be declared in a result script box (for more info on scripting see Scripting Tutorials). For our purposes at the moment we only need one simple function. In the result script box enter the line:

AddTopic MObFGAboutCrabs 

where MObFGAboutCrabs is the ID of the topic you want to add. Multiple topics can be added this way if necessary. Whilst this is not the only way to add topics, in most cases it will be sufficient.


Ok, so now when we speak to our NPC, he will say our line and give us a new topic to ask about and he will give us one of two responses at random. If you try this in game, you may notice that the topic option you click has a weird name, the ID you gave your topic. Don't worry though as this is easily changed in the 'Topic Text' bar (just below the tabs). Select your topic and enter into the topic text bar what you want to appear in game, e.g. mudcrabs. It's important to note that you should not change the topic text of the GREETING topic, else you'll mess things up and people will not greet you properly.


Moving On...[edit | edit source]

Now we have a basic understanding of how to do things and what most things are in the topics tab, we are going to make a very simple quest line for the player that will show what most of the other bits of the topics tab are for. The quest we are going to make will involve going to kill a few mudcrabs for their meat, or at least getting their meat from somewhere and what better way than to rid the shores or sewers of crabs!.


Stages of the quest[edit | edit source]

First things first let's make another new topic to ask about that will start us off on our crustacean killing spree, e.g. MObFGCrabSpree, and set the topic text to something more sensible, like 'Crab culling'. Now let's head off somewhere new, the 'Quest Stages' tab! This is where you can control how a quest progresses and what happens as each stage is done. In the empty grid, right click and create six new stages. Each stage should be a number, e.g. 0, 10, 20, 25, 30 and 100. Conventionally, quests start of at a low stage and progress up to the higher stages, usually being completed at 100 (However if required you can have stages 0-255 inclusive!).


Now we have our stages made, we want to now which stage means what in the scheme of the quest. For the purposes of this tutorial the stages made will have the following relevance:

  • Stage 0: Player hasn't spoken to NPC about the mission yet.
  • Stage 10: Set if player refuses the mission.
  • Stage 20: Set if player speaks to NPC and accepts the mission to cull the crabs.
  • Stage 25: Set if player accepts mission having previously declined.
  • Stage 30: Set when player returns to NPC with the necessary amount of crab meat
  • Stage 100: Quest completed! (this stage is not really necessary, as we could call the quest complete at stage 30, but whatever).

Not every stage has to be used as the quest progresses, so if the player accepts the quest straight off, stages 10 and 25 will never be required.

File:DialogTute-Quest Stages.jpg
The Stages Tab outlined


Right, that's the quest planned out, now let's write the entries that will appear in the player's journal for each stage. To do this select the stage, then use our favorite mouse button to create a new journal entry via the grid in the top right (the entry itself is written in the box below, entitled 'Log Entry'!) and enter in something appropriate. We don't need to enter an entry for Stage 100 though as that will be used as more of a housekeeping stage. You'll notice the other major items in the 'Quest Stages' tab are a result script box and a conditions box. We'll be using the result script box a little later as it can be very useful. Conditions are not used as often but are occasionally useful to have a subtly different quest entry depending on what the player has and has done (See the quest MG08 for an example).

Decisions, Decisions[edit | edit source]

Go back to the Topics tab and we'll start creating the dialogue to match the relevant stages of the quest. We've already created a topic about the culling, so let's create a new line of info in there. If we want our NPC to fully explain why she wants us to go around skewering crabs it may take us more characters than the response will let us have. However this isn't a problem, as we can have lots of lines flow into each other. To do this create the first bit of want you want the NPC to say as normal. Once you have done that select the line, then in the 'Response Text' grid part of the Response details outline, right click and create new lines as necessary such that the player is given the option of helping or not. You'll not that the number of lines you have flowing into each other is noted in the column heading '# Resp' of the Info list. If you want to change the order of the lines, select one and hit the left or right cursor key to move it up or down (moving things like this can also be done in the Info list, conditions boxes, the Add topics box and the choices box.)


So now we have presented the player with an option of whether to help or not. To do this create two more topics, one for a positive answer and one for a negative answer (eg MObFGCullYes and MObFGCullNo). Remember to change the topic texts to something that makes sense! Once that is done select the info line about asking for help, then right click on the choices box and find the Yes/No topics we just made and add them (you can add multiple topics at a time by holding down the CTRL key as you click to select, like you can in Windows). If you want to change the order of the options as they appear to the player, i.e. if you want the 'yes' response at the top, use the left and right cursor keys.


The choices box will give the player a list of those topics only, after the line that lists them has been said. Thus it can be used, as we are to give the player an option, or to simulate a conversation between the player and the NPC. Now let's go and create the reactions the NPC will give to our player's answer. Create a new info line in the 'Yes topic' and have the NPC say something suitably appreciative. While you're making the response, glance down the response window till you see the bit about 'Emotion Type' and 'Emotion Value'. These control the facial expression of the NPC as they say the line, obviously our NPC is going to be rather happy the player is helping so select happy from the drop down menu. The value determines how happy , sad etc.. the expression is, low being slightly, high being very. Once the positive answer has been written do similarly for the negative option (remember to set the GetIsID condition!). Obviously if the player declines to help the NPC isn't going to be very happy, so let's terminate the conversation if the player declines. To do this check the Goodbye checkbox of the line said if the player declines.


As the plot progresses[edit | edit source]

Now we need to take care of progressing the quest in light of the player's response. To do that we'll use the Result Script box and the SetStage function. In the result script box for the negative reply add the line:

SetStage MObFGCrabKill 10


For the positive response set the stage to 20 instead of 10. This will add the relevant entries to the players journal. Now we should give the player the option of reconsidering if they decided not to help. To do this go back to the topic MObFGCrabSpree (if you are following what I'm doing). Create a new line, something like "Have you reconsidered, will you help me reclaim my bathing spot?" Set the GetIsID condition, then create another condition. This time find the GetStage condition, set it to your quest and enter the value as 10 to indicate that this line will be said only if the player has declined the mission previously. While we're here, it would be sensible to add the same condition but set to 0, for the line we made in this topic earlier (with careful ordering of the lines, this isn't necessary but better safe than sorry!). Add the yes/no options into the choices box as before.


An alternative way of ensuring a different response to that initially given is to use the 'Say Once' checkbox. In our case, if we check that box of the line outlining the initial mission, the NPC will only ever say that the first time and would not say it the second time, even if no conditions are set. If the line is above the 'reconsider' response this should work nicely. Whilst using stage conditions is best for our use, the Say Once checkbox is useful for having the NPC introduce them self the first time they speak with the player but to subsequently dispense with that formality, and other similar circumstances.


Now let's return to the positive option and create a new line indicating the acceptance and that she's glad we reconsidered. Set the GetIsID condition and also the the GetStage condition, set to 10. In this result script box set the stage to 25, to update the journal (like before to be safe give the other 'yes' line a GetStage condition set to 0). That should be all we need to have the player set off on their quest for those pesky mudcrabs!


We need to account for two scenarios now:

  • The player returns without enough crab meat.
  • The player returns with enough crab meat.


Head back to the MObFGCrabSpree topic and create a new line about the player having enough meat. This time we are going to utilize the OR checkbox in our conditions. Set the GetIsID condition as normal and then create two GetStage conditions, one with a value of 20 and the other 25. Now obviously the quest stage can't be both 20 and 25 at the same time so we need to use the OR checkbox. Move your GetIsID condition to the top of the list, either using the cursor keys or the arrow buttons. Now on the 2nd condition down (doesn't matter which GetStage it is) check the OR box.


The OR checkbox is used to determine how a condition is evaluated with the ones that follow it. Consecutive ORs are treated like a single block when evaluating and have order preference over AND. For example, the condition items ( A AND B OR C AND D ) are evaluated as ( A AND ( B OR C ) AND D ) and not ( ( A AND B ) OR ( C AND D ) ). Essentially in our case we are telling the game this:

GetIsID MyNPC AND (GetStage is 20 OR GetStage is 25)


However we still need to check if the player has enough crab meat! So create another condition and set it as GetItemCount and set the parameter to 'CrabMeat'. Now we want to check how much meat the player has, not the NPC, so check the 'Run On Target' box. I presume you had the NPC tell the player how much meat she wants as proof you've killed enough crabs (if not go back now and say so, unless you want the player to find out by trial and error!). Let's say the NPC wants 7 pieces of meat, so set the value of GetItemCount to 7. However by default this is an equals comparison, but what if the player has hunted down every crab in Tamriel and has 1000's of crab meat! Let's change the comparison to 'Is Greater Than' (>=, for an explanation of the other comparisons see the last section). I'll let you figure out where in the list the condition can be using the logic above. Now create the corresponding response for if the player doesn't have enough crab meat, but use the less than condition instead.


Finishing it off[edit | edit source]

So we have one happy NPC, but what about the reward and such like!? Go back to the response for if the player has enough crab meat. Firstly we have to advance the stage to give the player the journal entry, then we should give the player a reward such as 100 gold, then remove the crab meat asked for. To do this we'll use the result script box:

SetStage MObFGCrabKill 30
player.AddItem gold001 100
player.RemoveItem CrabMeat 7

I'm keeping things as simple as possible script-wise, if you want to learn more check out the scripting tutorials


Let's also have the NPC be so happy they terminate the conversation to go and eat the crab or bathe or whatever, so check the Goodbye box. That's just about it! There's just one or two little bits to tidy up. Head back to the 'Quest Stages' tab and select stage 30. In the result script box for it set the stage to 100. Then select stage 100 and check the 'Complete Quest' box, which will tell the game that the player has successfully finished the quest and move it to the relevant section of the player's journal. It is also good practice, once a quest is finished to stop it. This is more important for quests that have scripts attached to them than our simple thing, but it's a good habit to get into. One thing this does mean is that any dialogue within the quest will no longer be said, so don't stop the quest if you still want NPC's to say some of the lines (for example the general responses about mudcrabs we made earlier). For quests with complex scripts attached it's better to stop that quest and start another one if you want dialogue to still be said.


That's it you should now have a good grasp of the basics of creating basic dialogue and quests! You can quite happily play through and hopefully everything should work, but there are some things to do to add a bit more polish. Of course there are more things you can do to make things more complex and elaborate, just have play, look at other quests to see how they work and see what you can do!

My NPC's are mute![edit | edit source]

The silent type[edit | edit source]

So your NPC's can translate their facial into text, but what if it flies by too fast to read? I recommend using ScripterRon's excellent utility found here, to solve this problem. It has the ability to create silent mp3 files for each of your lines so you have time to read them.


The vocal type[edit | edit source]

Of course you may decide you want to have your NPCs fully vocal and screaming in your ears about their love of crab meat. To do this first you need a voice file. If you have a mic and fancy voicing the NPC yourself, I recommend Audacity as a good free program with which to record. Once you have the voice done, save it as a .wav file (chose 'Export as wav' if using Audacity). Now comes the tedious bit. You need to place each voice file in exactly the right place, with the right name. To find out where and what the file should be, go to your line and double click on it to bring the Response window back up. Now we are interested in the bottom section. Firstly rename the file to whatever it says the 'Voice Filename' should be (remember to keep the extension as it is!).

File:DialogTute-Response.jpg
Finding The path and name for our file


Once you've done that for each line you need to see where the lines should go. This is contained in the grid below, though you'll likely have to scroll across and make the 'Path' column wider so you can see it fully (to widen the column, click and hold the edge of the columns header, and icon should appear if you hover over the right place, then drag to re-size). Create new folders as necessary and move the files in. Now close the response window and reopen it, this refreshes the grid in the response window and you should now see a Y for 'yes' under the column headed 'wav'. Select the line in the grid then check the 'From wav' radio button. Now hit the 'Generate Lip File' button, which will create a file (a .lip) which will make the NPC's lips move in sync with the audio.

Note: The 'Generate Lip File' button is broken version 1.2 of the construction set and so doesn't work. In order to generate the necessary lip files you have to use the original version of the CS.

Construction Set Download Site and CS Wiki

Lip Template - a small .esp file that you load instead of Oblivion.esm when you have the latest oblivion patch, use this to generate the lip files instead of loading oblivion.esm, it is much much much faster. Other than that, everything should work the same, just make sure you are using the old version of the CS, and that it's set up properly.

Forum Thread that discusses how to install CS V1.0 with CS V1.2 and more on the issue

Ok, so far so good. Now we need to convert the .wav files into .mp3 files, which are the ones the game actually plays. This can be a little tricky as the .mp3 file needs to have specific settings, however this handy utility will take care of all that for you. That's it, you can discard the .wav files now as they are no longer needed. If you want to know the settings required for the mp3 see this page, which also contains a little video about getting voices into the game if you need more help.

Common Errors[edit | edit source]

I only see rumors!/My topics aren't showing[edit | edit source]

Ensure that you have added your topics properly and remember not to use the add topics box if you want to add them via a default line!

A side note: Some Topics that Are part of a quest that has ended, are not able to be re-added. In my most recent Mod I recreated a pre-made character, but the topic I wanted to use Was a part of the Quest Dark01Knife, and Once the quest was completed, The topic became unavailable. So to add the topic to my NPC, I had to Copy the topic to a new quest that I had created. Then I had to Look for the Original NPC's dialog voices and .lip files in the BSA File "Oblivion - Voices2", and then extract Them. I then had to Rename the Voice files and .Lip files to the File name that was referenced Here so that they could Be heard as well.

NPCs won't say my stuff[edit | edit source]

Check your quest priority is high, else everything will be said before your stuff!


Everyone is saying my stuff[edit | edit source]

Tut tut! You didn't specify who was to say your line did you, so everyone is. Go set GetIsID or a similar condition!


Random bits that may be useful[edit | edit source]

The Filtered Dialogue Window[edit | edit source]

You may have noticed there is another window in which dialogue can be edited from, that is accessed either by the speech bubble icon, the Dialogue button of the 'Edit NPC' window or Character->Filtered Dialogue. Whilst this window can be used for editing dialogue it is much safer to do it in the quest window instead, as it helps safeguard against unclean dialogue. The Filtered Dialogue window can be useful in seeing exactly what it is possibly for a specific NPC to say under any possible circumstance.


Condition Comparisons[edit | edit source]

Comparison What it means
== Is equal to
!= Is not equal to
> Is Greater Than
>= Is Greater Than or equal to
< Is Less Than
<= Is less Than or equal to


Info List[edit | edit source]

Below are explanations of the slightly less obvious column headers of the Info list that haven't already been noted.

  • Flag
Flag What it means
G Goodbye box checked
S Say Once box checked
R Random box checked
E Random End box checked (if Random box also checked, only this will appear as the random box is redundant)
  • Disposition: Filled in if the GetDisposition condition is set.
  • NPC: Filled in if the GetIsID condition is set.


Useful Links[edit | edit source]