LavishNav:Region Groups

From Lavish Software Wiki
Jump to navigation Jump to search

Overview

A region group is a logical set (or list) of regions.

Region groups are useful when it is necessary to find a given resource or given regions based on certain factors. For example, say you want to find the nearest merchant to a player location. If you'll be doing this more than once in the same general area, then you probably want to have a list of every nearby merchant. That list can then be used to find the nearest merchant, instead of having to loop through every nearby region to determine if there's a merchant each time. The list of nearby merchants is the intersection of a set containing every merchant, and the set containing every nearby region (which you dont need to make yourself).

Using region groups

Region groups are generally used by declaring a lnavregiongroup variable, which can be used to hold subsets of other sets, or can otherwise be populated with regions.

Named Region Groups

Named region groups are unique sets of regions that can be referred to by their given name. For example, you may wish to keep a master list of merchants in a group called "Merchants". This can be used universally by using the LNavRegionGroup TLO. Named region group associations are stored with the region in XML, so named groups can be stored forever instead of being generated later.

See Also