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:
- Don't make any changes. Just warn the user, and they can decide whether the problem needs fixing.
- 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.
- 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
appearance | Checks 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. |
arrays | Ensures 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 |
auto | Check all auto attributes are valid and special modifiers (like bedfor, etc) are appropriate. |
circular treatas | Now 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. |
containers | Checks maxload and volume capacity of containers. |
deprecated | Lists all deprecated but still functional attributes. |
exits | Makes sure that all exits and partexits are pointing at valid locations. |
flagatts | This checks for the presence of attributes required by certain flags, such as 'shopmob' for a shop. |
flags | Makes sure that objects don't have inappropriate flags set upon them |
mass | Checks for the presence of a 'mass' atrribute, and warns of the old deprecated style attribute. |
misc | Checks for things that don't easily fall into other categories. Currently, it deals with clothing and weapons. |
objrefs | Checks that objects referenced by certain attributes actually exist, such as 'treatas' or 'wornfrom'. |
parsing | Looks for text in object names that might cause ambiguous or confusing matcher outputs. |
plans | Makes sure a plan is formatted correctly and is comprised only of valid commands |
rants | Makes sure that any rants are valid commands and that auxiliary ranter attributes are correct if present |
simulations | Checks all simulation related attributes |
spelling | Spellchecks names and description attributes using our internal dictionary |
syntax | Checks that every lua.* property is a valid lua chunk. It'll compile, but no promises are made that it will run. |
tells | Checks for the list of default tells, and verifies that all existing tells are valid commands. |
traps | Checks the names of all lua.* properties against a list of known valid traps. Shoudl catch any obvious mistakes like typoed trap names |
wild | For 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.