World Editor NPC Documentation

 

NPC

NPC Event Handling

In Ryzom Core NPCs can be scripted through a sophisticated event/action system. The system works by declaring an event to listen for and then assigning an action to that event. There are approximately 62 events and 36 actions available at your disposal but some actions, such as the code action allow you to write your action handlers in advanced AI scripting which provides a nearly unlimited number of potential actions. Below we we detail the various events and actions available to you. You can define an event handler at either the npc_zone/npc_route level or at the npc_group level.

The "event" set_flags_on_dyn_zones erroneously appears as an event in World Editor and is in truth an unused, deprecated action. Do not use it.

NPC Event Variables

In the NPC Event Actions section you'll find several actions which harness variables. In Ryzom Core there are two types of variables accessible through NPC Events: local and foreign. Local and Foreign variables are essentially the same thing with some differences in how they are retrieved or referred to in event actions.

Variables

Variables are members of the current group (npc_group) and are expressed with a 'v' followed by the variable id (0-3). Example : v0. Variables are useful for functionality such as global state in an event, coordinating actions across multiple events, etc. They're used because the variables declared within a code block do not exist outside of that code block's execution.

All variables are floating point variables.

 

Foreign Variables

Foreign variables are variables which come from another npc_group. If you have multiple groups of NPCs coordinating their actions this is a convenient way to share state and other data between the two groups.

They are expressed with the group name followed by a colon ':' then followed by a local variable identifier (v). Example: group_1:v2.

When attempting to access a foreign variable that variable's npc_group name must be globally unique.