Maybe I can shed some light on how to get this done. For this example I'm going to assume that the NPC in question has the ID Illy_JohnDoe. I want to keep track of the topic "background" and I want/need to do so by using a variable. So I need to create a variable. Now there are two kinds of variables: local variables and global variables. A local variable is declared (created) in a script, and that script is attached to the affected NPC. A most simple script could look like this:
begin Illy_JohnDoe_Script; (In case you didn't already know: Morrowind considers every line that is preceded by; as a comment.); The script name is not important. I tend to use the same name as the affected object and add "_Script" to it.; This script's sole purpose (for now) is to declare a variable, so let's do that:short BackgroundStatusend
If you want more NPCs than just Illy_JohnDoe to react to that variable, it's a good idea not to use a local variable but create a global variable instead. This is done in the "Gameplay" menu under "Globals...". When you open that dialog window, you'll notice three possible types of variables: "short", "long" and "float". In the local script, I made Illy_JohnDoe_BackgroundStatus a "short" variable. Why? - Because a "short" is sufficient here. "Short" variables allow for about 65,000 possible values (all integer) which is more than enough to keep track of a dialog topic. "Long" variables would allow for approx. 4 billion possible values (still integers) and "float" variables allow floating point calculations.
For this example, I will use the
global variable. It allows the same possibilities as a local variable plus it allows other NPCs an easy access to its value. You could for example have another NPC Illy_JaneDoe check for the global variable "Illy_JohnDoe_BackgroundStatus" and have her say:
"My husband may like to have his ear talked off, but I like short announcements. So let's hear it."
if you told Illy_JohnDoe about your background and have her say:
"Oh hello, I'm Jane. Pleased to meet you."
if you haven't talked to Illy_JohnDoe.
So, I'm going to use a global "short" variable and I'm going to call it "Illy_JohnDoe_BackgroundStatus". Next thing I need to decide on, is which value means what. "0" is the default value, so I'll use that as my starting point.
This is the complete list of values I'm going to use for "Illy_JohnDoe_BackgroundStatus":
0 = Either you haven't talked to John Doe at all or you answered "maybe" when he asked you to tell him your background
1 = You decided to tell John Doe about your background
2 = You decided not to tell about your background.
So, let's fire up the CS's and open Dialogue. Find the topic "background" and create a new entry that you filter for the NPC "Illy_JohnDoe":
Information is a precious merchandise. If you'd like to hear mine, you have to tell me about yours as well.
I want John to say this line on the first encounter and for as long as the player hasn't decided on whether to tell him his/her own background. So I add a condition in the "Function/Variable" section of the Dialogue window: "global" "Illy_JohnDoe_BackgroundStatus" "==" "0"
Now I want to be able to answer him, so I need to add a choice to the Result Box:
Choice, "Sure, I'll tell you.", 1, "No way I'm going to tell you", 2, "Well, maybe.", 3
If I want John to react to my answer, I need to provide a dialogue entry for each of my answers. All these entries must be positioned above my initial entry. I'll start with the positive answer. I'll create a new entry for the topic "background" and filter it for the NPC "Illy_JohnDoe", "global Illy_JohnDoe_BackgroundStatus == 0" and "Funtion Choice == 1". (If you can't follow me here, just say so.)
Oh goody, I like a good tale.
According to my own plan, I now need to set "Illy_JohnDoe_BackgroundStatus" to 1. In order to do so, I'll enter this into the result box:
set "Illy_JohnDoe_BackgroundStatus" to 1
Next, I'll create a new entry for the topic "background" and filter it for the NPC "Illy_JohnDoe", "global Illy_JohnDoe_BackgroundStatus == 0" and "Funtion Choice == 2" (the negative answer)
Suit yourself. If you won't tell me about your background, I won't tell you about mine.
And According to my plan, I now need to set "Illy_JohnDoe_BackgroundStatus" to 2. In order to do so, I'll enter this into the result box:
set "Illy_JohnDoe_BackgroundStatus" to 2
And finally, I'll create a new entry for the topic "background" and filter it for the NPC "Illy_JohnDoe", "global Illy_JohnDoe_BackgroundStatus == 0" and "Funtion Choice == 3" (the indefinite answer)
Alright. Come back when you have come to a decision
And according to my plan, "Illy_JohnDoe_BackgroundStatus" need to be set to 0. Well, it is already set to 0. It began with 0 and hasn't been changed yet, so I don't need to enter anything into the result box.
Alright, now I have set the scenery, I need to take the next step and add dialogue entries for "Illy_JohnDoe_BackgroundStatus" == 1 and "Illy_JohnDoe_BackgroundStatus" == 2. Here's the first one, filtered for the NPC "Illy_JohnDoe" and "global Illy_JohnDoe_BackgroundStatus == 1"
A goody! I like to listen to other people's background. Let's hear yours...
I could now elaborate and have him actually tell about his background, but I'll skip it in this example.
Then I'll add yet another dialogue entry for the topic "background" and filter it for the NPC "Illy_JohnDoe" and "global Illy_JohnDoe_BackgroundStatus == 2"
Oh you old grudge. What makes you think I'd tell you about me if you can't be bothered to tell me about yourself.
I hope I could clear things up a bit. If it's still vague to you, just ask.
B