This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
conditional_expression [2017/08/06 12:45] – justin | conditional_expression [2020/02/14 12:40] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | A **conditional expression** is an expression that evaluates to either true or false. An operator at the middle of the expression (for example " | + | A **conditional expression** is an expression that evaluates to either true or false. An operator at the middle of the expression (for example " |
^Operator^Expression evaluates to true when:^ | ^Operator^Expression evaluates to true when:^ | ||
Line 10: | Line 10: | ||
|< =|Left operand is **less than or equal to** the right operand.| | |< =|Left operand is **less than or equal to** the right operand.| | ||
|>|Left operand is **greater than** the right operand.| | |>|Left operand is **greater than** the right operand.| | ||
- | |> =|Left operand is **greater than or equal to** the right operand.| | + | |>=|Left operand is **greater than or equal to** the right operand.| |
|contains|Left operand **contains one or more of** the right operand.| | |contains|Left operand **contains one or more of** the right operand.| | ||
+ | |contains[x]|Left operand **contains at least x of** the right operand, where x is a number.| | ||
====Examples: | ====Examples: | ||
- | < | + | < |
- | self.property[" | + | self.property[" |
</ | </ | ||
- | < | + | Evalutes to true if the self [[entity|entity' |
+ | < | ||
global.property[" | global.property[" | ||
</ | </ | ||
- | < | + | Evaluates to true if the global property " |
- | player.inventory contains "Gold Key" | + | < |
+ | player.inventory contains "ITEM_0001" | ||
</ | </ | ||
+ | Evaluates to true if the player has at least one of " | ||
+ | <code bauxite> | ||
+ | initiator.tags contains " | ||
+ | </ | ||
+ | Evaluates to true if the initiator [[entity|entity' | ||