How matching works: ------------------- If you look in match.c, there are 3 levels of function. First and lowest level is the private string matching function, which is used by match(). match() itself is next, and is not intended for heavy direct use, since its interface is complex (complex by necessity, unfortunately). The interface to match is designed to be as extensible as possible, with match accepting a list of things to match across, and what attribute to compare against in each thing. For a simplistic initial implementation it would have been sufficient to hardcode match to look at just var_name, but eventually the limitations inherent in such an approach would become obvious. Each struct Mtch has a pointer to a list (or single object ID), the name of the attribute to look up across that list, and a set of flags. For now the only values that can be passed in the flags is a flag to enable exit-style matching on that particular attribute. More may be added in the future. Match is called and iterates across the list, looking for the best match, or randomizing, depending on the flags passed to the function as a whole (see match.h). 99% of the people programming UnterMUD should be able to get away with the "utility" match routines such as match_local(), or match_inv(), which are also declared in match.c. These functions try to assemble a "usual" set of things to match against, check error, and should greatly simplify using matching. If the utility matching routines are not sufficient, you can use them as examples in coding your own, and if the matching routine you require is generally useful enough, add it to match.c. Match_inv() is a fun eexample, since it does some rather "smart" things with a flag to indicate if inventory matching should also include the object in use. This is a pretty powerful interface to a pretty generic matching routine, if I say so myself. mjr. '91