action_type - ryzom/ryzomcore GitHub Wiki


title: NPC Logic Action Types description: List of available action types for controlling the logic, behaviour, and activity of NPCs published: true date: 2023-03-12T01:56:09.631Z tags: editor: markdown dateCreated: 2023-03-11T13:46:55.145Z

Available Action Types

The NPC logic system provides a variety of action types for controlling the behavior of NPCs in Ryzom Core. These actions include logic action flow, behavioral state flow, timers and event triggers, behavioral actions, activity state, general-purpose actions, and special-purpose actions. Each action type is documented with a description of its functionality and usage.

Below are all the available action types in the NPC logic system.

Logic Action Flow

Basic actions that control the flow of the action logic.

Action Type Documentation Description
code Code Execute a block of AI script code
condition_if Condition If Performs a conditional test on group variables and executes a sub-action if the condition is met
condition_if_else Condition If Else Performs a conditional test on a group variable and executes one of two sub-actions
modify_variable Modify Variable Modify a variable in a group by performing arithmetic operations with other variables or constants
multi_actions Multi Actions Execute all child actions in sequence
null_action Null Action Does nothing, useful in combination with random_select to create actions that are not always executed
random_select Random Select Executes one of its child actions at random

Behavioural State Flow

An AI state can either be an npc_zone, which specifies the movement and activity of the bots, or an npc_punctual_state. It can also contains its own event handlers, so bots can have different behaviours depending on their current state. The initial state of an NPC group is their parent node in World Editor.

Action Type Documentation Description
begin_state Begin State Switch to another state
punctual_state Punctual State Suspend the current active state and begin a punctual state, which has no positional behavior
punctual_state_end Punctual State End Deactivate the current punctual state and return to the previously suspended positional state
random_select_state Random Select State Changes the state of the NPC group to one of the listed states at random based on their assigned weights

Timers and Event Triggers

Timers and actions that the control the flow of the action logic by triggering events on the NPC group.

Action Type Documentation Description
set_punctual_state_timeout Set Punctual State Timeout Timer that triggers the punctual_state_timeout event unless the punctual state is ended or changed before the timer elapses
set_state_timeout Set State Timeout Sets up a timer that triggers the state_timeout event unless the state is changed before the timer elapses
set_timer_t0 .. set_timer_t3 Set Timer T0-3 Set a timer for a game cycle duration or at a specific Ryzom time that triggers a timer_t0_triggered to timer_t3_triggered event
trigger_event_0 .. trigger_event_9 Trigger Event 0-9 Triggers a user_event_0 to user_event_9 event handler for one or more specified other NPC groups

Behavioural Actions

These are actions that directly instruct the bots in NPC groups to do specific simple things. For more advanced actions that require variable runtime parameters, use the built-in AI script functions in the Code (code) action instead. However, it is recommended to prefer using these basic action types whenever no code action is required otherwise, for performance savings reasons, as the AI script code is executed in a special purpose bytecode VM which adds another layer of runtime complexity.

Action Type Documentation Description
despawn Despawn Despawn the bots of a specified group, either as soon as they are within visibility of a player, or immediately
emot Emote Plays an emote on either all bots or specified bots within a group (NOTE: It really is "emot", not "emote")
facing Facing Makes the first specified NPC face the second specified NPC
npc_say NPC Say A specified NPC says a literal sentence or DSS ID (Ryzom Ring specific) in regular say mode only
say Say The first bot in the group says something, with the option to specify the mode of speech
sit_down Sit Down Causes all bots in the group to sit down
spawn Spawn Spawn all the bots in the NPC group
stand_up Stand Up Make all the bots in the group stand up who are currently sitting

Behavioural Activity State

Activity and state changes that affect bot behaviour.

Action Type Documentation Description
set_fauna_activity Set Fauna Activity Toggle the fauna activity between rest and food
set_flags_on_dyn_zones Set Flags on Dyn Zones Set specified flags on a cell under the current state node

General Purpose

Actions of more technical nature.

Action Type Documentation Description
send_message Send Message Sends a free-form string message to an external service like EGS

Special Purpose

Some actions are specific to Ryzom gameplay implementation.

Action Type Documentation Description
outpost_giver_ready Outpost Giver Ready Inform the outpost that one of the outpost mission giver groups is ready to spawn (Deprecated)
outpost_send_squad_status Outpost Send Squad Status ---
outpost_report_squad_leader_death Outpost Report Squad Leader Death ---
outpost_report_squad_death Outpost Report Squad Death ---
spawn_dyn_group Spawn Dyn Group (Not for production use)

See also

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