get_neighbour_zone_with_flags - ryzom/ryzomcore GitHub Wiki


title: Get Neighbour Zone With Flags description: published: true date: 2023-03-12T21:38:35.325Z tags: editor: markdown dateCreated: 2023-03-12T21:38:31.161Z

getNeighbourZoneWithFlags

The getNeighbourZoneWithFlags native AI script function is used to retrieve the name of a zone in a neighbouring cell that matches a specified set of flags. Priority is given to the current cell, then neighbouring cells, and finally all cells. The current zone cannot be returned.

Syntax

(zone: s)getNeighbourZoneWithFlags(currentZone: s, oneOf: s, mandatory: s) // getNeighbourZoneWithFlags_sss_s
(zone: s)getNeighbourZoneWithFlags(currentZone: s, oneOf: s, mandatory: s, exceptProperties: s) // getNeighbourZoneWithFlags_ssss_s

Arguments

  • currentZone (string): The name of the current zone.
  • oneOf (string): A '|' separated list of flags. The returned zone must match at least one of these flags.
  • mandatory (string): A '|' separated list of flags. The returned zone must match all of these flags.
  • exceptProperties (string): A '|' separated list of flags. The returned zone must not match any of these flags.

Return value

  • zone (string): The name of the zone that matches the specified flags.

Example

($zone1)getNeighbourZoneWithFlags($zone, "boss", ""); // Get the name of a zone in a neighbouring cell that matches the "boss" flag.
($zone1)getNeighbourZoneWithFlags($zone, "boss", "", $exceptflag); // Get the name of a zone in a neighbouring cell that matches the "boss" flag and does not match the flags in the $exceptflag variable.

In the first example, the function getNeighbourZoneWithFlags is called with the current zone name and the flags "boss". The function returns the name of a neighbouring zone that matches the "boss" flag.

In the second example, the function getNeighbourZoneWithFlags is called with the current zone name, the flags "boss", and the exceptProperties variable. The function returns the name of a neighbouring zone that matches the "boss" flag and does not match any of the flags in the $exceptflag variable.

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