condition_if - ryzom/ryzomcore GitHub Wiki
title: Condition If description: published: true date: 2023-03-16T23:13:29.114Z tags: editor: markdown dateCreated: 2023-03-16T22:31:52.006Z
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.
- condition expression: The condition expression to evaluate.
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.
- 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.