-
Notifications
You must be signed in to change notification settings - Fork 94
get_nearest_zone_with_flags
Ryzom Core Wiki edited this page Jul 8, 2024
·
4 revisions
title: Get Nearest Zone With Flags description: published: true date: 2023-03-16T23:07:29.996Z tags: editor: markdown dateCreated: 2023-03-16T22:24:14.244Z
The getNearestZoneWithFlags and getNearestZoneWithFlagsStrict native AI script functions are used to retrieve the nearest zone from a specified point that matches certain criteria. The difference between the two functions is that getNearestZoneWithFlags takes into account the free space of the zones, while getNearestZoneWithFlagsStrict does not.
(Zone: s)getNearestZoneWithFlags(X: f, Y: f, OneOf: s, Mandatory: s) // getNearestZoneWithFlags_ffss_s
(Zone: s)getNearestZoneWithFlags(X: f, Y: f, OneOf: s, Mandatory: s, ExceptProperties: s) // getNearestZoneWithFlags_ffsss_s
(Zone: s)getNearestZoneWithFlagsStrict(X: f, Y: f, OneOf: s, Mandatory: s) // getNearestZoneWithFlagsStrict_ffss_s
(Zone: s)getNearestZoneWithFlagsStrict(X: f, Y: f, OneOf: s, Mandatory: s , ExceptProperties: s] // getNearestZoneWithFlagsStrict_ffsss_s
- X (float): The X position of the point to find the nearest zone from.
- Y (float): The Y position of the point to find the nearest zone from.
- OneOf (string): A "|" separated list of zone flags. At least one of these flags must be present in the matching zone.
- Mandatory (string): A "|" separated list of zone flags. All of these flags must be present in the matching zone.
- ExceptProperties (string, optional): A "|" separated list of zone flags. The matching zone cannot have any of these flags.
- Zone (string): The name of the nearest zone that matches the specified criteria.
($zone)getNearestZoneWithFlags(x, y, "food|rest", "invasion|outpost");
This example retrieves the nearest zone from the point (X,Y) that has at least one of the "food" or "rest" flags and both the "invasion" and "outpost" flags.
($zone)getNearestZoneWithFlagsStrict(x, y, "food|rest", "invasion|outpost", "stayaway");
This example retrieves the nearest zone from the point (X,Y) that has at least one of the "food" or "rest" flags and both the "invasion" and "outpost" flags, but the matching zone cannot have the "stayaway" flag.