Skip to content

condition_if

Ryzom Core Wiki edited this page Jul 8, 2024 · 11 revisions

title: Condition If description: published: true date: 2023-03-16T23:13:29.114Z tags: editor: markdown dateCreated: 2023-03-16T22:31:52.006Z

condition_if

The condition_if action performs a conditional test on group variables. It requires one sub-action. If the condition is met, then the sub-action is executed.

Parameters

  • condition expression: The condition expression to evaluate.

Condition Expression

The condition expression must follow the pattern:

<local_variable> <operator> <local_variable|foreign_variable|constant_value>

where operator can be one of <, >, =, !=, <=, >=.

Each group has a set of four variables with IDs 0 to 3. Local variables are the variables of the current group and are expressed with a v followed by the variable ID (0-3), for example, v0.

Foreign variables are variables that come from another group. They are expressed with the group name followed by a colon : and then followed by a local variable identifier (v), for example, group_1:v2. Note that foreign variables are accessible only if the group name is unique in the manager or the world.

Constant values are floating-point numerical expressions in base 10.

See also

  • Condition If Else: A similar action that performs a conditional test and executes one of two sub-actions depending on whether the condition is met or not.
  • Modify Variable: An action that modifies a variable in a group by performing arithmetic operations with other variables or constants. This action can be useful in conjunction with condition_if.
  • Code: An action that executes a block of AI script code. This action can be used for more advanced conditional testing and branching that cannot be achieved with condition_if.
Clone this wiki locally