merryMalfunctioning Posted September 11, 2015 Posted September 11, 2015 This isn't a request for help, more of a gripe. Anyone who has studied computer science will know what I'm talking about. So Conditions in the Creation Kit can be combined using the logical operators AND and OR. Except that OR has a higher operator precedence than AND. In other words, a list of Conditions has to be in conjunctive normal form! If you haven't studied computer science or logic, just trust me when I say that conjunctive normal form (CNF) is NOT inuitive for this kind of thing. The inuitive way to list conditions is usually disjunctive normal form (DNF). For example, here are the requirements for an Enchantment I just made, written in DNF: (Stamina < 30) OR (Stamina < 70 AND Keyword_Active) OR (Keyword_AlwaysActive) OR (IsPlayer AND Keyword_Locked) See? We list four situations where the Enchantment will activate. It makes complete sense. Here it is again in CNF (aka: what skyrim uses): (Keyword_Active OR Stamina < 30 OR Keyword_Locked OR Keyword_AlwaysActive) AND (Keyword_Active OR Stamina < 30 OR IsPlayer OR Keyword_AlwaysActive) AND (Stamina < 70 OR Keyword_Locked OR Keyword_AlwaysActive) AND (Stamina < 70 OR IsPlayer OR Keyword_AlwaysActive) Go ahead, try to work through the logic of it. It's weird, right? Why did Bethesda implement Conditions in this way?
sen4mi Posted September 11, 2015 Posted September 11, 2015 I imagine this was something they implemented for one of their early games (Arena, Daggerfall or Morrowind, maybe?) and have kept it ever since. But note also that if you could reverse every condition and reverse the result, you would have the behavior you want. In other words, (Stamina >= 30) AND (Stamina >= 70 OR Keyword_NotActive) AND (Keyword_NeverActive) AND (IsNotPlayer OR Keyword_NotLocked) gives you the logical inverse of your original expression. Whether you can use this is, of course, another matter...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.