From Dwarf Fortress Wiki
Jump to navigation Jump to search

{{av}} is a complex template - this is a reference guide explaining some important parts.


This template consists of 2 main parts: Variable definitions and a table (as well as documentation).


Variables are used to cut down on #ifexist - storing the result in a variable does not require multiple, identical invocations of an expensive parser function (also, it's a lot easier to read).

The variables defined in the template are list

  • PAGE: The current page - uses the first parameter to av if specified, or defaults to {{PAGENAME}} (this is not implemented completely – you can specify a page name for av to use, but the colors are still determined by the namespace)
  • Existence checks
    • e4, e3, e2, e1: These variables are set to 1 if the article exists in the corresponding namespace. The e stands for "exists".
      • Currently, DF2012=4, v0.31=3, 40d=2, and 23a=1. DF2012 is likely to change when the next version is released, so using the namespace as the variable name would make updating the template harder.
      • Note that this variable is blank when the page does not exist (this is for easy use with #if, which treats a blank string as false). If you need 0 to represent false, use {{#var:e4|0}} (this technique is used with eboth)
    • emw: 1 if the page exists in the Masterwork (mod) namespace
    • evan (Abbreviation of "exists in vanilla DF"): 1 if the page exists in any vanilla namespace
    • emod: 1 if the page exists in any mod namespace. This is currently redundant, since Masterwork is the only mod currently implemented. However, this should not be used when checking for a mod (don't resort to emw just because it works at the moment)
    • ismod: 1 if the current page is about a mod (not exactly related, but close enough)
    • eboth: 1 if the page exists in a vanilla and mod namespace
    • enone: 1 if the page does not exist in a vanilla or mod namespace (this is not the opposite of eboth - both are blank if the page exists in one set of namespaces but not the other)