move_to_zone - ryzom/ryzomcore GitHub Wiki
title: Move To Zone description: Move a group from one zone to another published: true date: 2026-03-14T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:25:50.672Z
The moveToZone native AI script function moves the current group from one zone to another. The group will path-find to the destination zone.
()moveToZone(from: s, to: s)-
from (string): The full alias name of the starting
npc_zone. -
to (string): The full alias name of the destination
npc_zone.
Zone names are the full alias names of npc_zone nodes from the World Editor primitive tree. In practice, you should obtain them dynamically from the zone lookup functions rather than hardcoding them:
- 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 as parameters.
// Move from current zone to a nearby zone with "rest" flags
($fromZone)getZoneWithFlags("food", "start", "");
($toZone)getNeighbourZoneWithFlags($fromZone, "rest", "start", "");
if ($fromZone != "" && $toZone != "")
{
()moveToZone($fromZone, $toZone);
}- waitInZone — Wander in a specified zone
- wander — Wander in the current state's zone
- startMoving — Move to a specific XYZ position
- stopMoving — Stop all movement
- getZoneWithFlags — Look up zones by flags
Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (moveToZone_ss_)