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

moveToZone

The moveToZone native AI script function moves the current group from one zone to another. The group will path-find to the destination zone.

Syntax

()moveToZone(from: s, to: s)

Arguments

  • from (string): The full alias name of the starting npc_zone.
  • to (string): The full alias name of the destination npc_zone.

Zone Names

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:

These functions return zone name strings that can be passed directly as parameters.

Example

// 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);
}

See also

Source: ryzom/server/src/ai_service/nf_grp_npc.cpp (moveToZone_ss_)

⚠️ **GitHub.com Fallback** ⚠️