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.
(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
($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.