wait_in_zone - ryzom/ryzomcore GitHub Wiki
title: Wait in Zone description: Make a group wander in a specified zone published: true date: 2026-03-14T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:31:23.864Z
The waitInZone native AI script function makes the group wander in the specified zone. This is useful to prevent the group from looping a previous movement profile.
()waitInZone(zone: s)-
zone (string): The full alias name of an
npc_zoneprimitive node defined in World Editor.
Zone names are the full alias names of npc_zone nodes from the World Editor primitive tree. These are the same zones that serve as behavioral states for NPC groups. The full name typically follows the primitive hierarchy, e.g. continent:manager:zone_name.
In practice, you should not hardcode zone names. Instead, obtain them dynamically from the zone lookup functions:
- getZoneWithFlags — find a zone matching specific flags
- getNearestZoneWithFlags — find the nearest matching zone to a position
- getNeighbourZoneWithFlags — find a matching zone in neighbouring cells
These functions return zone name strings that can be passed directly to waitInZone.
// Find a zone with "rest" flag and wander there
($zone)getZoneWithFlags("food", "start", "");
if ($zone != "")
{
()waitInZone($zone);
}- moveToZone — Move the group from one zone to another
- wander — Wander in the current state's zone
- stopMoving — Stop all movement
- startMoving — Move to a specific position
- getZoneWithFlags — Look up zones by flags
Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (waitInZone_s_)