set_condition_success - ryzom/ryzomcore GitHub Wiki


title: Set Condition Success description: Set the result flag for a dynamic_if condition evaluation published: true date: 2026-03-14T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:27:51.384Z

setConditionSuccess

The setConditionSuccess native AI script function sets a static boolean flag that the dynamic_if action type reads to determine which sub-action to execute.

This function is an internal mechanism used by dynamic_if. You do not need to call it directly — the dynamic_if action automatically wraps your expression in code that calls setConditionSuccess. It is documented here for completeness. {.is-info}

Syntax

()setConditionSuccess(value: f)

Arguments

  • value (float): Non-zero for true, zero for false.

How it works

The dynamic_if action type wraps your expression into AI script code like this:

if (<your_expression>) { ()setConditionSuccess(1); } else { ()setConditionSuccess(0); }

This code is compiled and executed at runtime. The setConditionSuccess call sets a static global boolean (CAILogicDynamicIfHelper::_ConditionSuccess), which the dynamic_if action reads immediately after execution to decide which sub-action to run.

The flag is reset to false before each dynamic_if evaluation, so stale values from previous calls don't affect the result.

See also

  • dynamic_if — The action type that uses this function internally

Source: ryzom/server/src/ai_service/nf_grp.cpp (setConditionSuccess_f_), ryzom/server/src/ai_service/ai_logic_action.h (CAILogicDynamicIfHelper)

⚠️ **GitHub.com Fallback** ⚠️