WinterishClover Posted July 5 Posted July 5 I've got a dialogue condition headache here. See the screenshot. What I need is: (In Dawnstar AND TierDawnstar == 2) OR (In Falkreath AND TierFalkreath == 2) OR (In Solitude AND TierSolitude == 2) etc... But this isn't working at all. According to the UESP article on Complex Conditions I'd end up having to OR every single possible combination which would make for 100s of conditions. Can anyone help me?
Qvorvm Posted July 5 Posted July 5 In Dawnstar OR In Falkreath OR In Solitude AND Not in Dawnstar OR TierDawnstar==2 AND Not in Falkreath OR TierFalkreath==2 AND Not in Solitude OR TierSolitude==2 AND This assumes that the three "In <place>" are mutually exclusive. Otherwise you'd need something more complicated.
WinterishClover Posted July 6 Author Posted July 6 So in your example of 3 locations, it would still need 9 conditions? So 10 locations would still be a 100 conditions....arg. Can't believe it can't be (this and this) OR (this and this) OR...etc...
Qvorvm Posted July 6 Posted July 6 For 10 locations, I count 30 conditions, not 100. Even if you could do arbitrary ANDs and ORs with parenthesis, you'd still need at least 20.... It is however true that the game engine is limited to conjunctive normal forms, and not all boolean expressions can be reasonably encoded in that form. In practice however, it usually works once you get used to it.
gettps Posted July 6 Posted July 6 In such cases, (if possible) wouldn't it be better to find a way to script it? That way you can use regular parentheses to control order of precedence in a standard statement? That way you wouldn't need to use dozens and dozens of condition statements? Might be a little cumbersome though to find a way to control a dialog with a script test...
WinterishClover Posted July 6 Author Posted July 6 38 minutes ago, gettps said: In such cases, (if possible) wouldn't it be better to find a way to script it? That way you can use regular parentheses to control order of precedence in a standard statement? That way you wouldn't need to use dozens and dozens of condition statements? Might be a little cumbersome though to find a way to control a dialog with a script test... I just don't see how you could - these are all Hello Subtypes so it's not like there's a chance for the script to fire first as the script doesn't UNTIL conditions are met - so then the hello would fire under ALL circumstances - if there was a follow up INFO then absolutely.
WinterishClover Posted July 6 Author Posted July 6 14 hours ago, Qvorvm said: In Dawnstar OR In Falkreath OR In Solitude AND Not in Dawnstar OR TierDawnstar==2 AND Not in Falkreath OR TierFalkreath==2 AND Not in Solitude OR TierSolitude==2 AND This assumes that the three "In <place>" are mutually exclusive. Otherwise you'd need something more complicated. And just to be clear this setup DOES indeed work at least in theory as I am currently testing it with just two holds. Just trying to navigate the cleanest and easiest setup as I found another that works for two holds. And yes - winner winner chicken dinner. Tested with three holds and worked perfectly. I don't understand it one bit but damn thing works. You just saved my bacon and a huge chunk of my mod Qvorvm. THANK YOU THANK YOU THANK YOU. 1
Qvorvm Posted July 6 Posted July 6 2 hours ago, WinterishClover said: I don't understand it one bit but damn thing works. If you haven't studied boolean expressions in detail, you should review a few of the basic equivalences. "If A then B", is true if a is false, or if both A and B are true. This may seem counter intuitive, but it's the only mathematically consistent way of dealing with "if then" in boolean logic. "If A then B" and "!A or B" are therefore equivalent. So you should read "!In Dawnstar OR TierDawnstar==2" as meaning "if In Dawnstar, then TierDawnstar==2". With that in mind, you should be able to read my solution. Another way to verify it is correct is to assume "In Dawnstar" to be true. Then the 2nd block is just "TierDawnstar==2", and blocks 3 and 4 are just "True" since "In Falkreath" and "In Solutide" will be false. This also highlights that this pattern only works if the three "In <place>" conditions are mutually exclusive. Or you can just enjoy the "win"
scorrp10 Posted July 6 Posted July 6 Personally, I would stay away from such complex condition topics. If you want to create a specific reply for all these cases, create a Shared response in the Misc section, and then create several TopicInfos, each using that same shared response, and each checking conditions specifically for a given location. So with Dawnstar, Falkreath and Solitude, you will have three separate TopicInfos. Another option is you can have a script with a conditional variable. On location change, this script runs a function, which basically checks location, and sets the conditional 'Tier' variable to the value of tier specific to that location. Then you just need a single condition dialogue checking that conditional on the script.
csbx Posted July 7 Posted July 7 For what it's worth, I use this site to compute these: https://www.wolframalpha.com/input?i2d=true&i=A%26B%26\(40)C+or+D\(41) Input with the right syntax, then look at the CNF line below for the equivalent in proper form.
Recommended Posts