Main Connecting Starting



Building: The System Checklist

Checklist is a tool that performs a number of basic sanity checks upon the contents of a zone, ensuring that no trivial syntax or presentation errors have been made by its builders.

The command itself is a simple lua verb that runs several traps on every object in the specified zone. There shouldn't be any need to alter the verb itself. The hard work is done by the lua.checklist.* traps set on the system_checklist_1 object, which lives in system_zone.

Checklist traps

Each one of the traps is called once per object in the zone. Its arguments are pl=the player using checklist, o1=the checklist object, and o2=the object being checked. Within one of these traps you can do pretty much anything that lua lets you do, but please follow these guidelines:

  1. Don't make any changes. Just warn the user, and they can decide whether the problem needs fixing.
  2. Try to avoid complex nested loops. The trap can only run for so long before the lua timeout kicks in, which will make the checklist pretty useless for large and complex zones.
  3. Be consistent! The reporting mechanism is quite simple... take a look at the source for one of the current checklist traps to see for yourself.

Feel free to add your own checklist traps if you feel they are required, but if possible you should try to extend an existing trap to keep all similar checks in one place making it somewhat easier to maintain the system in future.

Current checklists

appearanceChecks for the presence of correct colourcodes and content of short/long/name attributes, plurals, and checks for the presence of descs and that they do not contain common typos or style errors.
arraysEnsures that the given size and the number of entries for common arrays are equal, and that any array references to objects (like shop.*) point to real objects
autoCheck all auto attributes are valid and special modifiers (like bedfor, etc) are appropriate.
circular treatasNow we support multiple levels of inheritance, warn about circular treatas references. This doesn't actually break stuff, but it is a sign of something wrong.
containersChecks maxload and volume capacity of containers.
deprecatedLists all deprecated but still functional attributes.
exitsMakes sure that all exits and partexits are pointing at valid locations.
flagattsThis checks for the presence of attributes required by certain flags, such as 'shopmob' for a shop.
flagsMakes sure that objects don't have inappropriate flags set upon them
massChecks for the presence of a 'mass' atrribute, and warns of the old deprecated style attribute.
miscChecks for things that don't easily fall into other categories. Currently, it deals with clothing and weapons.
objrefsChecks that objects referenced by certain attributes actually exist, such as 'treatas' or 'wornfrom'.
parsingLooks for text in object names that might cause ambiguous or confusing matcher outputs.
plansMakes sure a plan is formatted correctly and is comprised only of valid commands
rantsMakes sure that any rants are valid commands and that auxiliary ranter attributes are correct if present
simulationsChecks all simulation related attributes
spellingSpellchecks names and description attributes using our internal dictionary
syntaxChecks that every lua.* property is a valid lua chunk. It'll compile, but no promises are made that it will run.
tellsChecks for the list of default tells, and verifies that all existing tells are valid commands.
trapsChecks the names of all lua.* properties against a list of known valid traps. Shoudl catch any obvious mistakes like typoed trap names
wildFor rooms patched into wilderni, verifies they have correct wilderness attributes set

What checklist doesn't yet do

Checklist doesn't do fine-grained attribute level sanity checking... thats' still the preserve of the checkattributes command. In time, the two may be merged when we've finally got a good object schema design working.