User Tools

Site Tools


conditional_expression

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
conditional_expression [2020/02/14 12:40] justinconditional_expression [2022/12/16 18:25] (current) justin
Line 12: Line 12:
 |>=|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|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 **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:==== ====Examples:====
 +<code bauxite>
 +global.property["chapter"] == 2
 +</code>
 +Evaluates to true if the global property "chapter" contains a numerical value equal to 2.
 <code bauxite> <code bauxite>
 self.property["visited"] self.property["visited"]
Line 20: Line 26:
 Evalutes to true if the self [[entity|entity's]] property "visited" contains the [[Boolean]] value of true. Evalutes to true if the self [[entity|entity's]] property "visited" contains the [[Boolean]] value of true.
 <code bauxite> <code bauxite>
-global.property["gems_collected">= 5+global.property["gems_collected"5
 </code> </code>
-Evaluates to true if the global property "gems_collected" contains a numerical value greater than or equal to 5.+Evaluates to true if the global property "gems_collected" contains a numerical value less than 5.
 <code bauxite> <code bauxite>
-player.inventory contains "ITEM_0001" and player.inventory contains[3] "ITEM_0005"+player.inventory contains[3] "ITEM_0005" and player.stat["level"] >= 10
 </code> </code>
-Evaluates to true if the player has at least one of "ITEM_0001" and at least 3 of "ITEM_0005" in their inventory.+Evaluates to true if the player has at least 3 of "ITEM_0005" in their inventory and their level is at least 10.
 <code bauxite> <code bauxite>
 initiator.tags contains "human" initiator.tags contains "human"
conditional_expression.1581712844.txt.gz · Last modified: 2020/02/14 12:40 by justin