Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

NPC

AI Activities

Note

These activities can be chosen on any npc_route or npc_zone.

 

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.

Note

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 Actions

The NPC event handlers can have one or more actions. Events are where actions are essentially triggered. Actions are where all of your logic will exist and the set of actions available and your ability to chain them gives you a tremendous amount of power. Within World Editor event actions provide a text area titled parameters which allows you to pass parameters to the event action.

Note

TODO Discuss States

Note

TODO Discuss Variables

 

AI Scripting

The Ryzom Core AI system has a sophisticated custom scripting language that is used for scripting the various group states.

Please see the AI Scripting Overview for more information.

You can also get thorough documentation by going to AI Scripting Native Functions Reference.

Here's an example of a simple code block:

Code Block
(aggroSize)getAggorListSize(0);
// to much player are attacking the boss
if (aggoroSize > 10)
{
($player1)getAggroListElement(0);
($player2)getAggroListElement(1);
($player3)getAggroListElement(2);
// so the boss teleport 3 person from its aggro list at the end of the world
teleportPlayer($player1, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
teleportPlayer($player2, 14233, 123123, 0, 0);
clearAggroList();
}

In addition to code segments within AI actions you can also create AI script templates in World Editor using the script_rep and script nodes. It looks a little like this:

Image Added
AI Script Rep Container in World Editor

Image Added
AI Script Window for Script Rep