Difference between revisions of "Category:Conditions"

602 bytes added ,  16:26, 29 March 2012
m
→‎AND/OR Precedence: typo, well spotted RandomNoob
imported>Bnesmith
 
imported>Tunaisafish
m (→‎AND/OR Precedence: typo, well spotted RandomNoob)
 
(2 intermediate revisions by 2 users not shown)
Line 8: Line 8:
* [[:Category:Dialogue|Dialogue]]
* [[:Category:Dialogue|Dialogue]]
* [[:Category:Packages|Packages]]
* [[:Category:Packages|Packages]]
* [[:Category:Perk|Perk]]
* [[Perk Entry]]
* [[Effect Item]]
* [[Terminal]]
* [[Camera Paths]]


=='''The Condition List'''==
=='''The Condition List'''==
Line 38: Line 43:
The Comparison Value is normally a text field where a value is entered by hand. However, if the '''Use Global''' checkbox is checked, the Value is instead a dropdown list in which a global variable can be selected to use as the Comparison Value instead.
The Comparison Value is normally a text field where a value is entered by hand. However, if the '''Use Global''' checkbox is checked, the Value is instead a dropdown list in which a global variable can be selected to use as the Comparison Value instead.


===AND/OR Precedence===
The OR checkbox is used to determine how a Condition Item is evaluated with the ones that follow it. Consecutive ORs are treated like a single block when evaluating and have order precedence over AND. For example, the Condition Items (A AND B OR C AND D) are evaluated as (A AND (B OR C) AND D) and not ((A AND B) OR (C AND D)).


The OR checkbox is used to determine how a Condition Item is evaluated with the ones that follow it. Consecutive ORs are treated like a single block when evaluating and have order preference over AND. For example, the condition items ( A AND B OR C AND D ) are evaluated as ( A AND ( B OR C ) AND D ) and not ( ( A AND B ) OR ( C AND D ) ).
By applying the [http://en.wikipedia.org/wiki/Logical_disjunction#Properties distributive and other properties] complex expressions can be converted into a list of Condition Items that will evaluate as intended. For example, the expression ((A AND B) OR (C AND D)) can be represented as the list of Condition Items (A OR C AND B OR C AND A OR D AND B OR D).  As described above, this evaluates as ((A OR C) AND (B OR C) AND (A OR D) AND (B OR D)) which is equivalent to the initial expression.




[[Category:Quests]]
[[Category:Quests]]
[[Category:Scripting]]
[[Category:Scripting]]
Anonymous user