get_zone_with_flags - ryzom/ryzomcore GitHub Wiki
title: Get Zone With Flags description: published: true date: 2023-03-16T23:08:03.257Z tags: editor: markdown dateCreated: 2023-03-16T22:24:56.592Z
The getZoneWithFlags native AI script function is used to retrieve the name of a randomly chosen zone that matches specified flags.
(Zone: s)getZoneWithFlags(OneOf: s, Mandatory: s, ExceptZone: s) // getZoneWithFlags_sss_s
(Zone: s)getZoneWithFlags(OneOf: s, Mandatory: s, ExceptZone: s, ExceptProperties: s) // getZoneWithFlags_ssss_s
- OneOf (string): A '|' separated list of flags. The zones must have at least one of these flags to be selected.
- Mandatory (string): A '|' separated list of flags. The zones must have all these flags to be selected.
- ExceptZone (string): A zone name. The returned zone cannot be this zone.
- ExceptProperties (string, optional): A '|' separated list of flags. The selected zone cannot have any of these flags.
- Zone (string): The name of a zone matching at least one of the OneOf flags, all Mandatory flags, and none of the ExceptProperties flags. If specified, the zone name cannot be ExceptZone.
($zone)getZoneWithFlags("food|rest", "invasion|outpost", $oldzone); // Get a zone which matches invasion, outpost and either food or rest flags with the best score except $oldzone.
($zone)getZoneWithFlags("boss", "", $oldzone); // Get a zone which matches boss flag with the best score except the $oldzone.
In these examples, the getZoneWithFlags
function is called to retrieve the name of a zone. The first example retrieves a zone that matches at least one of the 'food' or 'rest' flags, and all of the 'invasion' or 'outpost' flags. The returned zone cannot be the zone named $oldzone
. The second example retrieves a zone that matches the 'boss' flag. The returned zone cannot be the zone named $oldzone
.
If the ExceptProperties
parameter is specified, the selected zone cannot have any of the flags listed.