send_message - ryzom/ryzomcore GitHub Wiki


title: Send Message description: Send a message to an external service like EGS published: true date: 2026-03-14T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:32:51.237Z

send_message

The send_message action sends a CCAisActionMsg transport class message from the AI service to another service. The message carries the alias of the NPC group's state machine and a list of content strings as payload.

In practice, the only destination service that processes this message is EGS (Entities Game Service), where it is handled by the mission manager.

Parameter Syntax

Each line in the parameters becomes one element in the content string list. The first line is the destination service name.

<service_name>
<param_0>
<param_1>
...

Parameters

  • <service_name>: The short name of the destination service (e.g. EGS)
  • <param_0>, <param_1>, ...: Content strings sent as the message payload

EGS Mission Commands

When the destination is EGS, the message is received by CCAisActionMsgImp::callback in the mission manager. It expects exactly 2 content parameters: a mission name and a command.

EGS
<mission_name>
<command>
  • <mission_name>: The name of the mission as defined in the World Editor mission node. This is resolved to a mission alias.
  • <command>: One of the following:
Command Description
end_escort Triggers a CMissionEventEscort for all players who have an active instance of this mission. Used to signal that an escort objective is complete.
fail Fails the mission for all players who currently have an active escort step in this mission. Only affects instances that are on an escort step.
(any other string) Triggers a CMissionEventAIMsg with the command string as payload for all players who have an active instance of this mission. The mission script can use recv_ai_msg steps to wait for specific AI message strings.

Examples

Signal escort completion

When an NPC group reaches its destination, signal the EGS that the escort mission is complete:

EGS
MY_ESCORT_MISSION_1
end_escort

Fail an escort mission

If the escorted NPCs are killed, fail the mission:

EGS
MY_ESCORT_MISSION_1
fail

Send a custom AI message to a mission

Send a custom string that a mission script can listen for using recv_ai_msg:

EGS
MY_CUSTOM_MISSION_1
objective_complete

The mission script would contain a step like recv_ai_msg : objective_complete to advance when this message is received.

Technical Details

The action constructs a CCAisActionMsg (defined in server_share/msg_ai_service.h) containing:

  • Alias: The alias of the group's state machine owner (set automatically)
  • Content: A vector<string> built from the parameter lines (excluding the service name)

The message is sent via the NeL transport class system to the named service. If the content does not have exactly 2 strings when received by EGS, a warning is logged and the message is discarded.

See also

  • Code: For more complex inter-service communication, use AI script functions like queryEgs()
  • Trigger Event: For inter-group communication within the AI service

Source: ryzom/server/src/ai_service/generic_logic_action.cpp (CAILogicActionSendMessage), ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp (CCAisActionMsgImp::callback)

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