Dialog conditions

Post » Tue May 17, 2011 10:11 am

In this http://dslcv1-458.fast.net/oblivion/images/false.jpg the four dialog topics have conditions of
"Shield == 1"
"Sword == 1"
"Cuirass == 1"
and
"Shield == 0 AND Sword == 0 AND Cuirass == 0"
How can I be getting them all at once? Each of those variables has to simultaneously have two mutually exclusive values! There are additional conditions with each but nothing is OR'ed.
Is there any way the values can be changing as they're evaluated? And if so, how would I stop it?
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Tue May 17, 2011 12:47 am

What, no wild guesses yet? I know it's impossible, but it's happening!

A script will have just updated the variables at this point, so it's just possible that the last one was evaluated first, then they all set to 1 and the other three became true, just in time for the dialog, but it's happening too consistently. Does anyone know in what order the game checks the topics? Is it in FormID order?
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Tue May 17, 2011 12:27 pm

Could you post a code snippet? Perhaps a few more pairs of eyes will spot something...

My favourite trick is to start a post on the forums and then find the problem as I'm typing the question :)
User avatar
Queen of Spades
 
Posts: 3383
Joined: Fri Dec 08, 2006 12:06 pm

Post » Tue May 17, 2011 7:10 am

I've done the same enough times myself.

The relevant code is in the first post. Those are conditions on the four dialog topics.

They can't all be true at the same time, so I'm asking if anyone knows how they're evaluated. If a script can be running at the same time, I know how the three variables can be changing, but I didn't think a script could be concurrent with dialog conditions being checked, even on multiple cores. If I have to allow for that, then I need more insight into how it's done, so I can re-order the topics to prevent the illogical. I do know that if I click the "goodbye" button and re-activate her, the last option goes away, as all three variables are set to one by that time. It's less important if one of the others is missing when it should be there, so if I can get the last option checked last, I'm good to go.

The details I need are: What determines the order of evaluation of topics? What determines the sequence of the list shown? Are they related? (I don't think that's possible; the screenshot is only possible if the last one is checked first, as the variables can only be changing from zero to one - any change in the opposite direction is a result - i.e. after - of one of those choices.) If there's no way to control evaluation sequence, I'll have to add a "checks completed" flag to the prior topic that leads to these, so you can't get here until the values are settled.
User avatar
christelle047
 
Posts: 3407
Joined: Mon Apr 09, 2007 12:50 pm

Post » Tue May 17, 2011 5:13 am

I've done the same enough times myself.

The relevant code is in the first post. Those are conditions on the four dialog topics.

They can't all be true at the same time, so I'm asking if anyone knows how they're evaluated. If a script can be running at the same time, I know how the three variables can be changing, but I didn't think a script could be concurrent with dialog conditions being checked, even on multiple cores. If I have to allow for that, then I need more insight into how it's done, so I can re-order the topics to prevent the illogical. I do know that if I click the "goodbye" button and re-activate her, the last option goes away, as all three variables are set to one by that time. It's less important if one of the others is missing when it should be there, so if I can get the last option checked last, I'm good to go.

The details I need are: What determines the order of evaluation of topics? What determines the sequence of the list shown? Are they related? (I don't think that's possible; the screenshot is only possible if the last one is checked first, as the variables can only be changing from zero to one - any change in the opposite direction is a result - i.e. after - of one of those choices.) If there's no way to control evaluation sequence, I'll have to add a "checks completed" flag to the prior topic that leads to these, so you can't get here until the values are settled.


This is why I wanted to see the actual code. Unless there is a logic problem somewhere, what you post shouldn't be possible. I wanted to see how you had actually structured your code and the if statements. What you have listed are the results you expect, and clearly that's not what's happening.
User avatar
R.I.P
 
Posts: 3370
Joined: Sat Dec 01, 2007 8:11 pm

Post » Tue May 17, 2011 1:57 am

What I'm saying in the first post is that the dialog topics have the conditions shown (using GetQuestVariable). They are not tests in a script, so I can't show it.

My point is that the only way I can get the result I'm seeing is if a script is changing the variables at the same time the topics are being added to the display (which is very likely, given how this works), and the last one evaluated first.

But if you want a piece of code to chew on, this is what's running while it all happens:

if (AmberItem == 1) ; set by dialog when you tell her you have something for her    If < player has any of the many amber cuirasses>        set CuirassRef to          set Cuirass to 1    endif    ... same logic to set  Sword and Shield ...    set AmberItem to 0 ; indicates that check has been made, and she can ask again laterendif


The dialog topic that sets AmberItem to 1 has the goodbye flag, so that the script has the opportunity to run and set the three variables. However, it appears that the script is still running that check when I activate her again to continue the conversation. The next topic is a "What do you have for me?" with the four other topics as its choices. If I add a condition of "GetQuestVariable AmberItem == 0" to it, to ensure the script finished, it may or may not appear. Without it, I get the original problem.
So now it will have to be the same check in OnActivate to delay the start of the conversation until the script completes. It's very annoying that a script can't start until dialog completes, but dialog can start while a script is active. (Well a result script can run during dialog, but that can't have variables, so it doesn't help).

After examining the options here, it probably wouldn't help to sequence the topics in any way, as any incomplete state of the script will cause issues somewhere in the dialog. My only choice is likely to be the OnActivate fix.
User avatar
Evaa
 
Posts: 3502
Joined: Mon Dec 18, 2006 9:11 am

Post » Tue May 17, 2011 12:59 am

What I'm saying in the first post is that the dialog topics have the conditions shown (using GetQuestVariable). They are not tests in a script, so I can't show it.

My point is that the only way I can get the result I'm seeing is if a script is changing the variables at the same time the topics are being added to the display (which is very likely, given how this works), and the last one evaluated first.

But if you want a piece of code to chew on, this is what's running while it all happens:

if (AmberItem == 1) ; set by dialog when you tell her you have something for her    If < player has any of the many amber cuirasses>        set CuirassRef to          set Cuirass to 1    endif    ... same logic to set  Sword and Shield ...    set AmberItem to 0 ; indicates that check has been made, and she can ask again laterendif


The dialog topic that sets AmberItem to 1 has the goodbye flag, so that the script has the opportunity to run and set the three variables. However, it appears that the script is still running that check when I activate her again to continue the conversation. The next topic is a "What do you have for me?" with the four other topics as its choices. If I add a condition of "GetQuestVariable AmberItem == 0" to it, to ensure the script finished, it may or may not appear. Without it, I get the original problem.
So now it will have to be the same check in OnActivate to delay the start of the conversation until the script completes. It's very annoying that a script can't start until dialog completes, but dialog can start while a script is active. (Well a result script can run during dialog, but that can't have variables, so it doesn't help).

After examining the options here, it probably wouldn't help to sequence the topics in any way, as any incomplete state of the script will cause issues somewhere in the dialog. My only choice is likely to be the OnActivate fix.


Oh, I see, sorry I misunderstood you. I would presume that everything is running at once, as you suspect. I helped Arthmoor test his A Brotherhood Renewed mod recently and I know he had to rework one of the quests in there because things weren't behaving as he expected. You might want to grab that and have a look at the aaaDBICEdlaSQ quest. I think he uses quest stages to get around some of these limitations. You also might try PM'ing him to see if he has any suggestions - I don't think he frequents the CS forum.

It certainly appears that you are running into timing issues, but I don't have anything concrete to suggest, unfortunately...
User avatar
Catherine N
 
Posts: 3407
Joined: Sat Jan 27, 2007 9:58 pm

Post » Tue May 17, 2011 2:19 pm

Well, I'm probably past the "it's a problem" stage and into "I want to understand what's going on" stage already. I've noticed a couple of "x is busy" messages when trying to start conversations, so I suspect this is something Bethesda had issues with as well. I'll have to text search for that and see if it gives me any insight.
User avatar
remi lasisi
 
Posts: 3307
Joined: Sun Jul 02, 2006 2:26 pm

Post » Tue May 17, 2011 12:15 pm

Yeah, don't we all? So much of this is undocumented...
User avatar
Jonny
 
Posts: 3508
Joined: Wed Jul 18, 2007 9:04 am

Post » Tue May 17, 2011 6:46 am

Bit late on this, but could we see a screenshot showing the dialogue entry?

Scripts are suspended while you're in the dialogue menu so the values will not change unless a result script in a dialogue action causes them to do so.

What determines the order of evaluation of topics?


Responses to topics are processed in the order you see them listed in the CS. Whichever one matches the conditions first is the one you'll see.

If what you have is on the Greeting menu, then check the order of your additions to the GREETING topic to make sure they're how you wanted. Unfortunately if they're in the wrong order, the CS gives no way to fix that without manually deleting them and then replacing them in the proper order. TES4Edit can do it, but you have to do the response linkage manually, which is prone to errors.
User avatar
Amanda Furtado
 
Posts: 3454
Joined: Fri Dec 15, 2006 4:22 pm

Post » Tue May 17, 2011 1:30 am

Bit late on this, but could we see a screenshot showing the dialogue entry?

Scripts are suspended while you're in the dialogue menu so the values will not change unless a result script in a dialogue action causes them to do so.


I'm not sure if I still have all the pieces in the same state as when this started, but I'll attempt to get screenshots of the four topics when I'm back at the CS machine. They may not be that helpful, as quest variables are often squeezed out of the text box, and I don't think I can resize that.

The results I'm getting make it appear that although a script cannot be started while the dialog menu is up, (and that appears to include the result script unless it's a conversation with "run immediately" checked), a script can continue running behind the dialog if it was in flight at the time. So far, making the dialog wait until the script has done its work has blocked the problem.

(Edit dialog topic screenshots added)
http://dslcv1-458.fast.net/oblivion/images/cuirass.jpg
http://dslcv1-458.fast.net/oblivion/images/Sword.jpg
http://dslcv1-458.fast.net/oblivion/images/Shield.jpg
http://dslcv1-458.fast.net/oblivion/images/noamber.jpg

The last one has the same GetIsId test as the others, it's scrolled off the top of the box. In particular, the xxxAvailable quest variables are the ones that are simultaneously zero and one.
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Tue May 17, 2011 8:27 am

Ok, well, from what I see in those 4 shots, only the "Sorry, no amber yet" response should be visible - provided you actually have none of whatever should be available.

You do have a second response in each one which I presume is meant to deliver the "don't tease me" type responses. Is that checking the same two variables? If they're both 0 then it's perfectly valid for those responses to show up because you have something to do when you HAVE the amber, and something to do when you DONT HAVE the amber.

Also, what's that xxxRequested variable all about? Your dialogue results set those to 1, but your conditions don't check them anywhere?

Is the script you're writing a secret? I'm going to need to see it in order to figure out what's going on here.
User avatar
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm

Post » Tue May 17, 2011 2:35 pm

Those extras were added later as part of my attempts to work around the problem (to catch the bogus cases). I don't think I can get back to what It looked like when the thread opened. Same with the script.

Since the problem is now gone, there's probably little point in trying to get it back to fix it again.
User avatar
BrEezy Baby
 
Posts: 3478
Joined: Sun Mar 11, 2007 4:22 am


Return to IV - Oblivion