Difference between revisions of "Category:Conditions"

507 bytes added ,  14:44, 6 August 2010
Added to "AND/OR Precedence" section
imported>Quetzilla
imported>Hugepinball
(Added to "AND/OR Precedence" section)
Line 43: 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 B AND B OR C AND A OR D AND B OR D).  As described above, this evaluates as ((A OR B) 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