This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
conditional_expression [2017/08/06 07:29] – created justin | conditional_expression [2022/12/16 18:25] (current) – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | A **conditional expression** is an expression that evaluates to either true or false. | + | 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:^ | ||
+ | |==|Left operand is **equal to** the right operand.| | ||
+ | |!=|Left operand is **not equal to** the right operand.| | ||
+ | |<|Left operand is **less than** 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 or equal to** the right operand.| | ||
+ | |contains|Left operand **contains one or more of** the right operand.| | ||
+ | |!contains|Left operand **does not contain one or more of** the right operand.| | ||
+ | |contains[x]|Left operand **contains at least x of** the right operand, where x is a number.| | ||
+ | |!contains[x]|Left operand **does not contain at least x of** the right operand, where x is a number.| | ||
+ | |||
+ | ====Examples: | ||
+ | <code bauxite> | ||
+ | global.property[" | ||
+ | </ | ||
+ | Evaluates to true if the global property " | ||
+ | <code bauxite> | ||
+ | self.property[" | ||
+ | </ | ||
+ | Evalutes to true if the self [[entity|entity' | ||
+ | <code bauxite> | ||
+ | global.property[" | ||
+ | </ | ||
+ | Evaluates to true if the global property " | ||
+ | <code bauxite> | ||
+ | player.inventory contains[3] " | ||
+ | </ | ||
+ | Evaluates to true if the player has at least 3 of " | ||
+ | <code bauxite> | ||
+ | initiator.tags contains " | ||
+ | </ | ||
+ | Evaluates to true if the initiator [[entity|entity' | ||
- | ^Operand^Description^ | ||
- | |==| | | ||
- | |!=| | | ||
- | |<| | | ||
- | |<=| | | ||
- | |>| | | ||
- | |>=| | | ||
- | |contains| | |