Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »

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.

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:

(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:


AI Script Rep Container in World Editor


AI Script Window for Script Rep


 

  • No labels