Some dialogue questions

Post » Fri May 27, 2011 11:50 pm

Hmm... so I'm learning my way around the dialogue but I have some questions so thought I'd start a thread with a bit of an open ended title so I can just add new questions that come to mind later

Can I please ask about Greetings first of all

The setting is:

An inn which has 3 cells (all have a generic starting name for filtering purposes), in 2 of the cells are bars and in the 3rd cell is accomodation.

In the cells with bars there are NPC's currently set to class publican. However I only want them to sell food and drink

To remove the beds topic from their list do I create a function that says != (their cell)

When some greetings are said the result box ends up with ;name of npc - why is this?

What does it mean in the result box when it says: ClearInfoActor (I notice LGNPC Seyda Neen uses this a lot)
User avatar
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Fri May 27, 2011 7:23 pm

The Not Cell filter would work, but by editing an official dialog entry you risk conflicts with other mods. I suggest that you create a new entry under the topic 'beds' with a dismissive reply such as "I am sorry, we do not have rooms for rent." Place this new entry (filtered by Cell or ID) above the official entry that would otherwise be used by the NPC in question.

If you examine Betheda's dialog results, the developers appeared to sometimes create empty dialog entries first and then add notes in the dialog results as to the NPCs (by ID or more often class, race or faction) that would offer the response. The notes you see are relics of that process that were never deleted.

ClearInfoActor means that the dialog response that particular NPC offered will not be preserved in a from that the player can then later look up in the topic section of the journal. This is done to prevent information that has no real value from cluttering up the save game's reference data. I do not think it common enough in LGNPC mods and significant updates to those mods will make greater use of it. Quest related data and useful information/lore should be preserved, but the background information that our mods included are mostly for entertainment purposes and is not the sort of information that the player will need to reference later.
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am

Post » Fri May 27, 2011 7:03 pm

Thanks cyran0 that was a helpful answer :)

Creating dialogue feels a bit like playing chess - with the need to prethink many moves/possibilities ahead before making a single move

I have a follow up question about the results box then

In Ahnassi's script it starts with:

short localdaysPassed
short currentDay
short nolore

I can't see anything that suggests she has a script to give items - that seems to be covered int he results box for instance

;Journal Romance_Ahnassi >= 55; Agility >= 75;
Journal Romance_Ahnassi 60
player->Additem "Extravagant_Shirt_02" 1
player->Additem "Extravagant_Pants_02" 1
player->Additem "BookSkill_Short Blade5" 1
Journal Romance_Ahnassi 50

She doesn't carry these items on herself and I can't see the items anywhere in her house so suspect they are getting pulled from the game database somehow. (Mysticism is such a great skill)

So my question is - is the script in the results box being run when the dialogue is activated or is it stored elsewhere?

If the cript is run from the results box does this mean I do not need to place items on the NPC who is giving items like a key?

For instance if I wanted an NPC to give ia key to the player would it be scripted in the results box like this:

; Journal CT_errands_20(based on my topic list of quest updates)
player->Additem "CT_key_01" 1

Does the 1 at the end of the script just mean that = yes?

Um one other question while I'm posting

What exactly does nolore do? When I look at some individuals who have that script they still have masses of dialogue options?
User avatar
u gone see
 
Posts: 3388
Joined: Tue Oct 02, 2007 2:53 pm

Post » Sat May 28, 2011 6:40 am

The script code that is recorded in the dialog results section runs when that dialog entry is displayed - there is no other script relating to it that is running in the background. The code is compiled on the fly. For that reason, it is very important that the syntax, and the names of functions, objects, etc. are correct otherwise it will likely result in a crash to desktop. Take care!

The function AddItem adds the specified object 'out of the blue' - so to speak. The object must have a recognizable ID, but it need not exist in the world. So, no - Ahnassi does not possess those objects. It is not necessary that she have the objects in her inventory. If the player kills her before the gift is offered he/she will never know they existed anyway. Sometimes when the player gives an object to an NPC, the code player->RemoveItem "Object_ID" 1 is complimented with "NPC_ID"->AddItem "Object_ID" 1. In this way, if the player kills the NPC he/she will logically find the transferred item in the NPC's inventory.

In your example, no - your NPC need not possess the key in order to give the key to the player through dialog. In the code:

player->Additem "CT_key_01" 1 the '1' refers to the number of that item that should be added to the player's inventory. In the case where gold is transferred you can understand the need to indicate more than one.

NoLore is a local variable that is used as a dialog filter. Any dialog entry that you might wish to be restricted so it is not used by every NPC (but is used by many) add the dialog filter: Not Local: noLore = 0. Any NPC that has a script that declares short noLore will not reply with the so-filtered entry. I believe the reason many quest-related NPCs have this dialog filter is that Bethesda's developers did not want to clutter their dialog with so many common topics in a way that might make it more difficult for a player to find the appropriate topic to advance the quest.
User avatar
Janette Segura
 
Posts: 3512
Joined: Wed Aug 22, 2007 12:36 am

Post » Fri May 27, 2011 8:23 pm

Thanks again cyran0 - you write very clear answers - I'm getting ready to start adding my dialogue but had just a couple of questions left

You mentioned syntax and the answer you gave about the developers writing the dialogue and leaving in the results box who it was to be assigned to makes sense

Just to confirm though - comments in the Results box are preceeded by ' ; ' as in:

; savant; bard; trader; publican; merchant;

I noticed not all comments end with a semi-colon though so does that make a difference?

Sometimes the comments read:

; savant; bard; trader; publican; merchant; CHOICE 1 - versus

; savant; bard; trader; publican; merchant;
Choice "Continue" 1

I understand the second one runs the script choice 1 which calls the next piece of dialogue

However why does the second dialogue repeat in the comments CHOICE 1? What value/action does it achieve?

One other question in Greetings 9 there are all the location greetings - I want to add my location greetings there as well following a similar format of
Talked to pc = 0 with various rand greetings to initiate topics followed by the Random 100 with variations on the theme of nice to see you again or find someone else to pester style lines

However the last entry in greetings 9 says

I STILL don't like you. And I STILL don't want to talk to you.

And in the results box it says:

;last greeting 9, below this unreachable code

Does this mean that Greetings 9 is already full and you can't add more dialogue here?
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Sat May 28, 2011 5:20 am

When a result box line begins with a semicolon that entire line is a comment and is ignored by the game. So looking at those two comments you listed:

; savant; bard; trader; publican; merchant; CHOICE 1 - versus

This looks like it would be aplied to the dialog that displays after the player selects choice one; that is this is the dialog that replies to the answer

; savant; bard; trader; publican; merchant;

This comment would indicate that the dialog is used by the listed classes.

As to the comment on the last line of greeting 9:

;last greeting 9, below this unreachable code

The reason for that comment is the filtering on that dialog. This particular greeting has no filters at all. That means this greating is used by "everyone, everwhere, all the time" Usually this greeting is never reached because some higher, more restricted greeting is reached 1st. If another greeting where placed bellow this one it could never be used because it's not possible to fail to meet the unfiltered conditions.
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Fri May 27, 2011 11:40 pm

You could also make a complete new class for your guy - maybe...landlord/ lady

add a "Short Nolore" to their script also to prevent them chatting rubbish about other stuff - always useful
User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am

Post » Sat May 28, 2011 3:52 am

You could also make a complete new class for your guy - maybe...landlord/ lady

add a "Short Nolore" to their script also to prevent them chatting rubbish about other stuff - always useful


Thanks for that reply simontgriff, I had originally thought to do that but since the NPC would still talk about many of the same topics, shein, mazte etc - I decided I needed to first understand how to filter their dialogue - as this issue of class generic topics will come up with other NPC's I have

to which cyran0 wrote:

The Not Cell filter would work, but by editing an official dialog entry you risk conflicts with other mods. I suggest that you create a new entry under the topic 'beds' with a dismissive reply such as "I am sorry, we do not have rooms for rent." Place this new entry (filtered by Cell or ID) above the official entry that would otherwise be used by the NPC in question.


I think I can get around some of the refusal of service via creating a special greeting that says something like "...our beds for rent are currently being reserved by the owner nameid" which then leads to introducing the owner and moving my story along when they ask for beds to rent.

However i am still tempted to just create another class due to less verbal manouevering involved :)

It's a shame there is no simple way to just remove a topic from the individuals list without impacting all other NPC's of that class
User avatar
Lewis Morel
 
Posts: 3431
Joined: Thu Aug 16, 2007 7:40 pm

Post » Sat May 28, 2011 12:44 am

I think I can get around some of the refusal of service via creating a special greeting that says something like "...our beds for rent are currently being reserved by the owner nameid" which then leads to introducing the owner and moving my story along when they ask for beds to rent.

No, that won't work, because your publican would still talk about the topic "beds". Just do as cyran0 said and add a new line to the dialogue topic "beds", filter it for your publicans (e.g. by referreing to the Cell name) and have them say something like: "I'm sorry, but I don't rent beds. Go next door and ask nameid the landlord about it." Make sure that this line of dialogue is the first line of dialogue for that topic, so that it will be triggered.
In case you don't already know it, I recommend Srikandi's excellent http://tommyshideout.net/files/srikandi/DialogueTut/. It will greatly help you understand Morrowind dialogue.

The first rule of Morrowind dialogue:
Always bear in mind that Morrowind reads its dialogue from the top to the bottom. Whichever line of dialogue meets an NPC's conditions first will be shown; everything further down the list will be omitted.

Example 1 for the topic "beds":
First entry is filtered for Class "publican" and Cell "bhl hostel": "Hi there, all beds are rented."
Second entry is filtered for Class "publican" only: "Yes, we have a bed available. Do you want it?"
In this constellation, every publican in the Cell "bhl hostel" will tell you that all beds are rented. Every publican in any other Cell will offer you the bed.

Example 2 for the topic "beds":
First entry is filtered for Class "publican" only: "Yes, we have a bed available. Do you want it?"
Second entry is filtered for Class "publican" and Cell "bhl hostel": "Hi there, all beds are rented."
In this constellation, every publican, including those in Cell "bhl hostel" will offer you the bed. Why? Because they are publicans, so the first entry's conditions apply. Morrowind won't even read the second entry anymore.

However i am still tempted to just create another class due to less verbal manouevering involved :)

I wouldn't do so. That leaves you with the ungrateful task of writing meaningless small talk for your new class.

It's a shame there is no simple way to just remove a topic from the individuals list without impacting all other NPC's of that class

As pointed out above, it's quite easy to add a new line of dialogue to an existing topic and tweak its filtering a bit. Just make sure you don't change standard dialogue.
That's the Second rule of Morrowind dialogue (derived directly from rule no. 1):
Place dialogue entries for a single NPC or a small group of NPCs high in a topic and position the dialogue entries for a more common group of NPCs further down the list.
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am

Post » Fri May 27, 2011 10:06 pm

Is there a way to DL the Dialogue tutorial?

SilentThief
User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Post » Fri May 27, 2011 7:25 pm

Is there a way to DL the Dialogue tutorial?

SilentThief


On the link bhl gave it akes you to a page where on the left are 7 steps step 7 is download - if I remember right you get the esp and the help file. The esp is really good to go through though the one I downloaded already had the dialogue entries added to it ?

I often refer back to the help file - srikandi wrote in a really good step by step way - however it doesn't cover everything hence my starting this thread to get specific answers to things :)
User avatar
alicia hillier
 
Posts: 3387
Joined: Tue Feb 06, 2007 2:57 am

Post » Sat May 28, 2011 12:32 am

I wrote a http://www.4shared.com/file/92214007/b8840238/Dialogue_tutorial.html awhile back that I've been meaning to clean up and post on my website. It's currently in Word format and I tried to cover the differen aspects of dialogue writing. If you have any suggestions on how to improve it, please pm them to me. Thanks.
User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Fri May 27, 2011 8:14 pm

I wrote a http://www.4shared.com/file/92214007/b8840238/Dialogue_tutorial.html awhile back that I've been meaning to clean up and post on my website. It's currently in Word format and I tried to cover the differen aspects of dialogue writing. If you have any suggestions on how to improve it, please pm them to me. Thanks.


Thanks Jac I dl'd it and have had a read - I like how you included a sample quest and some of the explanations are quite good

Seeing as you asked for feedback ...:)

A table of contents would really help - there's quite a few different sections in the doc and often tutorials are used multiple times so having a TOC which you can just CTRL+click to get to helps.

Some screenshots would be really helpful - I've had my eyballs immersed for the past week in the screens so could picture what you were talking about but I found myself aching for some shots like the ones found in this http://www.morrowind-oblivion.com/morrowind_cs6_tutorial.php.

I've noticed that filtering in the dialogue box from the main menu is different from the NPC dialogue menu and was hoping your doc would explain what the difference is in using those 2 windows and does it make any difference.

A troubleshooting section would be great - I save often becuase I end up doing mistakes and having to reload - I hadn't thought of using TESAME to remove unwanted lines.

A section on scripting syntax for the results box would be awesome - I'd love to not what you can and can't do with that box

How messageboxes work would be helpful - I see Kateri used a lot of message boxing with Julan and I've heard of Qarl nesting message boxes in The Underground but so far haven't come across much info on the value of using these and how to do so.

Please don't think I'm criticising your doc - I'm not it's really helpful just if you wanted to expand it a bit more these are some ideas/requests :)

Thanks for making it available :)
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Sat May 28, 2011 7:00 am

Okay rather than hijack http://www.gamesas.com/bgsforums/index.php?showtopic=977815 on topics I thought I'd better retreat to my own :)

cyran0 gave a really interesting example of pushing dialogue along in a topic which was filtered for Fargoth

Greeting:

No Filter: Bite me, %PCName
Result:
AddTopic "bite me" ; optional

Topic: bite me

Filter (Local: state = 0]: That's right, I said bite me, %PCName!
Result: set state to 1

Filter [Local: state = 1]: Bite me harder!

In game this displays:

Bite me, Cyrano!

bite me
That's right, I said bite me, Cyrano!

bite me
bite me harder!

The topic 'bite me' is hyperlinked in the greeting because the filter conditions for at least one of that topic's entries was satisfied (state = 0).
Clicking on the topic 'bite me' displays the (effectively) unfiltered response and the topic is still hyperlinked. Not because the results section set state to 1, but because it was still satisfying the condition state = 0 for which there was an entry.
However, since the result section updated the variable to state = 1, at the moment the topic 'bite me' is selected again that is true and so the second dialog entry (state = 1) is displayed.


So this question is related to the state function

what is state=0 or state=1 telling the game?

When I was looking at Sellus Gavius' dialogue if you don't have your papers his state=-1

So what is happening in the game when this happens - how many states can you have?
User avatar
Charlotte Buckley
 
Posts: 3532
Joined: Fri Oct 27, 2006 11:29 am

Post » Fri May 27, 2011 11:00 pm

So this question is related to the state function

what is state=0 or state=1 telling the game?

When I was looking at Sellus Gavius' dialogue if you don't have your papers his state=-1

So what is happening in the game when this happens - how many states can you have?

I think there's a misunderstanding here: "state" is not a function. It's a variable. In Sellus Gravius' case it's a local variable that is defined in the Script "CharGenClassNPC" which is attached to Sellus Gravius. How many values "state" can assume is dependent on how you defined that variable; in this case "state" is declared as a "Short" variable so that it can assume integers ranging from -32768 to +32767 (65536 values). And there's virtually no limit on how many variables you can declare for an NPC (just don't use the 34th variable of each type).
User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Fri May 27, 2011 8:41 pm

cyran0 gave a really interesting example of pushing dialogue along in a topic which was filtered for Fargoth

I admit my example was rather silly, but out of context (and with out colored text) it is really quite an embarrassment. :facepalm:

So this question is related to the state function: what is state=0 or state=1 telling the game?

When I was looking at Sellus Gavius' dialogue if you don't have your papers his state=-1

So what is happening in the game when this happens - how many states can you have?

I took for granted that anyone might recognized state as a local variable on the script that Fargoth wears. I chose Fargoth to illustrate my point because (1) my test character starts in the same cell as Fargoth and (2) Fargoth already came equipped with a script that declared a local variable that I could use in my test (I did not want to create any more than I had to do).

I suppose part of the confusion arose from the very name of the variable 'state'. It is a logical name for a variable intended to store the 'state' or 'condition' of a variable. Most scripters choose more descriptive names for their variables such as 'doOnce', 'timer', 'playerHealth', or 'currentDay'. 'State' just happened to be the name Bethesda used in their generic LocalState script that is attached to Fargoth (and apparently in Sellus Gravius' script as well).

Local variables made great dialog filters. As bhl wrote, a short variable (such as state in this instance) can store over 65000 different values - much of the time we only require a Boolean flag: either true or false (either 1 or 0). You can store multiple states in the same variable. For instance 11 might mean eleven, or it could mean than two different states are both true (10 means the first is true and the second on is false, and so on).

There is nothing too remarkable in how I advanced the dialog by updating the value of the local variable used to filter the different dialog responses - it is common practice. Of course there are a myriad of possible filters and combinations that can be used to achieve similar outcomes - it depends on what you have on hand and what you are trying to achieve. There are a number of dialog tutorials (including the aforementioned one by Jac) that should discuss these methods.

Many modders expand their understanding of how dialog works by studying Bethesda's dialog. This has the added value of being able to observe how it works by playing the game (or more commonly, seeing something in game and opening the construction set to see how it was done). I also understand that it can be daunting to anolyze how several different dialog entries under the same topic work together. The most important rule is that the dialog database is searched from the top down - this you already understand. But it means that the most narrowly filtered entries are typically at the top of the dialog tree and the entries become more broadly filtered as you go down.

The next most important thing is to recognize that entries (and entire topics) are only available if their filtering conditions are satisfied - as we discussing in the other thread this is not always as intuitive as we would like. It also explains why we sometimes receive a dismissive "I don't know if I should talk with you about that" (or the like). This is from the Persuasion/Info Refusal tab of the dialog database. The entry the player read altered the filtering conditions so a topic previously linked and listed no longer has any valid entries. I wrote a longer post on that subject not so long ago.

When I started writing for LGNPC, I was given a template listing all of the topics that I should write replies for my NPC. The person entering the dialog through the construction set would using this document as a guide. I still like that method of organizing dialog because I can see all (most) of the dialog for a single topic on the same page and therefore more easily compare the filtering to verify that the appropriate response would display in game.

I have a few sample templates (transcripts) that I make available to writers new to LGNPC. These transcripts are not too complicated (no quests), but they show a nice variety of things that can be done with dialog. If you think they might be helpful for you to examine, I can give you the links to the documents. I don't imagine they will answer all your questions - in fact I expect they will raise new ones. But ask your questions and I am confident that someone here will be able to answer it for you. I could also offer some quest-related dialog transcripts, but LGNPC quests have become of late more convoluted with multiple pathways to success (and failure) - I do not think they would be an easy read.
User avatar
Hazel Sian ogden
 
Posts: 3425
Joined: Tue Jul 04, 2006 7:10 am

Post » Fri May 27, 2011 11:33 pm

Just wanted to say that this thread helped me as well. Very nice info here! =)
User avatar
Alex Vincent
 
Posts: 3514
Joined: Thu Jun 28, 2007 9:31 pm

Post » Fri May 27, 2011 10:44 pm

@C Mireneve, feel free to post your questions here as well :) I'm sure you will cover things I haven't thought of or come across yet.

@cyran0 - thanks again - guess I need to go back to scripting for dummies and read up on states - alas my programming experience is very limited though I have a good theoretical understanding of relational databases which helps in understanding the CS.

Anyways I would be very interested in seeing the links of your templates.

I started out writing my story arcs as a play but am now translating them into a template I made using excel which has some of the key fields of the dialogue screen - condition, greeting, disp, rand, result

Using a spreadsheet I can see the dialogue progress pretty much as I will see it in the CS - apart from the spell check features I use the function LIN to do a character count on each cell for when I need to split to a continue. As I get more understanding in how topics are being added ( :) ) I'll add my own filters to the spreadsheet for error checking purposes. And then hopefully it will be a copy and paste exercise.

So to see how you put together LGNPC would be really helpful.

I've been looking through a number of dialogue mods to learn how they did things - the Seyda Neen project, Beths Entertainers - that was a good one it also used a state variable though I couldn't find it anywhere ...maybe it was on the NPC ...will go look. Also looked at the greetings and persuasion mods.

Speaking of persuasion I have a new question.

I can see responses to persusasion and understand them - how though can you vary the actual persuasion - for instance if you select Admire I suspect the game takes your stats of speechcraft and personality and rolls some dice in the background to see if you pass the test - what I can't see is any variable attached in the CS to those functions - are they hardcoded?
User avatar
El Goose
 
Posts: 3368
Joined: Sun Dec 02, 2007 12:02 am

Post » Sat May 28, 2011 10:23 am

The admire responses are based on disposition. Which one is displayed (pass/fail) is determined by the engine, then it checks the proper "topic" to see what line is displayed. I *think* it's based upon your speechcraft and personality versus the NPC's speechcraft and personality scores.
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Sat May 28, 2011 8:59 am

I can see responses to persusasion and understand them - how though can you vary the actual persuasion - for instance if you select Admire I suspect the game takes your stats of speechcraft and personality and rolls some dice in the background to see if you pass the test - what I can't see is any variable attached in the CS to those functions - are they hardcoded?


They are indeed hard coded but could be over ridden by scripting. Carrie Irriettie, the companinion I'm working on, is particularly strong minded and doesn't pay much mind to persuasion. Her script constantly sets her disposition to the value of a local variable. The dialog for her persuasion responses then alters this variable.

The relevant snip of script:
short	fondnessif ( getDisposition != fondness )	if ( fondness > 0 )		setDisposition fondness	endIfendIf


And a bit of sample dialog:
"It's nice to hear you say such sweet things."
ID: NICI_Carrie, Disp: 75
[Global][Random100][>=][75]
[Function][Same six][=][1]
Result:
set fondness to fondness + 3

"You're going to make me blush."
ID: NICI_Carrie, Disp: 75
[Global][Random100][>=][50]
[Function][Same six][=][1]
Result:
set fondness to fondness + 2

The game engine would modify Carrie's disposition by some random amount when the player succeeds in persuasion with her. The bit of code above runs while the dialog menu is open and promptly undoes the dialog change. The game then looks up the dialog response. For the sample results shown above the results box alters Carrie's fondness variable. This triggers the the script to update Carrie's disposition. A bit cumbersome but it give the modder control of the NPC's disposition score. These two lines of dialog are placed above the line "I feel the same way. It's been some time now for me." in the Admire Fail section. (The filter [Global][Random100][>=][75] looks at a global variable that is rerolled by the game every frame - about 17 times per second or more)
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Fri May 27, 2011 6:00 pm

Thank you Nicholiathan :)

I might have to think about this - In Emma's Laura Croft she modified the Bribe success and fail so you quickly would learn not to waste money doing that again - losing 2000 gold and getting a mod disposition of -15 even when successful is a tough learning curve.

If I understand you correctly you can only improve Carrie's disposition via dialogue not admire or bribe?

I have a couple of character's I want to stay neutral - except they are part of a faction and therefore as the players rep goes up so will their disposition - I don't mind that but I want to prevent their responses by going up by bribery or admire. As one of them has a story linked to her disposition. I can work around that via filtering for a journal entry and therefore they can accept bribes and admire but still not trust the player enough to reveal the mission. However if there was a way to prevent a disposition rise that would be fine too.

As for admire it always felt a bit tacky to me - in the entertainers mod by Beth you can get better results if you have specific items with you - with Laura you had to become a farmer to keep up with her appetitie for gold kanet flowers but it was a nice touch to be more active in the friendship.

I like how you link your script to responses in the persuasion section - it's a very good idea.
User avatar
Dylan Markese
 
Posts: 3513
Joined: Sat Dec 01, 2007 11:58 am

Post » Sat May 28, 2011 6:36 am

So after coming off a face making bender I am back into doing dialogue again and wondered if someone could help me understand what this script means

begin lg_seyGuestLS	short lg_seyLore	if lg_seyLore == 0		set lg_seyLore to 1	endifend


It's from the LGNPC Seyda Neen mod and there seems to be 3 variants of it - one for NPC's outside one for those in Arrile's and one for firemouth's shack

I was wondering if it somehow made NPC's who are not set to nolore such as teleri to ignore topics or responses that are originally set to nolore by the devs? Hmmm I think my syntax might be incorrect so i'll try again does the script make the NPC act like a nolore person even though they aren't?

Also the bit in the code that says set lg_seyLore to 1 is sometimes 11 or 12 depending on the cell the NPC inhabits - what does this command tell the game to do?

The reason I'm asking about the LGNPC script is that i am opening up differnt dialogue focussed mods to try and understand how the modders used functions and variables and wasn't sure why this script had been included and what impact it makes on dialogue

Thanks in advance to any posters Illy
User avatar
Czar Kahchi
 
Posts: 3306
Joined: Mon Jul 30, 2007 11:56 am

Post » Fri May 27, 2011 8:15 pm

It looks like it was *intended* to work as a dialogue condition for "fishers", "guests" and "regulars" having different answers for certain topics without the need to specify them individually for each NPC in particular. Though it seems that the author didn't use the mechanism he initially planned to be the core of his mod, and now these scripts don't really do anything.
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Sat May 28, 2011 4:05 am

It looks like it was *intended* to work as a dialogue condition for "fishers", "guests" and "regulars" having different answers for certain topics without the need to specify them individually for each NPC in particular. Though it seems that the author didn't use the mechanism he initially planned to be the core of his mod, and now these scripts don't really do anything.


Thanks Kir - now I understand the dialogue condition - I must relook at the dialogue as I know the fishermen get a bit peeved if you do a certain quest - not sure about the guests or regulars though.

Um still not sure how the vaiable works - as in 1, 11, or 12?

Also there is a new global added called ichoice when talking to Tandram for example he has a Global ichoice = 0 then in the results box it says

choice "Continue" 1set iChoice to 1ClearInfoActor


In the continuing piece of dialogue the reulsts box says

choice "Continue" 2ClearInfoActor


And in the final Results box it says

set iChoice to 0ClearInfoActor


I've got 3 questions here -
1. What does ichoice do
2. Is it necessary
3. What does resetting it to 0 on the final result box do? If this is a converstaion loop wouldn't it just reset itself naturally?

This mod has always worked really well for me so I figure if I can understand how they put it together then I should be able to have a better go at improving my own dialogue strings.
User avatar
Honey Suckle
 
Posts: 3425
Joined: Wed Sep 27, 2006 4:22 pm

Post » Fri May 27, 2011 8:16 pm

Um still not sure how the vaiable works - as in 1, 11, or 12?
You simply put Local lg_seyLore=11 into dialogue condition of the line and everybody whose script does have such variable declared AND set to that value will answer with this line (provided, of course, that some higher residing line doesn't catch reins earlier). And since the name lg_seyLore seems to be quite unique, there's no danger that a stray NPC from another mod will have a variable with the same name in his script. Naturally, local vars are much more powerful than simply providing means to group people into cathegories, but that's another topic.

1. What does ichoice do
2. Is it necessary
3. What does resetting it to 0 on the final result box do? If this is a converstaion loop wouldn't it just reset itself naturally?
Technically, it's not necessary. The thing is, while the author did quite a good job with breathing life into Seyda Neen inhabitants and setting standards for what we know as LGNPC project nowadays, he himself wasn't very sleek with MW dialogue, so he ended doing hard way what could (and should) be done easier. The situation with ichoice happened because he placed the second (and subsequent) part of the answer below the first, which seems to be a natural way for one to read texts, but not a natural way for MW engine to process dialogue lines. Normally the multi-line dialogue should like like this:
Text				   Condition			   Actionbla-bla-bla3		  Choice=2		   bla-bla-bla2		  Choice=1		   Choice "um-hum"  2bla-bla-bla1							 Choice "yea, sure" 1

Now the engine checks first line, finds that it has Choice condition that it doesn't meet, comes to the next one, and so until it finds the line without conditions. Since that line also has Choice in its action box, the engine starts once again, but this time it doesn't reach the same line, since the condition is met earlier. And so until the end.

Now, what the author did:
Text				   Condition			   Actionbla-bla-bla1							 Choice "yea, sure" 1bla-bla-bla2		  Choice=1		   Choice "um-hum"  2bla-bla-bla3		  Choice=2

After meeting the first line with the action box, the engine starts to search again and finds the same line, starts once again, finds the same line once more, and so until you Ctrl-Alt-Del your comp, since there's no way to exit a looped dialog. That had to be fixed... but instead of figuring out a CS-natural order to place lines, author preferred to keep them at *his* natural order, adding a variable that would force the engine to recognize them in the necessary order.
User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Next

Return to III - Morrowind