Some dialogue questions

Post » Fri May 27, 2011 9:17 pm

Thanks very much Kir I appreciate the help - that makes sense to me - except for the bit about variable but then my skill level for scripting is like a 5 and you are right it is for another topic - right now I just needed to understand the continue choices method from that mod - thanks again very much for helping :)
User avatar
Daramis McGee
 
Posts: 3378
Joined: Mon Sep 03, 2007 10:47 am

Post » Sat May 28, 2011 6:35 am

As to variable a couple of examples may clear things up a little bit. For the companion mod I'm working on I've got a couple of situations where variables help get the NPC doing what they need to do.

The first example is for a set of scripted events. This NPC likes clothes and will, the first time she is taken to a clothier, ask the player to buy her a new outfit (never happens with real women but this is a fantasy game). These scene occurs in several stages to to control the scene the NPC's script contains the variable dialogFlag. An activator placed in the clothier's cell checks to see if Carrie is present, sets this variable and forces conversation with the NPC. First we have the NPC's script:

begin NICI_Carrie_Mainshort dialogFlag;....;much more script not relavent;end


Then the script for one of the activators:

begin NICI_shopping_BMHshort stateif ( state == 0 )   if ( getDistance NICI_Carrie <= 250 )	  set NICI_Carrie.dialogflag to 10	  NICI_Carrie->forceGreeting	  set state to 1  endelseIf ( state == 1 )  ; more code not relavant to this exampleendIfend


And now for the dialog. These are listed in the same order as they are positioned in the CS topmost 1st. All these are Greeting 1 greetings

"Oh thank you so much!"
id: NICI_Carrie
cell: "Balmora: Milie hastien Clothier"
[function][choice][=][1]
result:
; this triggers the unlisted part of the script above which completes the transaction
set NICI_shopMarkerBMH.state to 3
player->removeItem gold_001 250
NICI_Carrie->addItem gold_001 250

"hrmph Well I'm not leaving until you do."
id: NICI_Carrie
cell: "Balmora: Milie Hastien Clothier"
[function][choice][=][2]
result:
AIWander 0 512 0 20 20 20 0 20 0 20 0 ; these number are faked (I don't have MWSFD with me)
set dialogFlag to 12

"Oh just love shopping here! Can you give me 250 gold so I can buy something?"
id: NICI_Carrie
cell "Balmora: Milie Hastien Clothier"
[local][dialogFlag][=][10]
results:
set dialogFlag to 11
choice "Yes" 1 "No" 2

"Not now I'm shopping"
id: NICI_Carrie
cell "Balmora: Milie Hastien Clothier"
[local][dialogFlag][=][11]
results:
goodbye

"Did you come back with some gold?"
id: NICI_Carrie
cell "Balmora: Milie Hastien Clothier"
[local][dialogFlag][=][13]
results:
set dialogFlag to 11
choice "Yes" 1 "No" 2


In this situation the variable is used to keep track of Carrie's current state of mind. The actuall value are arbitrary and any number could have been used. In this case 10 is used when carrie needs to ask for gold, 11 is used after getting the gold & before having completed her purchase, 13 is for when the player talks to her again after denying her request. I'll have to reread & revise this at another time my lunch break is over. Hope this helps
User avatar
Kathryn Medows
 
Posts: 3547
Joined: Sun Nov 19, 2006 12:10 pm

Post » Fri May 27, 2011 10:41 pm

Here's another example of how a variable is used with scripting & dialog. This comes from a quest where the character has to accomplish three tasks the order in which these are done does not matter. The NPC needs to know when all three tasks are done to give the quest completion dialog.

First a script, this script just contains the variable to track when each task is done:

[code]begin NICI_mystery_tracker

short noteFound
short ringFound
short vialFound

end[/end]

It is worth noting that until a number is assigned to a variable it's value is 0 which is the same thing as FALSE. Now some dialog this are all in the new topic innocence:

"I can see the difference in these two vials. Though this, by itself isn't enough proof."
id: nileno dravayn
[journal][NI_MurderInvestigation][<][20]
[local][vialFound][=][0]
[item][NICI_poison_vial][<=][1]
[item][NICI_carries_vial][<=][1]
results:
Journal NI_MurderInvestigation 11
set vailFound to 1


"Why would this ring have been there? Perhaps you should ask it's rightful owner how it came to be at the scene of the crime."
id: nileno dravayn
[journal][NI_MurderInvestigation][<][20]
[local][noteFound][=][0]
[item][NICI_dranas_ring][<=][1]
results:
Journal NI_MurderInvestigation 13
set noteFound to 1

"So this note..."
id: nileno dravayn
[journal][NI_MurderInvestigation][<][20]
[local][noteFound][=][0]
[item][NICI_bk_notefromavalin][<=][1]
results:
Journal NI_MurderInvestigation 15
set noteFound to 1

"Taken together all this evidence is compelling..."
id: nileno dravayn
[journal][NI_MurderInvestigation][<][20]
[local][noteFound][=][1]
[local][vialFound][=][1]
[local][ringFound][=][1]
results:
Journal NI_MurderInvestigation 20


Each of these lines of dialog test a variable in the NPC's script. If that variable is 0 and the player has the appropriate item then the variable is set to 1 causing that line of dailog to fail the next the the player selects the topic. A journal entry records the event. With just the journal entry it would force the player to do the quest in the dialog order.
User avatar
~Amy~
 
Posts: 3478
Joined: Sat Aug 12, 2006 5:38 am

Post » Sat May 28, 2011 6:21 am

Oi Nicholiathan - you're overloading me :)

Actually these are cool examples but it's going to take me some time to reorganise them in my mind - Currently i am still agonising over structuring a simple topic - background. Instead of the usual name rank and serial number i want to have a conversation in which essentially the NPC says "I'll tell you my background if you tell me yours" This then splits into the three standard replies - yes, no, maybe - maybe leads to a deadend for the conversation but yes or no = choices which each have their own reply and create seperate addtopics.

What i want to do is have the game recognise that if a yes or no is selected then provide a different reply for the next time background is selected - eg for the no path "Haven't we discussed my past before? I'm sure you said you wern't interested in knowing let's leave it at that." this may then extend into a choice of sorry which points back to the yes choice or no which just ends the conversation.

However I can't think of using anything but the journal to use as the trigger for adjusting the conversation eg have a journal entry I asked X about their background but they said i needed to tell them a bit about me first = 10 then depending on whether you say yes or no it would say I said I wasn't interested in talking about my past X didn't seem insulted but neither did they tell me about themselves = journal 20 in the topic if journal = 20 force the secondary greeting.

Does that make sense?

I'm just trying to avoid having circular conversations where you click on a topic and read the same old thing again - for instance I'd like to add a few random replies such as - [Sighs] Haven't we discussed this before? Alright let me tell you again but write it down this time - perhaps in a journal? I just need to know how to flag that a conversation has taken place and if it is being repeated as this could lead to some nice disposition setting scenarios.

Um I do appreaciate your post Nicholiathan - I'm still learning to crawl though :)
User avatar
Eliza Potter
 
Posts: 3481
Joined: Mon Mar 05, 2007 3:20 am

Post » Sat May 28, 2011 4:07 am

What i want to do is have the game recognise that if a yes or no is selected then provide a different reply for the next time background is selected - eg for the no path "Haven't we discussed my past before? I'm sure you said you wern't interested in knowing let's leave it at that." this may then extend into a choice of sorry which points back to the yes choice or no which just ends the conversation.

However I can't think of using anything but the journal to use as the trigger for adjusting the conversation eg have a journal entry I asked X about their background but they said i needed to tell them a bit about me first = 10 then depending on whether you say yes or no it would say I said I wasn't interested in talking about my past X didn't seem insulted but neither did they tell me about themselves = journal 20 in the topic if journal = 20 force the secondary greeting.

Does that make sense?


It makes perfect sense and is actually a better use for a variable in dialog than my examples (unless you want the full course of the conversation recorded). This type of conversation would be written in much the same manner as the pick-your-own-adventure type of books are written. They work the same way you describe. A bit of story is given then the reader is instructed allong the lines of "If you refuse to share your own background turn to page 9. If you tell him your story turn to page 12."

The best approach is to start from the beginning of the conversation. When writting you choice responses update your conversation tracker (you can use either a variable or journal entry) in the result box for the reply to that choice. Then next section of conversation goes above the previous sections and is filtered to the tracker you updated in the choice's reply. So this conversation might look something like this:

"It was horrible...."id: NPCperson[journal][conversationJournal][=][10][function][choice][=][1]result:journal conversationJournal 30"That's interesting. After that I moved away from my home...."id: NPCperson[journal][conversationJournal][=][0][function][choice][=][1]result:journal conversationJournal 10choice "ask about the fire" 1 "inquire what happened to the guar" 2"Well that's not very considerate of you is it?"id: NPCperson[journal][conversationJournal][=][0][function][choice][=][2]result:journal conversationJournal 20"I grew up... But what about you %PCName?."id: NPCperson[journal][conversationJournal][=][0]results:choice "tell her your story" 1 "refuse" 2



When writting and entering start at the bottom and as the conversation progresses go up on the list. Notice that "It was horrible" and "That's interesting" are both filtered for choice = 1 and that the journal entry decides between the two options. Using a journal requires a seperate entry in the journal for each point of the conversation. Using a variable you accomplish the same thing without needing to keep so much detail in the journal. To do so change the conditions form [journal][journalID][=][X] to [local][variable][=][X]. In the conditions change "Journal journalID X" to "set variable to X" By using a variable to keep track of the conversation the journal wouldn't need to be updated for every decision made in the conversation.

I hope I haven't further confused the matter.
User avatar
Noely Ulloa
 
Posts: 3596
Joined: Tue Jul 04, 2006 1:33 am

Post » Sat May 28, 2011 8:05 am

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
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Sat May 28, 2011 9:25 am

It makes perfect sense and is actually a better use for a variable in dialog than my examples (unless you want the full course of the conversation recorded). This type of conversation would be written in much the same manner as the pick-your-own-adventure type of books are written. They work the same way you describe. A bit of story is given then the reader is instructed allong the lines of "If you refuse to share your own background turn to page 9. If you tell him your story turn to page 12."


Thanks Nicholiathan - I liked how you picked up how I am planning to structure the conversation :) - I kinda like being involved in the conversation myself rather than just topic linking and I'm keen to remove circular dialogue - I personally find it a little immersion breaking to ask the same NPC the same question as many times as i want without them getting annoyed at me - i also am a svcker for random replies.


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:

if you told Illy_JohnDoe about your background and have her say:

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":

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.)

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)

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)

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"

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"


I hope I could clear things up a bit. If it's still vague to you, just ask. :)

B


Thanks bhl - am starting to understand - i regret I've typically run away from learning scripting or any language for that matter though i seem to have no problem with excel formulae and nested if statements.

I understand that the journal acts as a variable and can be used 1-100

I also can grasp what Nicholiathan said about having an activator in a room that forces conversation

Globals are a bit blurry to me - firstly I thought modders preferred not to have globals added arn't they running all the time in every cell checking to see if the condition is true or not? Versus a local which only works in a single cell? Did I get that right?

I don't really understand how float works but that's ok as i don't think I need to just yet - the bit I'd like to know is once you make the variable script is it attached to the NPC via the NPC creation window or is it being attached via the dialogue?

As a seperate question in the Journal there is a restart tickbox - i undersatnd how the Quest name and finished tick boxes work but there is nothing in the help file that describes how to use the restart - I presume it allows you to begin the quest all over again?
User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Sat May 28, 2011 7:35 am

Gloabl variables always exist, but the resource hit is minor. Global scripts can be started and stopped, so they don't have to always run.

If you understand scientific notation, that's basically how floats are stored (scientific notation turns 4587 to 4.587 X 10^3). A variable on an npc's script belongs to that npc. Within the script and in the npc's dialogue, the variable can simply be acessed by name. If you want to access the variable in another script, you use it like this:
Illy_JohnDoe.background


I'm not sure about the "restart" box. I haven't heard of it being used, but I've spent more time in the general and hint forums than here.
User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Sat May 28, 2011 10:25 am

Thanks bhl - am starting to understand - i regret I've typically run away from learning scripting or any language for that matter though i seem to have no problem with excel formulae and nested if statements.

Then you should be just fine with Morrowind dialogue. Basically, it consists of sorting and filtering (if statements as in "if Journal MyQuest = 1" or "if global Illy_JohnDoe_Background > 0"). If scripting is a complete riddle to you, don't worry: There are enough scripters here to help you. Or how about a collaboration like Emma and Grumpy did it? :)

I understand that the journal acts as a variable and can be used 1-100

The Journal can use even more values. In RoHT, the "House Telvanni Grasps Power" quest goes up to Journal Index 420 (44 steps total). I have never tested how many values one Journal topic (quest) can store, but I suspect it to be around 65,000 (like a short variable).

Globals are a bit blurry to me - firstly I thought modders preferred not to have globals added arn't they running all the time in every cell checking to see if the condition is true or not? Versus a local which only works in a single cell? Did I get that right?

You're mixing up global variables with global scripts. It is true that a global script is running all the time once it is started. A global variable on the other hand is only taking up a bit of memory and has virtually no influence on the game's performance.
A local script is running only when the PC is in the same Cell as the local script's host (an activator, NPC, ...). And a local variable is only present within its declaring script and only available for its calling host (the activator, NPC, whatever that holds its declaring script).
(Plea to more knowledgable modders: Please leave it at that for now. For a new modder it is confusing enough.)

I don't really understand how float works but that's ok as i don't think I need to just yet - the bit I'd like to know is once you make the variable script is it attached to the NPC via the NPC creation window or is it being attached via the dialogue?

That variable-declaring script needs to be attached to the NPC via the NPC creation window.
On integers and floats: An integer is a "whole number", e.g. 1 or 2 or 4050 while a float is a fraction, e.g. 0.5 or 1.26 or 23.5367. In Morrowind, you'll usually need float variables for keeping track of time or moving an object by script.

As a seperate question in the Journal there is a restart tickbox - i undersatnd how the Quest name and finished tick boxes work but there is nothing in the help file that describes how to use the restart - I presume it allows you to begin the quest all over again?

As I have understood it, this checkbox allows you to "ressurect" a finished quest. "Resurrect" as in "reopen the quest": When you set the "Finished" checkbox, a quest will leave the list of your active quests. By using the "Restart" checkbox, it will reenter that list. I have never used it so far and could only imagine to use it as a surprise element.

B
User avatar
Sunnii Bebiieh
 
Posts: 3454
Joined: Wed Apr 11, 2007 7:57 pm

Post » Sat May 28, 2011 12:43 am

Actually, Restart is more than a novelty. It is used to make a quest active again in the player's journal after first declining a quest and then later accepting the quest. I will use it to temporarily close a quest (so it does not appear active) during a long delay that does not require any player input between stages of a quest, or when the quest can be extended after the primary quest is completed.

The journal structure might look like this:

Index  Type   Text0	   N	 Name of quest10			So-and-so needs my help.15	  F	I told So-and-so that I did not have time.20		   I agreed to help So-and-so.25	  R	I decided to help So-and-so after all.100	 F	So-and-so thanked me for my help.


Journal entry 20 and 25 do not have to be different. The normal entry for accepting the quest could be the same as that recorded if the player first declines and later accepts. But in that case you would want to make the quest Restart at that point.
User avatar
CHARLODDE
 
Posts: 3408
Joined: Mon Apr 23, 2007 5:33 pm

Post » Sat May 28, 2011 2:57 am

Thanks bhl and cyran0

I've started reading the scripting guide to get a better grasp of the basics - I had kinda wanted to avoid scripting if possible but it seems unavoidable - like owning a car but not knowing how to change a tyre I suppose.

After much agonizing over the sequence of dialogue I decided to just load some up and do some tests to see if it was working - I began with greetings for one of my Publican's - now I know Publican greetings are under greetings 7 so I made a new entry at the top of the list

This is set by function for talked to PC = 0 - so a first time greeting.

This is followed by 5 greetings set at dis 40 Global random < 20, 40, 60, 80 and one with no function just at dis 40

These are followed by 5 greetings for dis 20 also set to Random

When i went to test the firsttime greeting worked

http://img223.imageshack.us/img223/541/sumikospeaks.jpg

however i then got an error when i clicked on her again to test the next greeting - so back into the CS I go and run the test errors button and get a message

Script Dialogue CompileAndRun
You need to enter a text message on line 1.
Compiled script not saved.

Yet how can this be as there obviously was a text message for the first greeting as evidenced by the screen shot?


Edit: I found the problem I was trying to be too clever too early and add a sound file to one of the greetings result boxes - once i removed it there were no errors - will stick with getting the basic dialogue in first and then when i get more competent look to enhance it
User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm

Post » Fri May 27, 2011 11:58 pm

Alright - have loaded up my first NPC's generic topics and been testing them. The CS is quite good at telling me if I have an error and I'm starting to work out the different error types.

But this one has me puzzled - I have a multichoice result where two of the replies mention the palyers race - Choice "Even though I am %pcrace blahblahblah" 1

I don't get an error message in the CS but of course when I test in game it doesn't replace %pcrace with the player's race it just reads %pcrace. ?
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Fri May 27, 2011 11:32 pm

Alright - have loaded up my first NPC's generic topics and been testing them. The CS is quite good at telling me if I have an error and I'm starting to work out the different error types.

But this one has me puzzled - I have a multichoice result where two of the replies mention the palyers race - Choice "Even though I am %pcrace blahblahblah" 1

I don't get an error message in the CS but of course when I test in game it doesn't replace %pcrace with the player's race it just reads %pcrace. ?


Unfortunately %PCRace, %PCName and so forth only work in messageBox commands or in the dialog text, not in the choice text. You can work around this by making seperate dialogs for each race. For instance filter if for Race = Bretton & and in the results include - choice "Even though I am a Bretton..." 1. Then copy the same dialog change the race filter to Nord and the result box to - choice "Even though I am a Nord..." 1. A bit of a pain but it works. If you're trying to get the player's race you can filter by the value of [global][PCRace][=][X] where x is the number for the different races:

Argonian = 1
Breton = 2
Dark Elf = 3
High Elf = 4
Imperial = 5
Khajiit = 6
Nord = 7
Orc = 8
Redguard = 9
Wood Elf = 10
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Sat May 28, 2011 1:10 am

Argonian = 1
Breton = 2
Dark Elf = 3
High Elf = 4
Imperial = 5
Khajiit = 6
Nord = 7
Orc = 8
Redguard = 9
Wood Elf = 10

And a general one for 0 - just in case you're playing a custom race...
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Fri May 27, 2011 7:59 pm

Unfortunately %PCRace, %PCName and so forth only work in messageBox commands or in the dialog text, not in the choice text. You can work around this by making seperate dialogs for each race. For instance filter if for Race = Bretton & and in the results include - choice "Even though I am a Bretton..." 1. Then copy the same dialog change the race filter to Nord and the result box to - choice "Even though I am a Nord..." 1. A bit of a pain but it works. If you're trying to get the player's race you can filter by the value of [global][PCRace][=][X] where x is the number for the different races:

Argonian = 1
Breton = 2
Dark Elf = 3
High Elf = 4
Imperial = 5
Khajiit = 6
Nord = 7
Orc = 8
Redguard = 9
Wood Elf = 10


Thanks Nicholiathan (and Evil Eye) I was trying to reduce my number of entries hence the shortcut of %pcname - I've read that
I really want to thank all who have been posting replies to me in this thread - I'm sure there are going to be more questions later however I'm really enjoying loading in dialogue and testing it - when topics don't show up I generally now realise what I've missed - as in assigning the wrong id or forgetting to include a greeting for a class.

I am finding it takes far longer to load in dialogue than I ever anticipated - often because I use choice or random a lot - is there any smart way to add dialogue quicker - I haven't tried the import functions yet nor Wrye's function in mash but thought I'd ask how you all deal with dialogue - I have tried to keep my mod manageable by limiting the number of NPC's however even just getting the standard topics loaded with their own unique backgrounds and advice seems to take a long time.

Here's http://img21.imageshack.us/img21/7121/sumatra.jpg- she runs a restaurant and has a few tales to tell of her own - the Sumiko referred to is a key NPC to the mod and works upstairs in the bar. I was quite pleased with testing Sumatra as I nested random responses amongst her choices and they worked well. Am trying to get less generic dialogue going as much as possible :) And thanks to an earlier question about ClearInfoActor have kept the journal clutter free - so thanks again to those who have replied - it has been much appreciated :)
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Sat May 28, 2011 12:09 am

The text-define for a MessageBox is ^PCName. That is probably what you read. I considered this when you posted the original problem. Since the contents of the results section of dialog are handled as scripts and 'choice' is a script function I thought ^PCName (or ^PCRace) would work as it does with 'messagebox'. But my test proved I was wrong. I think you will have to use the multiple entry approach proposed by Nicholiathan.

Postscript: I agree, it does take a surprisingly great amount of time to enter and filter dialog in the editor.
User avatar
Rodney C
 
Posts: 3520
Joined: Sat Aug 18, 2007 12:54 am

Post » Sat May 28, 2011 4:48 am

It looks like you've got a raw diamond in the works here, Illy. I like what I see so far. :goodjob:
I am finding it takes far longer to load in dialogue than I ever anticipated - often because I use choice or random a lot - is there any smart way to add dialogue quicker - I haven't tried the import functions yet nor Wrye's function in mash but thought I'd ask how you all deal with dialogue - I have tried to keep my mod manageable by limiting the number of NPC's however even just getting the standard topics loaded with their own unique backgrounds and advice seems to take a long time.

The only thing I know of, is Neko's http://neko.freeshell.org/MorrowindMods. I'm not sure how it works, and I haven't used it myself. When it comes to writing Morrowind dialogue, I'm a bit old-fashioned and use only the CS. What I find really useful, though, is having http://i271.photobucket.com/albums/jj158/bhlmods/RoHTDialogue.jpg: one for "Topic", one for "Greeting" and one for the "Journal". That saves an aweful lot of switching tabs, but I wouldn't want to do it with a single monitor.

B
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Sat May 28, 2011 9:25 am

Here's http://img21.imageshack.us/img21/7121/sumatra.jpg- she runs a restaurant and has a few tales to tell of her own - the Sumiko referred to is a key NPC to the mod and works upstairs in the bar. I was quite pleased with testing Sumatra as I nested random responses amongst her choices and they worked well. Am trying to get less generic dialogue going as much as possible :) And thanks to an earlier question about ClearInfoActor have kept the journal clutter free - so thanks again to those who have replied - it has been much appreciated :)


That is some amazing work I'm very impressed with your writing. I can hardly wait to start downloading your work.
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Sat May 28, 2011 5:09 am

It looks like you've got a raw diamond in the works here, Illy. I like what I see so far. :goodjob:

The only thing I know of, is Neko's http://neko.freeshell.org/MorrowindMods. I'm not sure how it works, and I haven't used it myself. When it comes to writing Morrowind dialogue, I'm a bit old-fashioned and use only the CS. What I find really useful, though, is having http://i271.photobucket.com/albums/jj158/bhlmods/RoHTDialogue.jpg: one for "Topic", one for "Greeting" and one for the "Journal". That saves an aweful lot of switching tabs, but I wouldn't want to do it with a single monitor.

B


Thanks for the tip bhl - i downloaded Neko's Dg - had to do a search on ES as I couldn't connect via your link - um - you know how I'm still trying to grasp scripting - well this is a command line program - I'm sure it's a blast for someone like john.moonsugar or Yacoby but I have so grown up on GUI's. It would be quicker for me to do the whole painful line by line entry. I have quite a good rythm going now - I enter all the topics into a spread sheet which has drop down lists for the different variables and have boxes for info/response and results. this enables me to run the spellchecker down the column and then copy and paste into the CS - I have two monitors as well :)


That is some amazing work I'm very impressed with your writing. I can hardly wait to start downloading your work.


Aw shucks Nicholiathan - I don't know what to say... except don't hold your breath - it took me about 4 hours to load up the generic topics for my first NPC -

I've been thinking about the story for over a year now and wrote most of it over last xmas including the plot arcs and the backstories of each character. Though they do get a bit of polishing and revision as I enter the background topic into the CS. And have recently been getting some more info from the Lore forums to fill in some detail.

There is a cast of about 50 NPC's split into 3 main characters who drive the storyline 6 supporting characters who each have their own side stories and the rest who are entangled in either the main plot or side stories. I suspect based on how long it takes to load up one character there is a few months typing here and then another month testing - however I do aim to get it finished this year. Have tried to keep it manageable as i didn't wan to bite off more than I could comfortably swallow so to speak.

I do have one more question :)

Does it matter what order you enter random responses - for instance do they need to run 20, 40, 60, 80 (nothing) top down (as in 20 being the first entry and 40 below it as seen in the cs) or can they be done in reverse? hope that makes sense
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Sat May 28, 2011 8:09 am

Thanks for the tip bhl - i downloaded Neko's Dg - had to do a search on ES as I couldn't connect via your link - um - you know how I'm still trying to grasp scripting - well this is a command line program - I'm sure it's a blast for someone like john.moonsugar or Yacoby but I have so grown up on GUI's. It would be quicker for me to do the whole painful line by line entry. I have quite a good rythm going now - I enter all the topics into a spread sheet which has drop down lists for the different variables and have boxes for info/response and results. this enables me to run the spellchecker down the column and then copy and paste into the CS - I have two monitors as well :)

Hm, Neko's page works for me. It takes a few seconds to start loading, but it does eventually load. Anyway, I'm glad you found it elsewhere. And yes, it looks rather intimidating if you are used to GUIs. Your system of using a spreadsheet sounds quite good as well. I wish I had had that idea a few months earlier - would have saved me exporting dialogue for proofreading. On the other hand...on which screen would I have put the browser to look up vocabulary in leo.org? That may not be important for a native speaker, but it did help me a couple of times.
Concerning scripting: I already said that there are a lot of good scripters here, so don't despair of it. If you need help with a script just say so, and you will get help. You wouldn't be the first dialogue modder who doesn't like scripting. :)

I've been thinking about the story for over a year now and wrote most of it over last xmas including the plot arcs and the backstories of each character. [...]

Well, you seem to have a thoroughly planned storyline. That's very good, as you won't maneuver yourself into a cul-de-sac, storywise. A friendly piece of advice, though, learned from experience :whisper: :Don't give estimates on when you plan to finish your mod. I did it once, and I have since exceeded it by a year and a half. Unrealistic ETAs only fuel false hope in a release date. Anyway: Keep up the great work!

Does it matter what order you enter random responses - for instance do they need to run 20, 40, 60, 80 (nothing) top down (as in 20 being the first entry and 40 below it as seen in the cs) or can they be done in reverse? hope that makes sense

That depends on how you filter them. If you filter for "random == 20" or "random == 40", it doesn't matter. But if you are filtering for "random <= 20" or "random <= 40", it does matter. You should in fact filter for a range of values (<= or >=), because it is unlikely that a random number will be exactly 20, for example. It might be 17 or 9 or 43, but hardly ever exactly 20 or 40. So if you filter for a range of values, you need to read your dialogue lines like Morrowind reads them: from top to bottom. If you create a random number from 0 to 80 and filter for "random <= 80" in the first line, that line is always true, and no further line will ever be read.
Example:
Let's say that the random function returns "46". Now let's assume that you filter your dialogue for "random <= 80" in the first line of dialogue. Is 43 <= 80? Yes, it is, so this dialogue line's conditions are met, and it will be shown. No line further down the topic will even be read, let alone be shown.
New assumption: Let's say that the random function again returns "46". Now let's assume that you filter your dialogue for "random <= 20" in the first line of dialogue. Is 43 <= 20? No, it isn't, so this dialogue line's conditions aren't met, and the next line will be read. Let's assume the next line is filtered for "random <= 40". Is 43 <= 40? Nope. So on to the next line. Let's assume the next line is filtered for "random <= 60". Is 43 <= 60? Yes, it is. So, in this case, the third line of dialogue will be shown. The first example (filtering for "random <= 80") would always have shown the same line of dialogue.

B
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Sat May 28, 2011 9:33 am

The order needed, or whether they have to be in order, depends on how you set the conditions. You need to make sure that the top stuff doesn't block the bottom, as it is always started from the top. The stuff you saw in the CS uses [variable] < [number], so the order they needed be placed is smallest first. If you use [variable] > [number] the order should be largest first. Order wouldn't matter if you gave 2 condition checks per line, but that would be more work and easier to mess up.
User avatar
Celestine Stardust
 
Posts: 3390
Joined: Fri Dec 01, 2006 11:22 pm

Post » Sat May 28, 2011 8:50 am

Thank you bhl and Narfblat for the explanations :)

I had something odd happen today - I went to add a new journal entry and everything seemed fine then I noticed at the top of the Journal list there was now an entry that read Empty deleted - but I didn't create any empty entries nor did I delete any? I then added a new journal entry which again worked fine but another empty/deleted popped up - when I add a new journal i just right click in the journal column and select add new. Am using a prefix for my entries and they work fine in game during tests.

Is there some way i can prevent this happening and some way to clean those out?
User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am

Post » Fri May 27, 2011 9:08 pm

That's just a little quirk in the editor. It seems to be harmless though. They should automatically be removed next time you load your mod in the editor.
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Sat May 28, 2011 7:18 am

Thanks ManaUser

I have a new question today about how persuasion works - if you keep using persuade and are successful it adds something to your speechcraft skill (+1.0 according to UESP) until eventually you upgrade that skill.

Is there a way i can script in the dialogue reult box that if a conversation is successful it equals the same as successful admire or intimidate?

I want my characters to occasionally develop their speechcraft via conversation choices rather than hitting an admire or aggravate button :)

I know the result box allows me to mod disposition but that is not really what I want to achieve.
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Fri May 27, 2011 9:06 pm

Er... ModSpeechcraft, 1?
User avatar
Hella Beast
 
Posts: 3434
Joined: Mon Jul 16, 2007 2:50 am

PreviousNext

Return to III - Morrowind