Some dialogue questions

Post » Sat May 28, 2011 7:07 am

A little contribution to this insteresting thread. I am almost sure local script variables are immune to 72 hours reset ; many companion scripts use local variables to store/restore GetStat values

I believe I've heards tales of companion NPCs' stats getting reset due to the 72 hour variable, so I wouldn't chance it. Anything that the NPC must remember might be best used as a global if the NPC isn't going to be traveling with the player.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Sat May 28, 2011 4:37 am

It may look complicated, and it could be greatly simplified. Most conditions are meant to ensure that the variable DinnerTime won't be set every single frame. In dialogue, you'd filter for "local DinnerTime == 1" if dinner is ready or "local DinnerTime == 0" if it isn't. Does that qualify as not "really complicated"? :unsure:

That is the approach my first thought followed before I remembered that there is a Gamehour filter for dialog. Just use multiple greetings one filtered for Global: Gamehour < 19 (player early), for Global: Gamehour >= 22 (player is late) and then one that welcomes the player graciously.

However, such a script might be appropriate for controlling the arrival of the other guest. As for which is better: moving the original or enabling a clone it may depend on whether you want the player to have access to the original's dialog topic. Certainly you could duplicate it for the clone, but if there are any flags that had been triggered in previous conversations with the player that will require additional attention.
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Sat May 28, 2011 4:09 am

That is the approach my first thought followed before I remembered that there is a Gamehour filter for dialog. Just use multiple greetings one filtered for Global: Gamehour < 19 (player early), for Global: Gamehour >= 22 (player is late) and then one that welcomes the player graciously.

Och n?? :facepalm: Well, I learned something new today. Thanks, Cyrano! :)

B
User avatar
Camden Unglesbee
 
Posts: 3467
Joined: Wed Aug 15, 2007 8:30 am

Post » Fri May 27, 2011 8:54 pm

For anybody interested, I've found in my archives an interesting post by CDCooley explaining variables persistance much better than myself :)
Variables in local scripts (attached to items from the CS) keep their values forever. The true global variables keep their state forever. Variables in global scripts (the ones that are listed if you use SV in the console with no objects selected) can forget their values under one very specific case. If the script isn't used between the time the game is loaded and then saved again, any old values from the previous save game file will be lost since the game assumes that if you didn't run it this time, it must not be important. So if you want a global script to remember it's values you have to make sure it gets run at least once every time a game is loaded.

The "72 hour bug" affects NPC stats and other values you might change from within scripts, but the scripts themselves aren't affected. Companion mods actually use the variables in a script to keep track of the companion's stats and skills since any changes to the NPC itself can disappear if you leave it alone too long.

User avatar
Horse gal smithe
 
Posts: 3302
Joined: Wed Jul 05, 2006 9:23 pm

Post » Fri May 27, 2011 10:59 pm

Thanks, abot! :)
That information should become part of MWSFD. Would you mind contacting Yacoby or Melian about it?

B
User avatar
loste juliana
 
Posts: 3417
Joined: Sun Mar 18, 2007 7:37 pm

Post » Sat May 28, 2011 1:33 am

Sorry, am scratching my head on this one and not sure if it is a script I need or am just being clueless with filtering

On a particular quest the pc has to deliver 3 items - as each item is delivered a journal entry is created 5,6 and 7

When all 3 entries are made then the quest can be complete and a reward given

however should I filter using the = sign for each entry? eg

Journal = CT_Sumatra 5
Journal = CT_Sumatra 6
Journal = CT_Sumatra 7

Or should I have some script that checks that I have all 3 entries then creates an 8th journal entry saying I can go get my reward?
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Sat May 28, 2011 4:05 am

Does the player return each item one at a time or all at the same time? If it's the former, then you'll need a journal entry for when all of the items are returned. If it's the later, then it's not that big of an issue.
User avatar
Lily
 
Posts: 3357
Joined: Mon Aug 28, 2006 10:32 am

Post » Fri May 27, 2011 9:44 pm

Does the player return each item one at a time or all at the same time? If it's the former, then you'll need a journal entry for when all of the items are returned. If it's the later, then it's not that big of an issue.


They have to go on a mission to visit 3 places and deliver 3 items - once the mission is complete as in all 3 items are done then they can get reward - because a player could visit in any order then i know I can't rely on the final journal entry being the one to determine whether the mission is concluded or not.
User avatar
Crystal Clarke
 
Posts: 3410
Joined: Mon Dec 11, 2006 5:55 am

Post » Fri May 27, 2011 10:39 pm

The usual Beth/vanilla method for that is to have 3 separate journal IDs, one for each (with the same title as the main quest so they get grouped with it in the player's journal). You could also use a variable - just a short global, set it to itself + 1 each time the player delivers something, and when it's >= 3 the quest is done.
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Fri May 27, 2011 9:57 pm

Thanks, abot! :)
That information should become part of MWSFD. Would you mind contacting Yacoby or Melian about it?

B

It's already in SfD :P That said, you can consider me contacted. I guess it should have been metioned in the 72-hours bug section as well as the variables section. :)
User avatar
Lexy Dick
 
Posts: 3459
Joined: Mon Feb 12, 2007 12:15 pm

Post » Fri May 27, 2011 7:09 pm

The usual Beth/vanilla method for that is to have 3 separate journal IDs, one for each (with the same title as the main quest so they get grouped with it in the player's journal). You could also use a variable - just a short global, set it to itself + 1 each time the player delivers something, and when it's >= 3 the quest is done.

What Melian said. The syntax is set glb_var to ( glb_var + 1) where glb_var is the name of your variable. :) If you include journal entries in the results box, make sure this is on a seperate line.
User avatar
Vicki Gunn
 
Posts: 3397
Joined: Thu Nov 23, 2006 9:59 am

Post » Fri May 27, 2011 10:03 pm

Thanks Jac

I think I have an ownership question - I have a clothing merchant who sells standard clothes - but in a quest she will make new clothing items available - what is the best way to add these to her container? I need it to happen via the dialogue result box.
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Sat May 28, 2011 6:07 am

"container_id"->AddItem, "item_id", 1

However, if you want to add items with negative amounts (e.g. in infinite supply), the best way I can think of is to place an initially disabled container owned by the seller (somewhere unseen) and then enable it from the result box. I've never tried this, and it should be tested if it works at all.
User avatar
sexy zara
 
Posts: 3268
Joined: Wed Nov 01, 2006 7:53 am

Post » Fri May 27, 2011 5:51 pm

"container_id"->AddItem, "item_id", 1

However, if you want to add items with negative amounts (e.g. in infinite supply), the best way I can think of is to place an initially disabled container owned by the seller (somewhere unseen) and then enable it from the result box. I've never tried this, and it should be tested if it works at all.


Got it - I think I will try having the result box disable the first container and then enable the second - I was unsure about adding infinite items in the results box as well - thanks will try this
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Fri May 27, 2011 6:02 pm

There's no need to disable the first container (unless you want to remove items too), you can have multiple containers owned by a single merchant and he will sell the contents of each of them.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Fri May 27, 2011 9:51 pm

I've heard that a disabled containter still lets an npc access the items. If this is the case, your best bet is to use a script to restock the items.
User avatar
Albert Wesker
 
Posts: 3499
Joined: Fri May 11, 2007 11:17 pm

Post » Sat May 28, 2011 4:45 am

I've heard that a disabled containter still lets an npc access the items. If this is the case, your best bet is to use a script to restock the items.


I've decided to do it through dialogue - there isn't too many items to add anyways - so my merchant will have the option to ask if she has receieved anything new this week and can add a random item to the chest - that way i can get the infinite and it adds a bit of variety in chatting with her too :)
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Sat May 28, 2011 5:53 am

Ouch!

I was doing some testing today and my character come up to one of my NPC's and instead of saying his first time greeting which introduces his new topics he gave me of the default ones about my clothes - this meant I couldn't advance the topic - is there some way I can ensure this doesn't happen

His greeting was set to filter function talked to PC = 0
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Sat May 28, 2011 12:44 am

Is the custom greeting on a higher level than the default clothing-related greeting?
User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Fri May 27, 2011 9:07 pm

Is the custom greeting on a higher level than the default clothing-related greeting?


It's a location greeting - #9
Clothes are on greeting #8

There were 5 NPC's I spoke to on my test - the first 3 all said their first time greeting correctly the 4th didn't (first time he hasn't as in previous tests he did and i haven't changed any of the greeting since my last succcesful test) the 5th doesn't have a first time greeting - they have a random location selection and they worked correctly

I'll clean out my test saves and try again and might think about putting a failsafe into one of his generic topics so if the greeting doesn't work the topic can be added in a different way
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am

Post » Fri May 27, 2011 6:31 pm

Then everything is working as expected. The order in which greetings are searched is from Greeting0 through Greeting9. If you want your greeting to be utilized it should be near the topic of Greeting7 at least. If it is quest-related, I suggest placing it high in Greeting5. Some modders (to assure their greetings will be displayed) place their greetings in Greeting1, but I generally do not favor that practice. It means your NPC will not have a proper 'vampire', diseased' or 'criminal' response unless new ones are written for that NPC.
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Sat May 28, 2011 12:44 am

Then everything is working as expected. The order in which greetings are searched is from Greeting0 through Greeting9. If you want your greeting to be utilized it should be near the topic of Greeting7 at least. If it is quest-related, I suggest placing it high in Greeting5. Some modders (to assure their greetings will be displayed) place their greetings in Greeting1, but I generally do not favor that practice. It means your NPC will not have a proper 'vampire', diseased' or 'criminal' response unless new ones are written for that NPC.


Thanks for the reassurance cyran0

I tested it again this morning and it failed again - so I relooked at my dailgue and saw I had a couple of entries that I had added yesterday that instead of putting Journal CT_mytopic I had just put CT_mytopic. I corrected those added an extra filter to my NPC's topic and it worked - it did make me think though how fragile depending on talked to PC = 0 is.

I think i will put in a failsafe into a generic topic just in case it happens again - I have a few NPC's who either get a new journal entry when they meet you for the first time or who add a topic through first time greeting's is there any way to make this more foolproof?
User avatar
Kit Marsden
 
Posts: 3467
Joined: Thu Jul 19, 2007 2:19 pm

Post » Fri May 27, 2011 10:35 pm

...it did make me think though how fragile depending on talked to PC = 0 is.

...I have a few NPC's who either get a new journal entry when they meet you for the first time or who add a topic through first time greeting's is there any way to make this more foolproof?

Oops. I neglected to comment on that fairly useless function. Talked to PC = 0 will only be true for greetings and never topics, and its value is reset by the 72-hour effect so you may get an inappropriate greeting in a later visit with the NPC. If this dialog if for a new NPC, then declare a local short variable on the NPC's script to act as a dialog filter (I use metOnce). Local variables are not reset by the 72-hour effect so it will be completely reliable. If there are topics that you want to make use-once, then you can declare local short variables to filter them as well.

As you already understand journal indices make excellent and convenient dialog filters, although introducing a new journal at the same time a new topic is introduced can prevent the topic from being hyperlinked or listed until after the dialog window is refreshed.
User avatar
remi lasisi
 
Posts: 3307
Joined: Sun Jul 02, 2006 2:26 pm

Post » Fri May 27, 2011 7:53 pm

...introducing a new journal at the same time a new topic is introduced can prevent the topic from being hyperlinked or listed until after the dialog window is refreshed.

Cyrano, could you elaborate on that please?
User avatar
joeK
 
Posts: 3370
Joined: Tue Jul 10, 2007 10:22 am

Post » Sat May 28, 2011 8:46 am

Cyrano, could you elaborate on that please?

I believe he is referring to the Results Box.
Sometimes when you add a Journal update in the Result box and a new Topic at the same time, the Topic won't appear blue in dialog until you exit dialog and greet the NPC again.
User avatar
Aaron Clark
 
Posts: 3439
Joined: Fri Oct 26, 2007 2:23 pm

PreviousNext

Return to III - Morrowind