<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Lua.xsl"?>
<!DOCTYPE document [
	  <!ELEMENT document (section*,triggers,tables,types,section*)>
	  <!ATTLIST document title CDATA #REQUIRED>
	  
	  <!ELEMENT triggers (description?,(function*))>
	  <!ATTLIST triggers id ID #REQUIRED>
	  <!ELEMENT tables (description*,(table|accessor|enum|enum-accessor)*)>
	  <!ATTLIST tables id ID #REQUIRED>
	  <!ELEMENT types (description*)>
	  <!ATTLIST types id ID #REQUIRED>

	  <!ELEMENT section (description?,(section*))>
	  <!ATTLIST section name CDATA #REQUIRED>
	  <!ATTLIST section id ID #REQUIRED>
	  
	  <!ELEMENT table ((description?),(function|function-variable|subtable|subtable-accessor|variable)*)>
	  <!ATTLIST table name ID #REQUIRED>
	  <!ATTLIST table singleton (true|false) 'false'>

	  <!ELEMENT subtable ((alias*),(description?),(length?),(index?),(call?),(function|subtable|variable|note)*)>
	  <!ATTLIST subtable name CDATA #REQUIRED>
	  <!ATTLIST subtable classname ID #REQUIRED>

	  <!ELEMENT subtable-accessor ((alias?),(description?),(function|subtable|variable)*)>
	  <!ATTLIST subtable-accessor name CDATA #REQUIRED>
	  <!ATTLIST subtable-accessor classname ID #REQUIRED>
	  <!ATTLIST subtable-accessor index CDATA #REQUIRED>

	  <!ELEMENT description ANY>
	  <!ELEMENT br EMPTY>
	  <!ELEMENT p ANY>
	  <!ELEMENT pre ANY>

	  <!ELEMENT function ((description?),(argument*),(return*),(note*))>
	  <!ATTLIST function name CDATA #REQUIRED>
	  <!ATTLIST function access (local-player|all) 'all'>
	  <!ATTLIST function return (single|variant) 'single'>

	  <!ELEMENT function-variable ((description?),(argument),(type))>
	  <!ATTLIST function-variable name CDATA #REQUIRED>
	  <!ATTLIST function-variable classname CDATA #IMPLIED>

	  <!ELEMENT argument (description?,type)>
	  <!ATTLIST argument name CDATA #REQUIRED>
	  <!ATTLIST argument required (true|false) 'true'>

	  <!ELEMENT return (type)>

	  <!ELEMENT variable ((alias*), (description?),(type),(note*))>
	  <!ATTLIST variable name CDATA #REQUIRED>
	  <!ATTLIST variable access (read-only|read-write|local-player|write-only) "read-write">
	  <!ATTLIST variable version CDATA #IMPLIED>

	  <!ELEMENT accessor ((description?),(length?),(index?),(call?),(function)*)>
	  <!ATTLIST accessor name ID #REQUIRED>
	  <!ATTLIST accessor contains IDREF #REQUIRED>

	  <!ELEMENT enum-accessor ((description?),(length?),(index?),(call?))>
	  <!ATTLIST enum-accessor name ID #REQUIRED>
	  <!ATTLIST enum-accessor contains IDREF #REQUIRED>
	  <!ATTLIST enum-accessor nice-name CDATA #IMPLIED>
	  
	  <!ELEMENT enum ((description?),(function|function-variable|subtable|variable)*,(mnemonics?))>
	  <!ATTLIST enum name ID #REQUIRED>

	  <!ELEMENT mnemonics (mnemonic*)>
	  <!ELEMENT mnemonic EMPTY>

	  <!ATTLIST mnemonic name CDATA #REQUIRED>

	  <!ELEMENT length (description?)>
	  <!ELEMENT index ((description?),(type?))>
	  <!ELEMENT call (description?)>
	  <!ELEMENT type (#PCDATA)>
	  <!ELEMENT alias (#PCDATA)>
	  <!ELEMENT note (#PCDATA)>
	  <!ATTLIST note version CDATA #IMPLIED>
	  ]>
<document title="Aleph One Lua Scripters' Guide">
  <section name="General" id="general">
    <section name="What is This?" id="what_is_this">
      <description>
	<p>This is a reference for writing Lua scripts to work in Aleph One. It lists every trigger and table available to Lua scripts. It is expected that Lua functionality will grow in Aleph One, and as it does, so will this document. Not everything here is completely documented, and any help fixing that would be appreciated.</p>
	<p>This is not a reference for Lua itself - see lua.org for that.</p>
      </description>
    </section>
    <section name="Running a Script" id="running_a_script">
      <description>
	<p>There are three ways to get a script to run - by embedding it in a level, by selecting a solo script in the Environment Preferences, or by selecting a script at the gather network game dialog.</p>
	<p>To embed a script in a level, use a tool such as Atque. Use embedded Lua scripts only for map specific features, not for modifying game types. For instance, it may be tempting to embed the latest version of the Lua CTF script in a map designed only for playing CTF; however, this would prevent the user from using a later version of CTF if it were to come out, or from using another net script that works on CTF maps. Some older scenarios use Lua scripts in TEXT resources, but this is no longer recommended since they are not transmitted in net games.</p>
	<p>To use a solo script, check the "Use Solo Script" box in Environment Preferences, and choose the script file to use.</p>
	<p>To use a script via the network game dialog, put then script in a text file with the extension .lua. Then, at the gather network game dialog, select "use script", then select your script file.</p>
      </description>
    </section>
    <section name="Units" id="units">
      <description>
	<p>The unit for distance we use is World Units (WU) These are the same values you'd see in Forge or with F10 location display, and 1/1024 of what A1 uses internally and what you'd see in Pfhorte.</p>
	<p>Units for speed are . . . well let's say they're messy. :) Lua speeds are expressed in World Units per tick (a tick is 1/30 of a second). Forge claims to use WU per sec, but it actually uses 0.87890625 WU per sec (which equals 30 internal units per tick). The following example illustrates the various conversions:</p>
	<ul>
	<li><b style="display: inline-block; width: 10em; text-align: right">Actual:</b> 7.5 World Units per second</li>
	<li><b style="display: inline-block; width: 10em; text-align: right">A1 internal:</b> 256 units per tick (7.5 * 1024 / 30)</li>
	<li><b style="display: inline-block; width: 10em; text-align: right">Lua:</b> 0.25 WU per tick (7.5 / 30)</li>
	<li><b style="display: inline-block; width: 10em; text-align: right">Forge:</b> 8.53 "WU per second" ((7.5 * 1024 / 30) / 30)</li>
	</ul>
      </description>
    </section>
    <section name="Local Player" id="local_player">
      <description>
	<p>A few variables are marked "local player." These variables will always do the right thing when written to, but when reading, will only return a useful result if the player they belong to is "local." In net games, there is a separate copy of each Lua script running on each player's computer, and the player is "local" only to his copy of the script.</p>
	<p>So, the only local player variables the script running on player 4's machine will be able to read from are the ones in Players[4]. For his script, the value of Players[1].zoom_active, for example, will return nil. If this confuses you, it might be better to avoid reading from any variable marked "local player."</p>
      </description>
    </section>
    <section name="Loading Collections" id="loading_collections">
      <description>
	<p>A Lua script can ask for the engine to load collections it might otherwise not load; for instance, in order to be able to spawn defenders and compilers on a map that might not have them otherwise, add the indices for those collections to the global table CollectionsUsed:
</p><pre>CollectionsUsed = { 10, 16 }</pre>
      </description>
    </section>
    <section name="Persistence" id="persistence">
      <description>
	<p>Lua scripts are only active during a single level. If the user jumps to a new level, or restores from a saved game, the script is restarted in a clean state.</p>
	<p>It is now possible to pass data across level jumps, by using the Game.restore_passed() function. This function will restore any custom fields (see the "Custom Fields" section of "Using Tables" below) in the Players or Game tables that were set immediately prior to the last level jump. Note that in order for data to survive multiple level jumps, Game.restore_passed() must be called after each level jump. Game.restore_passed() will not restore data from saved games.</p>
	<p>It is also possible to restore data from saved games. The Game.restore_saved() function will restore all custom fields in use at the time the game was saved.</p>
	<p>Only numbers, strings, booleans, and tables (including Aleph One's built-in userdata tables) can be restored.</p>
      </description>
    </section>
  </section>
  <triggers id="triggers">
    <description>These are functions scripts can define which Aleph One will call at specific times or events. For example, to regenerate health:
<span class="pre">Triggers = {}
function Triggers.idle()
  for p in Players() do 
    if p.life &lt; 150 and not p.dead then 
      p.life = p.life + 1
    end
  end
end
</span>
Calling Triggers = {} at the beginning of the script removes the compatibility triggers installed for old Lua scripts, speeding up execution of new scripts.
</description>
    <function name="init">
      <description>at beginning of level</description>
      <argument name="restoring_game">
	<description>true if restoring from a saved game</description>
	<type>boolean</type>
      </argument>
    </function>
    <function name="cleanup">
      <description>at end of the level</description>
      <note>primarily this is intended as a last chance for changing netgame scores before the postgame carnage report.</note>
    </function>
    <function name="idle">
      <description>at each tick, before physics and such</description>
    </function>
    <function name="postidle">
      <description>at each tick, after physics and such, but before rendering</description>
    </function>
    <function name="start_refuel">
      <description>whenever a player starts to use a refuel panel</description>
      <argument name="class"><type>control_panel_class</type></argument>
      <argument name="player"><type>player</type></argument>
      <argument name="side"><type>side</type></argument>
    </function>
    <function name="end_refuel">
      <description>whenever a player stops using a refuel panel</description>
      <argument name="class"><type>control_panel_class</type></argument>
      <argument name="player"><type>player</type></argument>
      <argument name="side"><type>side</type></argument>
    </function>
    <function name="tag_switch">
      <description>whenever a player uses a tag switch</description>
      <argument name="tag"><type>tag</type></argument>
      <argument name="player"><type>player</type></argument>
      <argument name="side"><type>side</type></argument>
      <note>not called when a projectile (e.g., fists) toggles a tag switch</note>
      <note>side is only valid in version 20111201 and newer</note>
    </function>
    <function name="light_switch">
      <description>whenever a player uses a light switch</description>
      <argument name="light"><type>light</type></argument>
      <argument name="player"><type>player</type></argument>
      <argument name="side"><type>side</type></argument>
      <note>not called when a projectile (e.g., fists) toggles a light switch</note>
      <note>side is only valid in version 20111201 and newer</note>
    </function>
    <function name="platform_switch">
      <description>whenever a player uses a platform switch</description>
      <argument name="polygon">
	<type>polygon</type>
	<description>polygon of the platform being toggled</description>
      </argument>
      <argument name="player"><type>player</type></argument>
      <argument name="side"><type>side</type></argument>
      <note>not called when a projectile (e.g., fists) toggles a platform switch</note>
      <note>side is only valid in version 20111201 and newer</note>
    </function>
    <function name="projectile_switch" version="20111201">
      <description>whenever a projectile toggles a switch</description>
      <argument name="projectile">
	<type>projectile</type>
	<description>projectile that toggled the switch</description>
      </argument>
      <argument name="side">
	<type>side</type>
	<description>side containing switch being toggled</description>
      </argument>
    </function>
    <function name="terminal_enter">
      <description>whenever a player starts using a terminal</description>
      <argument name="terminal"><type>terminal</type></argument>
      <argument name="player"><type>player</type></argument>
    </function>
    <function name="terminal_exit">
      <description>whenever a player stops using a terminal</description>
      <argument name="terminal"><type>terminal</type></argument>
      <argument name="player"><type>player</type></argument>
    </function>
    <function name="pattern_buffer">
      <description>whenever a player uses a pattern buffer</description>
      <argument name="side"><type>side</type></argument>
      <argument name="player"><type>player</type></argument>
    </function>
    <function name="got_item">
      <description>whenever a player picks up an item</description>
      <argument name="type"><type>item_type</type></argument>
      <argument name="player"><type>player</type></argument>
      <note>also whenever a player gets an item when a script calls .items.add()</note>
    </function>
    <function name="light_activated">
      <description>whenever a light is activated or deactivated</description>
      <argument name="light"><type>light</type></argument>
    </function>
    <function name="platform_activated">
      <description>whenever a platform is activated or deactivated</description>
      <argument name="polygon"><type>polygon</type></argument>
    </function>
    <function name="player_revived">
      <description>whenever a player revives (presumably only happens in a netgame)</description>
      <argument name="player"><type>player</type></argument>
    </function>
    <function name="player_killed">
      <description>whenever a player dies</description>
      <argument name="player"><type>player</type></argument>
      <argument name="aggressor_player">
	<description>the player who killed player, possibly himself (suicide) (can be nil)</description>
	<type>player</type></argument>
      <argument name="action">
	<description>dying soft, dying hard, or dying flaming</description>
	<type>monster_action</type></argument>
      <argument name="projectile">
	<description>the projectile that delivered the final blow (can be nil)</description>
	<type>projectile</type></argument>
    </function>
    <function name="player_damaged">
      <description>whenever a player has taken damage, but before he dies if applicable. The player's suit energy or oxygen may be negative when this trigger is called; if it still is when the trigger returns, it will be set to 0. The player's suit energy is tested again after this trigger returns, so a script may prevent a player's death
      </description>
      <argument name="victim">
	<type>player</type>
      </argument>
      <argument name="aggressor_player">
	<description>player who got the kill (can be nil)</description>
	<type>player</type>
      </argument>
      <argument name="aggressor_monster">
	<description>monster that got the kill (can be nil)</description>
	<type>monster</type>
      </argument>
      <argument name="damage_type">
	<description>e.g. "fists"</description>
	<type>damage_type</type>
      </argument>
      <argument name="damage_amount">
	<description>the amount recently subtracted from the player. If "oxygen drain", damage_amount was assessed against player's oxygen; otherwise against player's suit energy</description>
	<type>number</type>
      </argument>
      <argument name="projectile">
	<description>the projectile that delivered the damage (can be nil)</description>
	<type>projectile</type>
      </argument>
    </function>
    <function name="monster_damaged" version="20100118">
      <description>whenever a monster is damaged, but before it dies if applicable. The monster's vitality may be negative when this trigger is called. Ther monster's vitality will be tested again after this trigger returns, so a script may prevent a monster's death</description>
      <argument name="monster">
	<type>monster</type>
      </argument>
      <argument name="aggressor_monster">
	<description>the monster that caused the damage (can be nil)</description>
	<type>monster</type>
      </argument>
      <argument name="damage_type">
	<description>e.g. "fists"</description>
	<type>damage_type</type>
      </argument>
      <argument name="damage_amount">
	<description>the amount recently subtracted from the monster's vitality</description>
	<type>number</type>
      </argument>
      <argument name="projectile">
	<description>the projectile that delivered the damage (can be nil)</description>
	<type>projectile</type>
      </argument>
    </function>
    <function name="monster_killed">
      <description>whenever a monster dies</description>
      <argument name="monster"><type>monster</type></argument>
      <argument name="aggressor_player">
	<description>player who killed it (can be nil)</description>
	<type>player</type>
      </argument>
      <argument name="projectile">
	<description>projectile that delivered the final blow (can be nil)</description>
	<type>projectile</type>
      </argument>
      <note>called after a monster has taken lethal damage, but before it's removed from the monster list</note>
      <note>you can use this to find out when a monster created with new_monster dies, but a monster discovered by Polygons.monsters() may have already taken lethal damage, so you may need to check for that case when using Polygons.monsters()</note>
    </function>
    <function name="item_created">
      <description>whenever an item is created and placed on the ground (or floating) somewhere</description>
      <argument name="item"><type>item</type></argument>
      <note>does not trigger on initial item placement because the initial item placement is done before Lua becomes initialised.</note>
    </function>
    <function name="projectile_created" version="20150619">
      <description>whenever a projectile is created</description>
      <argument name="projectile"><type>projectile</type></argument>
    </function>
    <function name="projectile_detonated">
      <description>whenever a projectile detonates, after it has done any area of effect damage</description>
      <argument name="type"><type>projectile_type</type></argument>
      <argument name="owner"><type>monster</type></argument>
      <argument name="polygon"><type>polygon</type></argument>
      <argument name="x"><type>WU</type></argument>
      <argument name="y"><type>WU</type></argument>
      <argument name="z"><type>WU</type></argument>
    </function>
  </triggers>
  <section id="using_tables" name="Using Tables">
    <description><p>There are numerous tables (technically, userdata) defined in Aleph One which scripts can use to access objects in the game. A complete list is below.</p>
    <p>Unless otherwise specified, these tables are only valid inside the trigger calls listed above. Attempting to use them in the main body of a script may cause an error in this version or a future version of Aleph One.</p></description>
    <section id="custom" name="Custom Fields">
      <description><p>In a real Lua table, you can set any field you want. In order to help troubleshooting, Aleph One's userdata tables will only accept the fields listed in the documentation below. However, by prepending an underscore, custom fields can be indexed. These custom fields will be associated with the object until it is destroyed.</p><pre>Players[0]._favorite_flavor = "chocolate"</pre></description>
    </section>
    <section id="table_indices" name="Index">
      <description><p>Each table has a read-only .index variable, that corresponds to the engine's internal index.</p><pre>=Players[0].index<br/>0</pre></description>
    </section>
    <section id="table_is" name="is_ Functions">
      <description><p>Aleph One installs a set of boolean functions that can be used to recognize each of the userdata table types. For example, <code>is_monster(Monsters[1])</code> returns true. Each of these functions begins with the "is_" prefix.</p></description>
    </section>
  </section>
  <tables id="tables">
    <table name="annotation">
      <variable name="polygon">
	<description>polygon this annotation is associated with</description>
	<type>polygon</type>
	<note>can be nil</note>
	<note>an annotation is only shown when its polygon is visible on the overhead map</note>
      </variable>
      <variable name="text">
	<description>annotation text (64 characters max)</description>
	<type>string</type>
      </variable>
      <variable name="x">
	<type>WU</type>
      </variable>
      <variable name="y">
	<type>WU</type>
      </variable>
    </table>
    <table name="camera">
      <function name="activate">
	<description>activate camera for player</description>
	<argument name="player"><type>player</type></argument>
      </function>
      <function name="clear">
	<description>deletes all path points and angles</description>
      </function>
      <function name="deactivate">
	<description>deactivates camera</description>
      </function>
      <subtable name="path_angles" classname="lua_path_angles">
	<function name="new">
	  <description>adds a path angle</description>
	  <argument name="yaw"><type>angle</type></argument>
	  <argument name="pitch"><type>pitch</type></argument>
	  <argument name="time"><type>time</type></argument>
	</function>
      </subtable>
      <subtable name="path_points" classname="lua_path_points">
	<function name="new">
	  <description>adds a path point</description>
	  <argument name="x"><type>WU</type></argument>
	  <argument name="y"><type>WU</type></argument>
	  <argument name="z"><type>WU</type></argument>
	  <argument name="polygon"><type>polygon</type></argument>
	  <argument name="time"><type>time</type></argument>
	</function>
      </subtable>
    </table>
    <table name="effect">
      <function name="delete" version="20111201">
	<description>removes effect from map</description>
      </function>
      <variable name="facing" version="20111201">
	<description>direction effect is facing</description>
	<type>degrees</type>
      </variable>
      <function name="play_sound" version="20111201">
	<description>play sound coming from this effect</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <variable name="polygon" access="read-only" version="20111201">
	<description>polygon the effect is in</description>
	<type>polygon</type>
      </variable>
      <function name="position" version="20111201">
	<description>sets position of effect</description>
	<argument name="x">
	  <type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <variable name="type" access="read-only" version="20111201">
	<description>type of effect</description>
	<type>effect_type</type>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>
    <table name="endpoint">
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
    </table>
    <table name="game" singleton="true">
      <variable name="dead_players_drop_items" version="20150619">
        <description>whether dead players drop items</description>
        <type>boolean</type>
      </variable>
      <variable name="difficulty" access="read-only">
	<description>the difficulty level</description>
	<type>difficulty_type</type>
      </variable>
      <function name="global_random">
	<description>returns a random number between 0 and n-1 from Aleph One's original random number generator</description>
	<argument name="n"><type>number</type></argument>
	<return><type>number</type></return>
      </function>
      <variable name="kill_limit" access="read-only">
	<description>the game kill limit, or 0 if there is none</description>
	<type>number</type>
      </variable>
      <variable name="monsters_replenish" version="20111201">
	<description>whether monsters spawn or not; in a net game, this corresponds to the "Aliens" checkbox</description>
	<type>boolean</type>
	<note>this can suppress initial monster placement, if set to false directly when the script is loaded</note>
      </variable>
      <variable name="proper_item_accounting" version="20100118">
	<description>When true, the current item counts on the map are updated properly when Lua deletes map items and changes player inventories. This defaults to false to preserve film playback with older scripts. New scripts that manipulate items should always set this to true.</description>
	<type>boolean</type>
      </variable>
      <variable name="nonlocal_overlays" version="Git">
	<description>When false, only the local player's overlays are used, and only prints to the local player will be displayed. When true, the overlays and prints of whatever player is currently being viewed will apply. This defaults to false for compatibility with scripts that depend on the old behavior.</description>
	<type>boolean</type>
      </variable>
      <variable name="time_remaining" access="read-only">
	<description>the number of ticks until the game ends, or nil if there is no time limit</description>
	<type>number</type>
      </variable>
      <variable name="scoring_mode">
	<description>the current scoring mode (if the gametype is "custom")</description>
	<type>scoring_mode_type</type>
      </variable>
      <variable name="over" access="write-only">
	<description>Use this variable to override the game's default scoring behavior. If set to false, the game will not end due to a score limit. If set to true, the game ends immediately. If left unset or if set to nil, the game will end if a score limit is reached. (Note that you cannot prevent the game from ending due to a time limit.)</description>
	<type>boolean</type>
      </variable>
      <function name="local_random">
	<description>returns a random number between 0 and n-1 from Aleph One's original random number generator</description>
	<argument name="n"><type>number</type></argument>
	<return><type>number</type></return>
	<note>this is a good way to put net games out of sync</note>
      </function>
      <function name="random">
	<description>returns a random number between 0 and n-1 using a good random number generator</description>
	<argument name="n"><type>number</type></argument>
	<return><type>number</type></return>
      </function>
      <function name="restore_passed" version="20090909">
	<description>tries to restore any Player or Game custom fields from before the last level jump; returns true if custom fields were successfully restored</description>
	<note>if successful, overwrites all existing Player or Game custom fields</note>
	<return><type>boolean</type></return>
      </function>
      <function name="restore_saved" version="20090909">
	<description>tries to restore any custom fields from the saved game; returns true if custom fields were successfully restored</description>
	<note>if successful, overwrites all existing custom fields</note>
	<return><type>boolean</type></return>
      </function>
      <function name="save">
	<description>saves the game (as if the user had activated a pattern buffer)</description>
	<note>solo only</note>
      </function>
      <variable name="ticks" access="read-only">
	<description>ticks since game started</description>
	<type>time</type>
      </variable>
      <variable name="type" access="read-only">
	<description>whether the game is EMFH, KOTH, etc.</description>
	<type>game_type</type>
      </variable>
      <variable name="version" access="read-only">
	<description>the date version of the local player's engine</description>
	<note>for example, "20071103"</note>
      </variable>
    </table>
    <table name="goal">
      <variable name="facing" access="read-only" version="20111201">
	<description>direction goal is facing</description>
	<type>degrees</type>
      </variable>
      <variable name="polygon" access="read-only" version="20111201">
	<description>polygon the goal is in</description>
	<type>polygon</type>
      </variable>
      <variable name="id" access="read-only" version="20111201">
	<description>ID number of goal</description>
	<type>number</type>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>
    <table name="item">
      <function name="delete">
	<description>removes item from map</description>
      </function>
      <variable name="facing">
	<description>direction item is facing</description>
	<type>degrees</type>
      </variable>
      <function name="play_sound">
	<description>play sound coming from this item</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <variable name="polygon" access="read-only">
	<description>polygon the item is in</description>
	<type>polygon</type>
      </variable>
      <function name="position" version="20090909">
	<description>sets position of item</description>
	<argument name="x">
	  <type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <variable name="type" access="read-only">
	<description>type of item</description>
	<type>item_type</type>
      </variable>
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<type>WU</type>
      </variable>
    </table>
    <table name="item_start">
      <variable name="facing" access="read-only" version="20111201">
	<description>direction item is initially facing</description>
	<type>angle</type>
      </variable>
      <variable name="from_ceiling" access="read-only" version="20111201">
	<description>whether item location z is from ceiling</description>
	<type>boolean</type>
      </variable>
      <variable name="invisible" access="read-only" version="20111201">
	<description>whether item will teleport in</description>
	<type>boolean</type>
      </variable>
      <variable name="polygon" access="read-only" version="20111201">
	<description>item starting location polygon</description>
	<type>polygon</type>
      </variable>
      <variable name="type" access="read-only" version="20111201">
	<description>type of item</description>
	<type>item_type</type>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>

    <table name="level" singleton="true">
      <function name="calculate_completion_state" version="20081213">
	<description>returns whether level is finished, unfinished, or failed</description>
	<return><type>completion_state</type></return>
      </function>
      <variable name="completed" access="read-only" version="20111201">
	<description>check this in Triggers.cleanup() to determine whether the player(s) teleported out</description>
	<type>boolean</type>
      </variable>
      <variable name="extermination" access="read-only" version="20081213">
	<description>whether level has extermination flag set</description>
	<type>boolean</type>
      </variable>
      <variable name="exploration" access="read-only" version="20081213">
	<description>whether level has exploration flag set</description>
	<type>boolean</type>
      </variable>
      <subtable name="fog" classname="lua_fog">
	<alias>underwater_fog</alias>
	<variable name="active">
	  <alias>present</alias>
	  <description>whether fog is present</description>
	  <type>boolean</type>
	</variable>
	<variable name="affects_landscapes">
	  <description>whether fog affects landscapes</description>
	  <type>boolean</type>
	</variable>
	<subtable name="color" classname="lua_fog_color">
	  <note>values range from 0.0 to 1.0</note>
	  <variable name="r">
	    <description>red</description>
	    <type>number</type>
	  </variable>
	  <variable name="g">
	    <description>green</description>
	    <type>number</type>
	  </variable>
	  <variable name="b">
	    <description>blue</description>
	    <type>number</type>
	  </variable>
	</subtable>
	<variable name="depth">
	  <description>fog depth in WU</description>
	  <type>number</type>
	</variable>
      </subtable>
      <variable name="low_gravity" access="read-only">
	<description>whether level is low gravity</description>
	<type>boolean</type>
      </variable>
      <variable name="magnetic" access="read-only">
	<description>whether level is magnetic</description>
	<type>string</type>
      </variable>
      <variable name="name" access="read-only">
	<description>level name</description>
	<type>string</type>
      </variable>
      <variable name="index" access="read-only" version="20150619">
	<description>level index in the map file (starting from 0)</description>
	<type>number</type>
      </variable>
      <variable name="map_checksum" access="read-only" version="20150619">
	<description>checksum of map file</description>
	<type>number</type>
      </variable>
      <variable name="rebellion" access="read-only">
	<description>whether level is rebellion</description>
	<type>boolean</type>
      </variable>
      <variable name="repair" access="read-only" version="20081213">
	<description>whether level has repair flag set</description>
	<type>boolean</type>
      </variable>
      <variable name="rescue" access="read-only" version="20081213">
	<description>whether level has rescue flag set</description>
	<type>boolean</type>
      </variable>
      <variable name="retrieval" access="read-only" version="20081213">
	<description>whether level has retrieval flag set</description>
	<type>boolean</type>
      </variable>
      <variable name="vacuum" access="read-only">
	<description>whether level is vacuum</description>
	<type>boolean</type>
      </variable>
    </table>
    <table name="light">
      <variable name="active">
	<description>whether light is active</description>
	<type>boolean</type>
      </variable>
      <variable name="tag" version="20100118">
	<description>tag of light</description>
	<type>tag</type>
      </variable>
      <variable name="initial_phase" version="20100118">
	<description>phase the light starts with</description>
	<type>time</type>
      </variable>
      <variable name="initially_active" version="20100118">
	<description>whether the light was initially active</description>
	<type>boolean</type>
      </variable>
      <variable name="intensity" access="read-only" version="20100118">
	<description>current intensity for this light (range: 0-1)</description>
	<type>number</type>
      </variable>
      <subtable-accessor name="states" classname="light_state_subtable" index="light_type">
	<variable name="delta_intensity" version="20100118">
	  <description>random intensity change for this state</description>
	  <type>number</type>
	</variable>
	<variable name="delta_period" version="20100118">
	  <description>random period change for this state</description>
	  <type>time</type>
	</variable>
	<variable name="light_function" version="20100118">
	  <description>light function for this state</description>
	  <type>light_function</type>
	</variable>
	<variable name="intensity" version="20100118">
	  <description>intensity for this state</description>
	  <type>number</type>
	</variable>
	<variable name="period" version="20100118">
	  <description>period for this state</description>
	  <type>number</type>
	</variable>
      </subtable-accessor>
    </table>
    <table name="line">
      <variable name="clockwise_polygon" access="read-only">
	<alias>cw_polygon</alias>
	<description>polygon on clockwise side of line</description>
	<type>polygon</type>
      </variable>
      <variable name="clockwise_side" access="read-only">
	<alias>cw_side</alias>
	<description>clockwise side of line</description>
	<type>side</type>
      </variable>
      <variable name="counterclockwise_polygon" access="read-only">
	<alias>ccw_polygon</alias>
	<description>polygon on counterclockwise side of line</description>
	<type>polygon</type>
      </variable>
      <variable name="counterclockwise_side" access="read-only">
	<alias>ccw_side</alias>
	<description>counterclockwise side of line</description>
	<type>side</type>
      </variable>
      <subtable-accessor name="endpoints" classname="line_endpoints" index="n">
	<description>returns line endpoint n</description>
      </subtable-accessor>
      <variable name="has_transparent_side" access="read-only" version="20080707">
	<description>whether one of the line's sides has a transparent texture</description>
	<type>boolean</type>
      </variable>
      <variable name="highest_adjacent_floor" access="read-only" version="20080707">
	<description>height of higher adjacent polygon floor</description>
	<type>WU</type>
      </variable>
      <variable name="length" access="read-only">
	<description>the length of this line</description>
	<note>this might not be accurate, if someone used Chisel's stretch plugin</note>
      </variable>
      <variable name="lowest_adjacent_ceiling" access="read-only" version="20080707">
	<description>height of lower adjacent polygon ceiling</description>
	<type>WU</type>
      </variable>
      <variable name="solid" access="read-only" version="20080707">
	<description>whether line is solid</description>
	<type>boolean</type>
      </variable>
      <variable name="visible_on_automap" version="20150619">
	<description>whether line is revealed on local player's automap</description>
	<type>boolean</type>
      </variable>
    </table>
    <table name="media">
      <variable name="direction" version="20100118">
	<description>direction of media</description>
	<type>angle</type>
      </variable>
      <variable name="height" access="read-only" version="20100118">
	<description>height of media</description>
	<type>WU</type>
      </variable>
      <variable name="high" version="20100118">
	<description>high tide of media</description>
	<type>WU</type>
      </variable>
      <variable name="light" version="20100118">
	<description>light that controls this media's tide</description>
	<type>light</type>
      </variable>
      <variable name="low" version="20100118">
	<description>low tide of media</description>
	<type>WU</type>
      </variable>
      <variable name="speed" version="20100118">
	<description>speed of media</description>
	<type>speed</type>
      </variable>
      <variable name="type" access="read-only">
	<description>type of media</description>
	<type>media_type</type>
      </variable>
      <variable name="type" version="20100118">
	<description>type of media</description>
	<type>media_type</type>
      </variable>
    </table>
    <table name="monster">
      <function name="accelerate" version="20081213">
	<description>accelerates monster</description>
	<argument name="direction"><type>angle</type></argument>
	<argument name="velocity"><type>speed</type></argument>
	<argument name="vertical_velocity"><type>speed</type></argument>
      </function>
      <variable name="action" access="read-only">
	<description>current AI action of the monster</description>
	<type>number</type>
      </variable>
      <variable name="active">
	<description>whether monster has been activated</description>
	<type>boolean</type>
      </variable>
      <function name="attack">
	<description>instructs monster to attack target</description>
	<argument name="target"><type>monster</type></argument>
      </function>
      <function name="damage">
	<description>damages monster</description>
	<argument name="amount"><type>number</type></argument>
	<argument name="type" required="false"><type>damage_type</type></argument>
	<note>if no type is specified, fist damage is dealt</note>
      </function>
      <variable name="external_velocity" version="20090909">
	<description>monster's current external velocity (always in the opposite direction of facing)</description>
	<type>speed</type>
      </variable>
      <variable name="facing">
	<alias>yaw</alias>
	<description>direction the monster is facing</description>
	<type>degrees</type>
      </variable>
      <variable name="life">
	<alias>vitality</alias>
	<description>the monster's vitality</description>
	<type>number</type>
	<note>monsters that haven't spawned or teleported in yet don't have vitality</note>
      </variable>
      <variable name="mode" access="read-only">
	<description>current AI mode of the monster</description>
	<type>number</type>
      </variable>
      <function name="move_by_path">
	<description>instructs monster to move to polygon</description>
	<argument name="polygon"><type>polygon</type></argument>
	<note>monsters get distracted easily en route</note>
	<note>once it gets there, it probably won't choose to stay</note>
      </function>
      <variable name="player" access="read-only">
	<description>if monster is a player monster, the player; otherwise, nil</description>
	<type>player</type>
      </variable>
      <function name="play_sound">
	<description>plays sound coming from this monster</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <variable name="polygon" access="read-only">
	<description>polygon this monster is in</description>
	<type>polygon</type>
      </variable>
      <function name="position">
	<description>sets position of monster</description>
	<argument name="x">
	  <type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <variable name="type" access="read-only">
	<description>type of monster</description>
	<type>monster_type</type>
      </variable>
      <variable name="valid" access="read-only">
	<description>whether monster is still valid</description>
	<type>boolean</type>
      </variable>
      <variable name="vertical_velocity" version="20090909">
	<description>monster's current vertical external velocity</description>
	<type>speed</type>
      </variable>
      <variable name="visible">
	<description>whether monster is visible (e.g. has teleported in)</description>
	<type>boolean</type>
	<note>this has nothing to do with whether monsters are cloaked (like invisible S'pht) or not</note>
	<note>only writable before the monster is activated</note>
      </variable>
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<type>WU</type>
      </variable>
    </table>
    <table name="monster_start">
      <variable name="blind" access="read-only" version="20111201">
	<description>whether monster is activated by sight</description>
	<type>boolean</type>
      </variable>
      <variable name="deaf" access="read-only" version="20111201">
	<description>whether monster is activated by sound</description>
	<type>boolean</type>
      </variable>
      <variable name="facing" access="read-only" version="20111201">
	<description>direction monster is initially facing</description>
	<type>angle</type>
      </variable>
      <variable name="from_ceiling" access="read-only" version="20111201">
	<description>whether monster location z is from ceiling</description>
	<type>boolean</type>
      </variable>
      <variable name="invisible" access="read-only" version="20111201">
	<description>whether monster will teleport in when activated</description>
	<type>boolean</type>
      </variable>
      <variable name="polygon" access="read-only" version="20111201">
	<description>monster starting location polygon</description>
	<type>polygon</type>
      </variable>
      <variable name="type" access="read-only" version="20111201">
	<description>type of monster</description>
	<type>monster_type</type>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>
    <table name="music" singleton="true">
      <function name="clear">
	<description>clears the level playlist</description>
      </function>
      <function name="fade">
	<description>fades out the currently playing track and clears the playlist</description>
	<argument name="duration"><type>seconds</type></argument>
      </function>
      <function name="play">
	<description>appends all of the specified tracks to the end of the playlist</description>
	<argument name="track1"><type>string</type></argument>
	<argument name="track2" required="false"><type>string</type></argument>
	<argument name="..." required="false"><type>string</type></argument>
      </function>
      <function name="stop">
	<description>stops level music and clears the playlist</description>
      </function>
      <function name="valid">
	<description>for every track passed, return true if it exists and is playable and false otherwise</description>
	<argument name="track1"><type>string</type></argument>
	<argument name="track2" required="false"><type>string</type></argument>
	<argument name="..." required="false"><type>string</type></argument>
      </function>
    </table>
    <table name="platform">
      <variable name="active">
	<description>whether platform is currently active</description>
	<type>boolean</type>
      </variable>
      <variable name="ceiling_height">
	<description>current ceiling height of platform</description>
	<type>WU</type>
      </variable>
      <variable name="contracting">
	<description>direction platform is moving or will move when active</description>
	<type>boolean</type>
      </variable>
      <variable name="door" version="20100118">
	<description>platform is a door</description>
	<type>boolean</type>
      </variable>
      <variable name="extending">
	<description>direction platform is moving or will move when active</description>
	<type>boolean</type>
      </variable>
      <variable name="floor_height">
	<description>current floor height of platform</description>
	<type>WU</type>
      </variable>
      <variable name="locked" version="20100118">
	<description>platform is locked</description>
	<type>boolean</type>
	<note>this flag doesn't actually do anything</note>
      </variable>
      <variable name="monster_controllable">
	<description>whether platform can be controlled by monsters</description>
	<type>boolean</type>
      </variable>
      <variable name="player_controllable">
	<description>whether platform can be controlled by players</description>
	<type>boolean</type>
      </variable>
      <variable name="polygon" access="read-only">
	<description>polygon of this platform</description>
	<type>polygon</type>
      </variable>
      <variable name="secret" version="20100118">
	<description>platform is secret</description>
	<type>boolean</type>
	<note>secret platforms aren't shown on the overhead map</note>
      </variable>
      <variable name="speed">
	<description>platform speed</description>
	<type>speed</type>
      </variable>
      <variable name="type" version="20100118">
	<description>type of this platform</description>
	<type>platform_type</type>
	<note>the only thing the engine uses type for is the platform's sound</note>
      </variable>
    </table>
    <table name="player">
      <function name="accelerate">
	<description>accelerates player</description>
	<argument name="direction"><type>angle</type></argument>
	<argument name="velocity"><type>speed</type></argument>
	<argument name="vertical_velocity"><type>speed</type></argument>
      </function>
      <subtable name="action_flags" classname="lua_action_flags">
	<note>only valid when read/written in idle()</note>
	<note>disabled when the player is viewing a terminal</note>
	<note>latched action flags are only true the first tick the key is held down</note>
	<variable name="action_trigger">
	  <description>respawns, or activates platforms/doors/control panels</description>
	  <type>boolean</type>
	  <note>latched</note>
	</variable>
	<variable name="cycle_weapons_forward">
	  <description>switches to next weapon</description>
	  <type>boolean</type>
	  <note>latched</note>
	</variable>
	<variable name="cycle_weapons_backward">
	  <description>switches to previous weapon</description>
	  <type>boolean</type>
	  <note>latched</note>
	</variable>
	<variable name="left_trigger">
	  <description>fires primary trigger</description>
	  <type>boolean</type>
	</variable>
	<variable name="microphone_button">
	  <description>activates the net mic</description>
	  <type>boolean</type>
	  <note>can not be set to true; can be set to false</note>
	</variable>
	<variable name="right_trigger">
	  <description>fires secondary trigger</description>
	  <type>boolean</type>
	</variable>
	<variable name="toggle_map">
	  <description>toggles the overhead map</description>
	  <type>boolean</type>
	  <note>latched</note>
	</variable>
      </subtable>
      <function name="activate_terminal">
	<description>activates terminal</description>
	<argument name="terminal"><type>terminal</type></argument>
      </function>
      <variable name="color">
	<description>color of player (shirt color, if teams are enabled)</description>
	<type>number</type>
      </variable>
      <subtable name="compass" classname="player_compass">
	<function name="all_off">
	  <description>turns all compass quadrants off, disables beacon</description>
	</function>
	<function name="all_on">
	  <description>turns all compass quadrants on, disables beacon</description>
	</function>
	<variable name="beacon">
	  <description>whether to use the beacon</description>
	  <type>boolean</type>
	</variable>
	<variable name="lua">
	  <description>whether Lua is controlling the compass</description>
	  <type>boolean</type>
	</variable>
	<variable name="ne">
	  <alias>northeast</alias>
	  <description>whether north east compass quadrant is active</description>
	  <type>boolean</type>
	</variable>
	<variable name="nw">
	  <alias>northwest</alias>
	  <description>whether north west compass quadrant is active</description>
	  <type>boolean</type>
	</variable>
	<variable name="se">
	  <alias>southeast</alias>
	  <description>whether south east compass quadrant is active</description>
	  <type>boolean</type>
	</variable>
	<variable name="sw">
	  <alias>southwest</alias>
	  <description>whether south west compass quadrant is active</description>
	  <type>boolean</type>
	</variable>
	<variable name="x">
	  <description>beacon location</description>
	  <type>WU</type>
	</variable>
	<variable name="y">
	  <description>beacon location</description>
	  <type>WU</type>
	</variable>
      </subtable>
      <subtable name="crosshairs" classname="crosshairs">
	<variable name="active" access="local-player">
	  <description>whether crosshairs are visible</description>
	  <type>boolean</type>
	  <note>if you wish to stop the user from toggling the crosshairs, you must set the state every tick</note>
	</variable>
      </subtable>
      <function name="damage">
	<description>inflicts damage on player</description>
	<argument name="amount"><type>number</type></argument>
	<argument name="type" required="false">
	  <description>if unspecified, crush damage is delt</description>
	  <type>damage_type</type></argument>
      </function>
      <variable name="dead" access="read-only">
	<description>whether player is dead</description>
	<type>boolean</type>
      </variable>
      <variable name="deaths">
	<description>deaths not caused by players</description>
	<type>number</type>
      </variable>
      <variable name="direction">
	<alias>yaw</alias>
	<description>direction player is facing</description>
	<type>angle</type>
      </variable>
      <variable name="disconnected">
	<description>whether player dropped out of the game</description>
	<type>boolean</type>
      </variable>
      <variable name="energy">
	<alias>life</alias>
	<description>amount of suit energy player has (150 is normal red health)</description>
	<type>number</type>
      </variable>
      <variable name="elevation">
	<alias>pitch</alias>
	<description>angle player is looking up or down</description>
	<type>angle</type>
      </variable>
      <subtable name="external_velocity" classname="external_velocity">
	<variable name="i">
	  <alias>x</alias>
	  <type>speed</type>
	</variable>
	<variable name="j">
	  <alias>y</alias>
	  <type>speed</type>
	</variable>
	<variable name="k">
	  <alias>z</alias>
	  <type>speed</type>
	</variable>
      </subtable>
      <variable name="extravision_duration">
	<description>extravision time remaining</description>
	<type>time</type>
      </variable>
      <variable name="feet_below_media" access="read-only">
	<description>whether player is standing in liquid</description>
	<type>boolean</type>
      </variable>
      <function name="fade_screen" access="local-player">
	<description>fades player's screen</description>
	<argument name="type"><type>fade_type</type></argument>
      </function>
      <function name="find_action_key_target" return="variant">
	<description>if player is in range of a platform or control panel, returns a platform or side; otherwise returns nil</description>
	<return><type>variant</type></return>
	<note>you can check the type of the return with is_polygon() and is_side()</note>
      </function>
      <function name="find_target" return="variant">
	<description>returns t, x, y, z, polygon, where t is the side, polygon_floor, polygon_ceiling, monster, scenery, or polygon (if the target is the surface of a liquid) the player is looking at; and x, y, z, and polygon are the point the player is looking at</description>
	<return><type>variant</type></return>
	<return><type>WU</type></return>
	<return><type>WU</type></return>
	<return><type>WU</type></return>
	<return><type>polygon</type></return>
	<note>you can check the type of t with is_side(), is_polygon_floor(), is_polygon_ceiling(), is_monster(), is_scenery(), and is_polygon()</note>
      </function>
      <variable name="head_below_media" access="read-only">
	<description>whether player is completely below liquid</description>
	<type>boolean</type>
      </variable>
      <variable name="infravision_duration">
	<description>infravision time remaining</description>
	<type>time</type>
      </variable>
      <subtable name="internal_velocity" classname="internal_velocity">
	<variable name="forward" access="read-only">
	  <description>player's forward velocity</description>
	  <type>number</type>
	</variable>
	<variable name="perpendicular" access="read-only">
	  <description>player's perpendicular (sidestep) velocity</description>
	  <type>number</type>
	</variable>
      </subtable>
      <variable name="invincibility_duration">
	<description>invincibility time remaining</description>
	<type>time</type>
      </variable>
      <variable name="invisibility_duration">
	<description>invisibility time remaining</description>
	<type>time</type>
	<note>player will become subtly invisible if this is set higher than the standard invisibility duration (70 seconds)</note>
      </variable>
      <function-variable name="items">
	<description>how many of item the player is carrying</description>
	<argument name="item_type"><type>item_type</type></argument>
	<type>number</type>
      </function-variable>
      <variable name="local_" access="read-only">
	<description>true if this player is the local player</description>
	<type>boolean</type>
	<note>normally, you shouldn't need this--you'll just make the game go out of sync</note>
      </variable>
      <function-variable name="kills">
	<description>kill count against slain_player</description>
	<argument name="slain_player"><type>player</type></argument>
	<type>number</type>
      </function-variable>
      <variable name="monster" access="read-only">
	<description>monster that corresponds to player</description>
	<type>monster</type>
      </variable>
      <variable name="motion_sensor_active" access="local-player">
	<description>whether player can view his motion sensor</description>
	<type>boolean</type>
	<note>currently, this also controls compass visibility</note>
      </variable>
      <variable name="name" access="read-only">
	<description>player's name</description>
	<type>string</type>
      </variable>
      <variable name="oxygen">
	<description>amount of oxygen player has (max is 10800)</description>
	<type>number</type>
      </variable>
      <subtable-accessor name="overlays" classname="overlays" index="n">
	<description>there are 6 overlays, numbered 0 through 5</description>
	<function name="clear" access="local-player">
	  <description>turns off overlay</description>
	</function>
	<variable name="color" access="write-only">
	  <description>text color</description>
	  <type>number</type>
	</variable>
	<function name="fill_icon" access="local-player">
	  <description>fills icon with solid color</description>
	  <argument name="color"><type>number</type></argument>
	</function>
	<variable name="icon" access="write-only">
	  <description>icon</description>
	  <type>icon</type>
	</variable>
	<variable name="text" access="write-only">
	  <description>text</description>
	  <type>string</type>
	</variable>
      </subtable-accessor>
      <function name="play_sound" access="local-player">
	<description>plays sound that only player can hear</description>
	<argument name="sound"><type>sound</type></argument>
	<argument name="pitch"><type>scale</type></argument>
	<note>if you want all players to hear the sound as if it is coming from this player, use .monster:play_sound() instead</note>
      </function>
      <variable name="points">
	<description>how many points player has</description>
	<type>number</type>
      </variable>
      <variable name="polygon" access="read-only">
	<description>polygon the player is standing on</description>
	<type>polygon</type>
	<note>if this gives you trouble, try .monster.polygon</note>
      </variable>
      <function name="position">
	<description>set player position</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <function name="print">
	<description>prints message to player's screen</description>
	<argument name="message"><type>string</type></argument>
      </function>
      <variable name="team">
	<description>player's team (pants color)</description>
	<type>number</type>
      </variable>
      <function name="teleport">
	<description>teleports player to polygon</description>
	<argument name="polygon"><type>WU</type></argument>
      </function>
      <function name="teleport_to_level">
	<description>teleports player to level (of course, all the other players will also go to that level)</description>
	<argument name="level"><type>number</type></argument>
      </function>
      <subtable name="texture_palette">
	<description>displays a texture palette instead of the classic HUD</description>
	<variable name="highlight" access="local-player">
	  <description>number of slot to highlight</description>
	  <note>can be nil</note>
	</variable>
	<variable name="size" access="local-player">
	  <description>how many slots the palette has</description>
	  <type>number</type>
	  <note>there is a maximum of 256 slots</note>
	  <note>the texture palette is visible whenever the size is greater than 0</note>
	  <note>rows/columns may change in the future based on the user's screen layout prefs</note>
	</variable>
	<subtable-accessor name="slots" classname="texture_palette_slots" index="n">
	  <variable name="texture_index" access="local-player">
	    <description>texture index of this slot</description>
	    <type>number</type>
	  </variable>
	  <variable name="collection" access="local-player">
	    <description>collection of this slot</description>
	    <type>collection</type>
	  </variable>
    <variable name="type" access="local-player" version="20090909">
      <description>texture type of this slot such as wall or sprite; see "Texture Types"</description>
      <type>texture_type</type>
    </variable>
	  <function name="clear">
	    <description>makes this slot empty</description>
	  </function>
	</subtable-accessor>
      </subtable>
      <function name="view_player" version="20080707">
	<description>switch to another player's view</description>
	<argument name="player"><type>player</type></argument>
      </function>
      <variable name="viewed_player" access="local-player read-only" version="Git">
        <description>the player currently being viewed by the local player</description>
        <type>player</type>
      </variable>
      <subtable name="weapons">
	<variable name="current" access="read-only">
	  <description>weapon the player is currently wielding</description>
	  <type>player_weapon</type>
	  <note>can be nil</note>
	</variable>
	<variable name="desired" access="read-only" version="20090909">
	  <description>weapon the player wants to switch to</description>
	  <type>player_weapon</type>
	  <note>can be nil</note>
	</variable>
	<variable name="active" version="20080707">
	  <description>when a player's weapons are not active, he does not see weapons in hand, and can not fire</description>
	  <type>boolean</type>
	</variable>
      </subtable>
      <subtable-accessor name="weapons" classname="player_weapon" index="weapon_type">
	<subtable name="primary" classname="player_weapon_trigger">
	  <alias>secondary</alias>
	  <variable name="rounds" access="read-only">
	    <description>how many rounds are currently loaded into the weapon</description>
	    <type>number</type>
	  </variable>
	</subtable>
	<function name="select">
	  <description>attempts to force player to ready weapon</description>
	</function>
      </subtable-accessor>
      <variable name="weapons.current" access="read-only">
	<description>weapon the player is currently wielding</description>
	<type>player_weapon</type>
	<note>can be nil</note>
      </variable>
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="zoom_active" access="local-player">
	<description>whether player's sniper zoom is active</description>
	<type>boolean</type>
      </variable>
    </table>
    <table name="player_start">
      <variable name="facing" access="read-only" version="20111201">
	<description>player starting location facing</description>
	<type>angle</type>
      </variable>
      <variable name="from_ceiling" access="read-only" version="20111201">
	<description>whether player starting location z is from ceiling</description>
	<type>boolean</type>
      </variable>
      <variable name="polygon" access="read-only" version="20111201">
	<description>polygon player starting location is in</description>
	<type>polygon</type>
      </variable>
      <variable name="team" access="read-only" version="20111201">
	<description>which team starts at this player starting location</description>
	<type>player_color</type>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>
    <table name="polygon">
      <subtable-accessor name="adjacent_polygons" classname="adjacent_polygons" index="n">
	<description>returns adjacent polygon n (across from line n), if one exists, or nil</description>
      </subtable-accessor>
      <function name="adjacent_polygons">
	<description>iterates through all polygons directly adjacent to this polygon</description>
      </function>
      <variable name="area" access="read-only">
	<description>the area of this polygon</description>
	<type>square WU</type>
      </variable>
      <subtable name="ceiling" classname="polygon_ceiling">
	<alias>floor</alias>
	<variable name="collection">
	  <description>texture collection</description>
	  <type>collection</type>
	</variable>
	<variable name="height">
	  <alias>z</alias>
	  <description>height</description>
	  <type>WU</type>
	</variable>
	<variable name="light">
	  <description>texture light</description>
	  <type>light</type>
	</variable>
	<variable name="texture_index">
	  <description>texture bitmap index</description>
	  <type>number</type>
	</variable>
	<variable name="texture_x">
	  <description>texture x offset</description>
	  <type>WU</type>
	</variable>
	<variable name="texture_y">
	  <description>texture y offset</description>
	  <type>WU</type>
	</variable>
	<variable name="transfer_mode">
	  <description>texture transfer mode</description>
	  <type>transfer_mode</type>
	</variable>
      </subtable>
      <function name="contains">
	<description>whether the point is in this polygon</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z" required="false"><type>WU</type></argument>
      </function>
      <subtable-accessor name="endpoints" classname="polygon_endpoints" index="n">
	<description>returns endpoint n</description>
      </subtable-accessor>
      <function name="endpoints">
	<description>iterates through all of this polygon's endpoints</description>
      </function>
      <function name="find_line_crossed_leaving" version="20080707">
	<description>returns the polygon line crossed by line segment (x1, y1) (x2, y2)</description>
	<argument name="x1"><type>WU</type></argument>
	<argument name="y1"><type>WU</type></argument>
	<argument name="x2"><type>WU</type></argument>
	<argument name="y2"><type>WU</type></argument>
	<note>can be nil if the line segment doesn't intersect a polygon line</note>
      </function>
      <subtable-accessor name="lines" classname="polygon_lines" index="n">
	<description>returns polygon line n</description>
      </subtable-accessor>
      <function name="lines">
	<description>iterates through all of this polygon's lines</description>
      </function>
      <variable name="media">
	<description>polygon media (liquid)</description>
	<type>media</type>
      </variable>
      <function name="monsters">
	<description>iterates through all monsters in this polygon (including player monsters)</description>
      </function>
      <variable name="permutation">
	<description>raw permutation index of this polygon</description>
	<type>number</type>
      </variable>
      <function name="play_sound">
	<description>plays sound in center of polygon on floor</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <function name="play_sound">
	<description>plays sound at location</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="sound"><type>sound</type></argument>
	<argument name="pitch" required="false"><type>number</type></argument>
	<note>if you want to play a sound at an object location, use that object's play_sound function instead</note>
      </function>
      <subtable-accessor name="sides" classname="polygon_sides" index="n">
	<description>returns polygon side n if it exists</description>
      </subtable-accessor>
      <function name="sides">
	<description>iterates through all of this polygon's sides</description>
      </function>
      <variable name="type">
	<description>polygon type</description>
	<type>polygon_type</type>
      </variable>
      <variable name="visible_on_automap" version="20150619">
	<description>whether polygon is revealed on local player's automap</description>
	<type>boolean</type>
      </variable>
      <variable name="x" access="read-only">
	<description>center of polygon</description>
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<description>center of polygon</description>
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<description>shortcut for .floor.height</description>
	<type>WU</type>
      </variable>
    </table>
    <table name="projectile">
      <function name="delete" version="20111201">
	<description>removes projectile from the map</description>
      </function>
      <variable name="damage_scale">
	<description>amount to scale projectile's normal damage by upon detonating</description>
	<type>scale</type>
      </variable>
      <variable name="dz">
	<description>instantaneous downward velocity</description>
	<type>speed</type>
      </variable>
      <variable name="elevation">
	<alias>pitch</alias>
	<description>vertical angle</description>
	<type>angle</type>
      </variable>
      <variable name="facing">
	<alias>yaw</alias>
	<description>direction</description>
	<type>angle</type>
      </variable>
      <function name="play_sound">
	<description>plays sound coming from this projectile</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <function name="position">
	<description>sets projectile position</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <variable name="owner">
	<description>monster that fired projectile, or nil</description>
	<type>monster</type>
      </variable>
      <variable name="polygon" access="read-only">
	<description>polygon the projectile is in</description>
	<type>polygon</type>
      </variable>
      <variable name="target">
	<description>target of guided projectile, or nil</description>
	<type>monster</type>
      </variable>
      <variable name="type" access="read-only">
	<description>type of projectile</description>
	<type>projectile_type</type>
      </variable>
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<type>WU</type>
      </variable>
    </table>
    <table name="scenery">
      <function name="damage">
	<description>damages scenery</description>
      </function>
      <variable name="damaged" access="read-only">
	<description>whether this scenery has been damaged</description>
	<type>boolean</type>
      </variable>
      <function name="delete">
	<description>removes scenery from the map</description>
      </function>
      <variable name="facing">
	<description>direction scenery is facing</description>
	<type>angle</type>
      </variable>
      <function name="play_sound">
	<description>play sound coming from this scenery</description>
	<argument name="sound"><type>sound</type></argument>
      </function>
      <variable name="polygon" access="read-only">
	<description>polygon the scenery is in</description>
	<type>polygon</type>
      </variable>
      <function name="position" version="20090909">
	<description>sets position of scenery</description>
	<argument name="x">
	  <type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
      </function>
      <variable name="solid">
	<description>whether this scenery is solid</description>
	<type>boolean</type>
      </variable>
      <variable name="type" access="read-only">
	<description>type of scenery</description>
	<type>scenery_type</type>
      </variable>
      <variable name="x" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only">
	<type>WU</type>
      </variable>
    </table>
    <table name="side">
      <subtable name="control_panel" classname="side_control_panel">
	<variable name="can_be_destroyed" version="20080707">
	  <description>whether projectiles destroy this switch</description>
	  <type>boolean</type>
	</variable>
	<variable name="light_dependent" version="20080707">
	  <description>switch can only be activated if light > 75%</description>
	  <type>boolean</type>
	</variable>
	<variable name="only_toggled_by_weapons" version="20080707">
	  <description>switch can only be toggled by weapons</description>
	  <type>boolean</type>
	</variable>
	<variable name="repair" version="20080707">
	  <description>switch is a repair switch</description>
	  <type>boolean</type>
	</variable>
	<variable name="status" version="20080707">
	  <description>switch is active</description>
	  <type>boolean</type>
	</variable>
	<variable name="type" version="20080707">
	  <description>type of control panel</description>
	  <type>control_panel_type</type>
	</variable>
	<variable name="permutation">
	  <description>permutation of control panel</description>
	  <type>number</type>
	</variable>
	<variable name="uses_item" access="read-only" version="20111201">
	  <description>i.e. chip insertion</description>
	  <type>boolean</type>
	</variable>
	<note>nil if the side is not a control panel</note>
	<note version="20080707">set to true or false to create/destroy a control panel</note>
      </subtable>
      <subtable name="primary" classname="primary_side">
	<alias>secondary</alias>
	<alias>transparent</alias>
	<variable name="collection">
	  <description>texture collection</description>
	  <type>collection</type>
	</variable>
	<variable name="empty">
	  <description>whether transparent side is empty</description>
	  <type>boolean</type>
	  <note>transparent side only</note>
	  <note>setting empty to false is a no-op; set collection and texture_index instead</note>
	</variable>
	<variable name="light">
	  <description>texture light</description>
	  <type>light</type>
	</variable>
	<variable name="texture_index">
	  <description>texture bitmap index</description>
	  <type>number</type>
	</variable>
	<variable name="texture_x">
	  <description>texture x offset</description>
	  <type>WU</type>
	</variable>
	<variable name="texture_y">
	  <description>texture y offset</description>
	  <type>WU</type>
	</variable>
	<variable name="transfer_mode">
	  <description>texture transfer mode</description>
	  <type>transfer_mode</type>
	</variable>
      </subtable>
      <function name="play_sound">
	<description>play sound coming from this side</description>
	<argument name="sound"><type>sound</type></argument>
	<argument name="pitch" required="false"><type>number</type></argument>
      </function>
      <variable name="line" access="read-only">
	<description>line this side is attached to</description>
	<type>line</type>
      </variable>
      <variable name="polygon" access="read-only">
	<description>polygon this side is attached to</description>
	<type>polygon</type>
      </variable>
      <function name="recalculate_type" version="20081213">
	<description>correct the side type (Forge can generate incorrect side types)</description>
      </function>
      <variable name="type" access="read-only" version="20080707">
	<description>type of side</description>
      </variable>
    </table>
    <table name="sound_object">
      <variable name="from_ceiling" access="read-only" version="20111201">
	<description>whether sound object location z is from ceiling</description>
	<type>boolean</type>
      </variable>
      <variable name="light" access="read-only" version="20111201">
	<description>if sound object uses a light for volume, the light it uses</description>
	<type>light</type>
	<note>can be nil if sound object doesn't use light for volume</note>
      </variable>
      <variable name="on_platform" access="read-only" version="20111201">
	<description>whether sound object is a platform sound</description>
	<type>boolean</type>
      </variable>
      <variable name="polygon" access="read-only" version="20111201">
	<description>sound object polygon</description>
	<type>polygon</type>
      </variable>
      <variable name="type" access="read-only" version="20111201">
	<description>type of sound object</description>
	<type>ambient_sound</type>
      </variable>
      <variable name="volume" access="read-only" version="20111201">
	<description>volume of sound object from 0.0 to 1.0</description>
	<type>number</type>
	<note>can be nil if sound object uses light for volume</note>
      </variable>
      <variable name="x" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="y" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
      <variable name="z" access="read-only" version="20111201">
	<type>WU</type>
      </variable>
    </table>
    <table name="tag">
      <variable name="active">
	<description>tag is active</description>
	<type>boolean</type>
      </variable>
    </table>
    <table name="terminal">
    </table>
    <accessor name="Annotations" contains="annotation">
      <length>
	<description>number of map annotations</description>
      </length>
      <index />
      <call>
	<description>iterates through all annotations</description>
      </call>
      <function name="new">
	<description>returns a new annotation</description>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="text"><type>string</type></argument>
	<argument name="x" required="false"><type>WU</type></argument>
	<argument name="y" required="false"><type>WU</type></argument>
      </function>
    </accessor>
    <accessor name="Cameras" contains="camera">
      <length>
	<description>number of cameras</description>
      </length>
      <index/>
      <call>
	<description>iterates through all cameras</description>
      </call>
      <function name="new">
	<description>returns a new uninitialized camera</description>
	<note>make sure to add path points and angles before activating the camera</note>
      </function>
    </accessor>
    <accessor name="Effects" contains="effect">
      <length>
	<description>maximum number of effects</description>
      </length>
      <index/>
      <call>
	<description>iterates through all valid effects</description>
      </call>
      <function name="new" version="20111201">
	<description>returns a new effect</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="height"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="type"><type>effect_type</type></argument>
	<return><type>effect</type></return>
      </function>
    </accessor>
    <accessor name="Endpoints" contains="endpoint">
      <length>
	<description>number of endpoints in level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all endpoints in the level</description>
      </call>
    </accessor>
    <accessor name="Game" contains="game"/>
    <accessor name="Goals" contains="goal">
      <length>
	<description>number of saved map objects (of all types)</description>
      </length>
      <index/>
      <call>
	<description>iterates through all goals</description>
      </call>
    </accessor>
    <accessor name="Items" contains="item">
      <length>
	<description>maximum number of map objects</description>
      </length>
      <index/>
      <call>
	<description>iterates through all valid items</description>
      </call>
      <function name="new">
	<description>returns a new item</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="height"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="type"><type>item_type</type></argument>
	<return><type>item</type></return>
      </function>
    </accessor>
    <accessor name="ItemStarts" contains="item_start">
      <length>
	<description>number of map objects in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all item starting locations in the level</description>
      </call>
    </accessor>
    <accessor name="Level" contains="level">
    </accessor>
    <accessor name="Lines" contains="line">
      <length>
	<description>number of lines in level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all lines in the level</description>
      </call>
    </accessor>
    <accessor name="Lights" contains="light">
      <length>
	<description>number of lights in level</description>
      </length>
      <index />
      <call>
	<description>iterates through all lights in the level</description>
      </call>
      <function name="new">
	<description>returns a new light</description>
	<argument name="light_preset" required="false"><type>light_preset</type></argument>
      </function>
    </accessor>
    <accessor name="Media" contains="media">
      <length>
	<description>number of media (liquids) on the level</description>
      </length>
      <index />
      <call>
	<description>iterates through all media on the level</description>
      </call>
    </accessor>
    <accessor name="Monsters" contains="monster">
      <length>
	<description>maximum number of monsters</description>
      </length>
      <index/>
      <call>
	<description>iterates through all valid monsters (including player monsters)</description>
      </call>
      <function name="new">
	<description>returns a new monster</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="height"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="type"><type>monster_type</type></argument>
	<return><type>monster</type></return>
      </function>
    </accessor>
    <accessor name="MonsterStarts" contains="monster_start">
      <length>
	<description>number of map objects in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all monster starting locations in the level</description>
      </call>
    </accessor>
    <accessor name="Music" contains="music"/>
    <accessor name="Platforms" contains="platform">
      <length>
	<description>number of platforms on the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all platforms in the level</description>
      </call>
    </accessor>
    <accessor name="Players" contains="player">
      <length>
	<description>number of players in the game</description>
      </length>
      <index/>
      <call>
	<description>iterates through all players in the game</description>
      </call>
      <function name="print">
	<description>prints message to all players' screens</description>
	<argument name="message"><type>string</type></argument>
      </function>
      <variable name="local_player" version="Git" access="read-only">
	<description>the local player</description>
	<type>Player</type>
	<note>normally, you shouldn't need this--you'll just make the game go out of sync</note>
      </variable>
    </accessor>
    <accessor name="PlayerStarts" contains="player_start">
      <length>
	<description>number of map objects in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all player starting locations in the level</description>
      </call>
    </accessor>
    <accessor name="Polygons" contains="polygon">
      <length>
	<description>number of polygons in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all polygons in the level</description>
      </call>
    </accessor>
    <accessor name="Projectiles" contains="projectile">
      <length>
	<description>maximum number of projectiles</description>
      </length>
      <index/>
      <call>
	<description>iterates through all valid projectiles</description>
      </call>
      <function name="new">
	<description>returns a new projectile</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="z"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="type"><type>projectile_type</type></argument>
	<note>remember to set the projectile's elevation, facing and owner immediately after you've created it</note>
      </function>
    </accessor>
    <accessor name="Scenery" contains="scenery">
      <length>
	<description>maximum number of map objects</description>
      </length>
      <index/>
      <call>
	<description>iterates through all valid scenery</description>
      </call>
      <function name="new">
	<description>returns a new scenery</description>
	<argument name="x"><type>WU</type></argument>
	<argument name="y"><type>WU</type></argument>
	<argument name="height"><type>WU</type></argument>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="type"><type>scenery_type</type></argument>
	<return><type>scenery</type></return>
      </function>
    </accessor>
    <accessor name="Sides" contains="side">
      <length>
	<description>number of sides on the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all sides on the level</description>
      </call>
      <function name="new" version="20080707">
	<description>creates a new side</description>
	<argument name="polygon"><type>polygon</type></argument>
	<argument name="line"><type>line</type></argument>
	<return><type>side</type></return>
	<note>side must not already exist</note>
      </function>
    </accessor>
    <accessor name="SoundObjects" contains="sound_object">
      <length>
	<description>number of map objects in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all sound objects in the level</description>
      </call>
    </accessor>
    <accessor name="Tags" contains="tag">
      <index/>
    </accessor>
    <accessor name="Terminals" contains="terminal">
      <length>
	<description>number of terminal texts in the level</description>
      </length>
      <index/>
      <call>
	<description>iterates through all terminal texts on the level</description>
      </call>
    </accessor>
    <enum name="ambient_sound">
      <mnemonics>
	<mnemonic name="water"/>
	<mnemonic name="sewage"/>
	<mnemonic name="lava"/>
	<mnemonic name="goo"/>
	<mnemonic name="underwater"/>
	<mnemonic name="wind"/>
	<mnemonic name="waterfall"/>
	<mnemonic name="siren"/>
	<mnemonic name="fan"/>
	<mnemonic name="spht door"/>
	<mnemonic name="spht platform"/>
	<mnemonic name="heavy spht door"/>
	<mnemonic name="heavy spht platform"/>
	<mnemonic name="light machinery"/>
	<mnemonic name="heavy machinery"/>
	<mnemonic name="transformer"/>
	<mnemonic name="sparking transformer"/>
	<mnemonic name="machine binder"/>
	<mnemonic name="machine bookpress"/>
	<mnemonic name="machine puncher"/>
	<mnemonic name="electric hum"/>
	<mnemonic name="alarm"/>
	<mnemonic name="night wind"/>
	<mnemonic name="pfhor door"/>
	<mnemonic name="pfhor platform"/>
	<mnemonic name="alien noise 1"/>
	<mnemonic name="alien noise 2"/>
	<mnemonic name="alien harmonics"/>
      </mnemonics>
    </enum>
    <enum name="completion_state">
      <mnemonics>
	<mnemonic name="unfinished"/>
	<mnemonic name="finished"/>
	<mnemonic name="failed"/>
      </mnemonics>
    </enum>
    <enum name="collection">
      <variable name="bitmap_count">
	<description>number of bitmaps in collection</description>
      </variable>
      <mnemonics>
	<mnemonic name="interface"/>
	<mnemonic name="weapons in hand"/>
	<mnemonic name="juggernaut"/>
	<mnemonic name="tick"/>
	<mnemonic name="explosions"/>
	<mnemonic name="hunter"/>
	<mnemonic name="player"/>
	<mnemonic name="items"/>
	<mnemonic name="trooper"/>
	<mnemonic name="fighter"/>
	<mnemonic name="defender"/>
	<mnemonic name="yeti"/>
	<mnemonic name="bob"/>
	<mnemonic name="vacbob"/>
	<mnemonic name="enforcer"/>
	<mnemonic name="drone"/>
	<mnemonic name="compiler"/>
	<mnemonic name="water"/>
	<mnemonic name="lava"/>
	<mnemonic name="sewage"/>
	<mnemonic name="jjaro"/>
	<mnemonic name="pfhor"/>
	<mnemonic name="water scenery"/>
	<mnemonic name="lava scenery"/>
	<mnemonic name="sewage scenery"/>
	<mnemonic name="jjaro scenery"/>
	<mnemonic name="pfhor scenery"/>
	<mnemonic name="day"/>
	<mnemonic name="night"/>
	<mnemonic name="moon"/>
	<mnemonic name="space"/>
	<mnemonic name="cyborg"/>
      </mnemonics>
    </enum>
    <enum name="control_panel_class">
      <mnemonics>
	<mnemonic name="oxygen recharger"/>
	<mnemonic name="single shield recharger"/>
	<mnemonic name="double shield recharger"/>
	<mnemonic name="triple shield recharger"/>
	<mnemonic name="light switch"/>
	<mnemonic name="platform switch"/>
	<mnemonic name="tag switch"/>
	<mnemonic name="pattern buffer"/>
	<mnemonic name="terminal"/>
      </mnemonics>
    </enum>
    <enum name="control_panel_type">
      <variable name="active_texture_index" access="read-only" version="20080707">
	<description>bitmap index when control panel is active</description>
	<type>number</type>
      </variable>
      <variable name="class" access="read-only">
	<description>class of this control panel type</description>
	<type>control_panel_class</type>
      </variable>
      <variable name="collection" access="read-only" version="20080707">
	<description>collection this control panel belongs to</description>
	<type>collection</type>
      </variable>
      <variable name="inactive_texture_index" access="read-only" version="20080707">
	<description>bitmap index when control panel is inactive/destroyed</description>
	<type>number</type>
      </variable>
    </enum>
    <enum name="damage_type">
      <mnemonics>
	<mnemonic name="explosion"/>
	<mnemonic name="staff"/>
	<mnemonic name="projectile"/>
	<mnemonic name="absorbed"/>
	<mnemonic name="flame"/>
	<mnemonic name="claws"/>
	<mnemonic name="alien weapon"/>
	<mnemonic name="hulk slap"/>
	<mnemonic name="compiler"/>
	<mnemonic name="fusion"/>
	<mnemonic name="hunter"/>
	<mnemonic name="fists"/>
	<mnemonic name="teleporter"/>
	<mnemonic name="defender"/>
	<mnemonic name="yeti claws"/>
	<mnemonic name="yeti projectile"/>
	<mnemonic name="crushing"/>
	<mnemonic name="lava"/>
	<mnemonic name="suffocation"/>
	<mnemonic name="goo"/>
	<mnemonic name="energy drain"/>
	<mnemonic name="oxygen drain"/>
	<mnemonic name="drone"/>
	<mnemonic name="shotgun"/>
      </mnemonics>
    </enum>
    <enum name="difficulty_type">
      <mnemonics>
	<mnemonic name="kindergarten"/>
	<mnemonic name="easy"/>
	<mnemonic name="normal"/>
	<mnemonic name="major damage"/>
	<mnemonic name="total carnage"/>
      </mnemonics>
    </enum>
    <enum name="scoring_mode">
      <mnemonics>
	<mnemonic name="most points"/>
	<mnemonic name="most time"/>
	<mnemonic name="least points"/>
	<mnemonic name="least time"/>
      </mnemonics>
    </enum>
    <enum name="effect_type">
      <mnemonics>
	<mnemonic name="rocket explosion"/>
	<mnemonic name="rocket contrail"/>
	<mnemonic name="grenade explosion"/>
	<mnemonic name="grenade contrail"/>
	<mnemonic name="bullet ricochet"/>
	<mnemonic name="alien weapon ricochet"/>
	<mnemonic name="flamethrower burst"/>
	<mnemonic name="fighter blood splash"/>
	<mnemonic name="player blood splash"/>
	<mnemonic name="civilian blood splash"/>
	<mnemonic name="assimilated civilian blood splash"/>
	<mnemonic name="enforcer blood splash"/>
	<mnemonic name="compiler bolt minor detonation"/>
	<mnemonic name="compiler bolt major detonation"/>
	<mnemonic name="compiler bolt major contrail"/>
	<mnemonic name="fighter projectile detonation"/>
	<mnemonic name="fighter melee detonation"/>
	<mnemonic name="hunter projectile detonation"/>
	<mnemonic name="hunter spark"/>
	<mnemonic name="minor fusion detonation"/>
	<mnemonic name="major fusion detonation"/>
	<mnemonic name="major fusion contrail"/>
	<mnemonic name="fist detonation"/>
	<mnemonic name="minor defender detonation"/>
	<mnemonic name="major defender detonation"/>
	<mnemonic name="defender spark"/>
	<mnemonic name="trooper blood splash"/>
	<mnemonic name="water lamp breaking"/>
	<mnemonic name="lava lamp breaking"/>
	<mnemonic name="sewage lamp breaking"/>
	<mnemonic name="alien lamp breaking"/>
	<mnemonic name="metallic clang"/>
	<mnemonic name="teleport object in"/>
	<mnemonic name="teleport object out"/>
	<mnemonic name="small water splash"/>
	<mnemonic name="medium water splash"/>
	<mnemonic name="large water splash"/>
	<mnemonic name="large water emergence"/>
	<mnemonic name="small lava splash"/>
	<mnemonic name="medium lava splash"/>
	<mnemonic name="large lava splash"/>
	<mnemonic name="large lava emergence"/>
	<mnemonic name="small sewage splash"/>
	<mnemonic name="medium sewage splash"/>
	<mnemonic name="large sewage splash"/>
	<mnemonic name="large sewage emergence"/>
	<mnemonic name="small goo splash"/>
	<mnemonic name="medium goo splash"/>
	<mnemonic name="large goo splash"/>
	<mnemonic name="large goo emergence"/>
	<mnemonic name="minor hummer projectile detonation"/>
	<mnemonic name="major hummer projectile detonation"/>
	<mnemonic name="durandal hummer projectile detonation"/>
	<mnemonic name="hummer spark"/>
	<mnemonic name="cyborg projectile detonation"/>
	<mnemonic name="cyborg blood splash"/>
	<mnemonic name="minor fusion dispersal"/>
	<mnemonic name="major fusion dispersal"/>
	<mnemonic name="overloaded fusion dispersal"/>
	<mnemonic name="sewage yeti blood splash"/>
	<mnemonic name="sewage yeti projectile detonation"/>
	<mnemonic name="water yeti blood splash"/>
	<mnemonic name="lava yeti blood splash"/>
	<mnemonic name="lava yeti projectile detonation"/>
	<mnemonic name="yeti melee detonation"/>
	<mnemonic name="juggernaut spark"/>
	<mnemonic name="juggernaut missile contrail"/>
	<mnemonic name="small jjaro splash"/>
	<mnemonic name="medium jjaro splash"/>
	<mnemonic name="large jjaro splash"/>
	<mnemonic name="large jjaro emergence"/>
	<mnemonic name="civilian fusion blood splash"/>
	<mnemonic name="assimilated civilian fusion blood splash"/>
      </mnemonics>
    </enum>
    <enum name="fade_type">
      <mnemonics>
	<mnemonic name="start cinematic fade in"/>
	<mnemonic name="cinematic fade in"/>
	<mnemonic name="long cinematic fade in"/>
	<mnemonic name="cinematic fade out"/>
	<mnemonic name="end cinematic fade out"/>
	<mnemonic name="red"/>
	<mnemonic name="big red"/>
	<mnemonic name="bonus"/>
	<mnemonic name="bright"/>
	<mnemonic name="long bright"/>
	<mnemonic name="yellow"/>
	<mnemonic name="big yellow"/>
	<mnemonic name="purple"/>
	<mnemonic name="cyan"/>
	<mnemonic name="white"/>
	<mnemonic name="big white"/>
	<mnemonic name="orange"/>
	<mnemonic name="long orange"/>
	<mnemonic name="green"/>
	<mnemonic name="long green"/>
	<mnemonic name="static"/>
	<mnemonic name="negative"/>
	<mnemonic name="big negative"/>
	<mnemonic name="flicker negative"/>
	<mnemonic name="dodge purple"/>
	<mnemonic name="burn cyan"/>
	<mnemonic name="dodge yellow"/>
	<mnemonic name="burn green"/>
	<mnemonic name="tint green"/>
	<mnemonic name="tint blue"/>
	<mnemonic name="tint orange"/>
	<mnemonic name="tint gross"/>
	<mnemonic name="tint jjaro"/>
      </mnemonics>
    </enum>
    <enum name="game_type">
      <mnemonics>
	<mnemonic name="kill monsters"/>
	<mnemonic name="cooperative play"/>
	<mnemonic name="capture the flag"/>
	<mnemonic name="king of the hill"/>
	<mnemonic name="kill the man with the ball"/>
	<mnemonic name="defense"/>
	<mnemonic name="rugby"/>
	<mnemonic name="tag"/>
	<mnemonic name="netscript"/>
      </mnemonics>
    </enum>
    <enum name="item_type">
      <variable name="initial_count" version="20111201">
	<description>how many items of this type are placed in the level during initial placement</description>
	<type>number</type>
      </variable>
      <variable name="maximum_count" version="20111201">
	<description>maximum number of this type of item in the level and in player inventories</description>
	<type>number</type>
      </variable>
      <variable name="minimum_count" version="20111201">
	<description>minimum number of this type of item in the level and in player inventories</description>
	<type>number</type>
      </variable>
      <variable name="random_chance" version="20111201">
	<description>chance from 0 to 1.0 this item will appear in a respawn period</description>
	<type>chance</type>
      </variable>
      <variable name="random_location" version="20111201">
	<description>whether items of this type spawn in random locations</description>
	<type>boolean</type>
      </variable>
      <variable name="total_available" version="20111201">
	<description>total number of items of this type that can be spawned in this level</description>
	<type>number</type>
	<note>-1 means infinite items are available</note>
	<note>setting this to anything but -1 will only be effective if changed immediately when the script runs, before item placement is done</note>
      </variable>
      <mnemonics>
	<mnemonic name="knife"/>
	<mnemonic name="pistol"/>
	<mnemonic name="pistol ammo"/>
	<mnemonic name="fusion pistol"/>
	<mnemonic name="fusion pistol ammo"/>
	<mnemonic name="assault rifle"/>
	<mnemonic name="assault rifle ammo"/>
	<mnemonic name="assault rifle grenades"/>
	<mnemonic name="missile launcher"/>
	<mnemonic name="missile launcher ammo"/>
	<mnemonic name="invisibility"/>
	<mnemonic name="invincibility"/>
	<mnemonic name="infravision"/>
	<mnemonic name="alien weapon"/>
	<mnemonic name="alien weapon ammo"/>
	<mnemonic name="flamethrower"/>
	<mnemonic name="flamethrower ammo"/>
	<mnemonic name="extravision"/>
	<mnemonic name="oxygen"/>
	<mnemonic name="single health"/>
	<mnemonic name="double health"/>
	<mnemonic name="triple health"/>
	<mnemonic name="shotgun"/>
	<mnemonic name="shotgun ammo"/>
	<mnemonic name="key"/>
	<mnemonic name="uplink chip"/>
	<mnemonic name="light blue ball"/>
	<mnemonic name="ball"/>
	<mnemonic name="violet ball"/>
	<mnemonic name="yellow ball"/>
	<mnemonic name="brown ball"/>
	<mnemonic name="orange ball"/>
	<mnemonic name="blue ball"/>
	<mnemonic name="green ball"/>
	<mnemonic name="smg"/>
	<mnemonic name="smg ammo"/>
      </mnemonics>
    </enum>
    <enum name="light_function">
      <mnemonics>
	<mnemonic name="constant"/>
	<mnemonic name="linear"/>
	<mnemonic name="smooth"/>
	<mnemonic name="flicker"/>
      </mnemonics>
    </enum>
    <enum name="light_preset">
      <mnemonics>
	<mnemonic name="normal"/>
	<mnemonic name="strobe"/>
	<mnemonic name="media"/>
      </mnemonics>
    </enum>
    <enum name="light_state">
      <mnemonics>
	<mnemonic name="becoming active"/>
	<mnemonic name="primary active"/>
	<mnemonic name="secondary active"/>
	<mnemonic name="becoming inactive"/>
	<mnemonic name="primary inactive"/>
	<mnemonic name="secondary inactive"/>
      </mnemonics>
    </enum>
    <enum name="media_type">
      <mnemonics>
	<mnemonic name="water"/>
	<mnemonic name="lava"/>
	<mnemonic name="goo"/>
	<mnemonic name="sewage"/>
	<mnemonic name="jjaro"/>
      </mnemonics>
    </enum>
    <enum name="monster_action">
      <mnemonics>
	<mnemonic name="stationary"/>
	<mnemonic name="waiting to attack again"/>
	<mnemonic name="moving"/>
	<mnemonic name="attacking close"/>
	<mnemonic name="attacking far"/>
	<mnemonic name="being hit"/>
	<mnemonic name="dying hard"/>
	<mnemonic name="dying soft"/>
	<mnemonic name="dying flaming"/>
	<mnemonic name="teleporting"/>
	<mnemonic name="teleporting in"/>
	<mnemonic name="teleporting out"/>
      </mnemonics>
    </enum>
    <enum name="monster_class">
      <mnemonics>
	<mnemonic name="player"/>
	<mnemonic name="bob"/>
	<mnemonic name="madd"/>
	<mnemonic name="possessed drone"/>
	<mnemonic name="defender"/>
	<mnemonic name="fighter"/>
	<mnemonic name="trooper"/>
	<mnemonic name="hunter"/>
	<mnemonic name="enforcer"/>
	<mnemonic name="juggernaut"/>
	<mnemonic name="drone"/>
	<mnemonic name="compiler"/>
	<mnemonic name="cyborg"/>
	<mnemonic name="explodabob"/>
	<mnemonic name="tick"/>
	<mnemonic name="yeti"/>
      </mnemonics>
    </enum>
    <enum name="monster_mode">
      <mnemonics>
	<mnemonic name="locked"/>
	<mnemonic name="losing lock"/>
	<mnemonic name="lost lock"/>
	<mnemonic name="unlocked"/>
	<mnemonic name="running"/>
      </mnemonics>
    </enum>
    <enum name="monster_type">
      <variable name="attacks_immediately" version="20120128">
	<description>monster will try an attack immediately</description>
	<type>boolean</type>
      </variable>
      <variable name="cannot_be_dropped" version="20120128">
	<description>monster cannot be skipped during placement</description>
	<type>boolean</type>
      </variable>
      <variable name="class">
	<description>class of monster type</description>
	<type>monster_class</type>
      </variable>
      <function-variable name="enemies" classname="monster_type_enemies">
	<description>whether monster class is an enemy</description>
	<argument name="monster_class"><type>monster_class</type></argument>
	<type>boolean</type>
      </function-variable>
      <function-variable name="friends" classname="monster_type_friends">
	<description>whether monster class is a friend</description>
	<argument name="monster_class"><type>monster_class</type></argument>
	<type>boolean</type>
      </function-variable>
      <variable name="impact_effect" access="read-only">
	<description>type of effect generated when monster gets hit by a bleeding projectile</description>
	<type>effect_type</type>
      </variable>
      <function-variable name="immunities" classname="monster_type_immunities">
	<description>whether monster type is immune to damage type</description>
	<argument name="damage_type"><type>damage_type</type></argument>
	<type>boolean</type>
      </function-variable>
      <variable name="initial_count" version="20111201">
	<description>how many monsters of this type are placed in the level during initial placement</description>
	<type>number</type>
      </variable>
      <variable name="height" access="read-only">
	<description>height of monster</description>
	<type>WU</type>
      </variable>
      <variable name="item">
	<description>type of item the monster drops when it dies</description>
	<type>item_type</type>
      </variable>
      <variable name="major" version="20120128">
	<description>monster is major</description>
	<type>boolean</type>
      </variable>
      <variable name="maximum_count" version="20111201">
	<description>maximum number of this type of monster in the level</description>
	<type>number</type>
      </variable>
      <variable name="minimum_count" version="20111201">
	<description>minimum number of this type of monster in the level</description>
	<type>number</type>
      </variable>
      <variable name="minor" version="20120128">
	<description>monster is minor</description>
	<type>boolean</type>
      </variable>
      <variable name="melee_impact_effect" access="read-only">
	<description>type of effect generated when monster gets hit by a melee projectile</description>
	<type>effect_type</type>
      </variable>
      <variable name="radius" access="read-only">
	<description>radius of monster</description>
	<type>WU</type>
      </variable>
      <variable name="random_chance" version="20111201">
	<description>chance from 0 to 1.0 this monster will appear in a respawn period</description>
	<type>chance</type>
      </variable>
      <variable name="random_location" version="20111201">
	<description>whether monsters of this type spawn in random locations</description>
	<type>boolean</type>
      </variable>
      <variable name="total_available" version="20111201">
	<description>total number of monsters of this type that can be spawned in this level</description>
	<type>number</type>
	<note>-1 means infinite monsters are available</note>
	<note>setting this to anything but -1 will only be effective if changed immediately when the script runs, before monster placement is done</note>
      </variable>
      <function-variable name="weaknesses" classname="monster_type_weaknesses">
	<description>whether monster type has a weakness to damage type</description>
	<argument name="damage type"><type>damage_type</type></argument>
	<type>boolean</type>
      </function-variable>
      <variable name="waits_with_clear_shot" version="20120128">
	<description>monster will sit and fire if he has a clear shot</description>
	<type>boolean</type>
      </variable>
      <mnemonics>
	<mnemonic name="player"/>
	<mnemonic name="minor tick"/>
	<mnemonic name="major tick"/>
	<mnemonic name="kamikaze tick"/>
	<mnemonic name="minor compiler"/>
	<mnemonic name="major compiler"/>
	<mnemonic name="minor invisible compiler"/>
	<mnemonic name="major invisible compiler"/>
	<mnemonic name="minor fighter"/>
	<mnemonic name="major fighter"/>
	<mnemonic name="minor projectile fighter"/>
	<mnemonic name="major projectile fighter"/>
	<mnemonic name="green bob"/>
	<mnemonic name="blue bob"/>
	<mnemonic name="security bob"/>
	<mnemonic name="explodabob"/>
	<mnemonic name="minor drone"/>
	<mnemonic name="major drone"/>
	<mnemonic name="big minor drone"/>
	<mnemonic name="big major drone"/>
	<mnemonic name="possessed drone"/>
	<mnemonic name="minor cyborg"/>
	<mnemonic name="major cyborg"/>
	<mnemonic name="minor flame cyborg"/>
	<mnemonic name="major flame cyborg"/>
	<mnemonic name="minor enforcer"/>
	<mnemonic name="major enforcer"/>
	<mnemonic name="minor hunter"/>
	<mnemonic name="major hunter"/>
	<mnemonic name="minor trooper"/>
	<mnemonic name="major trooper"/>
	<mnemonic name="mother of all cyborgs"/>
	<mnemonic name="mother of all hunters"/>
	<mnemonic name="sewage yeti"/>
	<mnemonic name="water yeti"/>
	<mnemonic name="lava yeti"/>
	<mnemonic name="minor defender"/>
	<mnemonic name="major defender"/>
	<mnemonic name="minor juggernaut"/>
	<mnemonic name="major juggernaut"/>
	<mnemonic name="tiny pfhor"/>
	<mnemonic name="tiny bob"/>
	<mnemonic name="tiny yeti"/>
	<mnemonic name="green vacbob"/>
	<mnemonic name="blue vacbob"/>
	<mnemonic name="security vacbob"/>
	<mnemonic name="explodavacbob"/>
      </mnemonics>
    </enum>
    <enum name="overlay_color">
      <mnemonics>
	<mnemonic name="green"/>
	<mnemonic name="white"/>
	<mnemonic name="red"/>
	<mnemonic name="dark green"/>
	<mnemonic name="cyan"/>
	<mnemonic name="yellow"/>
	<mnemonic name="dark red"/>
	<mnemonic name="blue"/>
      </mnemonics>
    </enum>
    <enum name="platform_type">
      <mnemonics>
	<mnemonic name="spht door"/>
	<mnemonic name="spht split door"/>
	<mnemonic name="locked spht door"/>
	<mnemonic name="spht platform"/>
	<mnemonic name="noisy spht platform"/>
	<mnemonic name="heavy spht door"/>
	<mnemonic name="pfhor door"/>
	<mnemonic name="heavy spht platform"/>
	<mnemonic name="pfhor platform"/>
      </mnemonics>
    </enum>
    <enum name="player_color">
      <mnemonics>
	<mnemonic name="slate"/>
	<mnemonic name="red"/>
	<mnemonic name="violet"/>
	<mnemonic name="yellow"/>
	<mnemonic name="white"/>
	<mnemonic name="orange"/>
	<mnemonic name="blue"/>
	<mnemonic name="green"/>
      </mnemonics>
    </enum>
    <enum name="polygon_type">
      <mnemonics>
	<mnemonic name="normal"/>
	<mnemonic name="item impassable"/>
	<mnemonic name="monster impassable"/>
	<mnemonic name="hill"/>
	<mnemonic name="base"/>
	<mnemonic name="platform"/>
	<mnemonic name="light on trigger"/>
	<mnemonic name="platform on trigger"/>
	<mnemonic name="light off trigger"/>
	<mnemonic name="platform off trigger"/>
	<mnemonic name="teleporter"/>
	<mnemonic name="zone border"/>
	<mnemonic name="goal"/>
	<mnemonic name="visible monster trigger"/>
	<mnemonic name="invisible monster trigger"/>
	<mnemonic name="dual monster trigger"/>
	<mnemonic name="item trigger"/>
	<mnemonic name="must be explored"/>
	<mnemonic name="automatic exit"/>
	<mnemonic name="minor ouch"/>
	<mnemonic name="major ouch"/>
	<mnemonic name="glue"/>
	<mnemonic name="glue trigger"/>
	<mnemonic name="superglue"/>
      </mnemonics>
    </enum>
    <enum name="projectile_type">
      <mnemonics>
	<mnemonic name="missile"/>
	<mnemonic name="grenade"/>
	<mnemonic name="pistol bullet"/>
	<mnemonic name="rifle bullet"/>
	<mnemonic name="shotgun bullet"/>
	<mnemonic name="staff"/>
	<mnemonic name="staff bolt"/>
	<mnemonic name="flamethrower burst"/>
	<mnemonic name="compiler bolt minor"/>
	<mnemonic name="compiler bolt major"/>
	<mnemonic name="alien weapon"/>
	<mnemonic name="fusion bolt minor"/>
	<mnemonic name="fusion bolt major"/>
	<mnemonic name="hunter"/>
	<mnemonic name="fist"/>
	<mnemonic name="armageddon sphere"/>
	<mnemonic name="armageddon electricity"/>
	<mnemonic name="juggernaut rocket"/>
	<mnemonic name="trooper bullet"/>
	<mnemonic name="trooper grenade"/>
	<mnemonic name="minor defender"/>
	<mnemonic name="major defender"/>
	<mnemonic name="juggernaut missile"/>
	<mnemonic name="minor energy drain"/>
	<mnemonic name="major energy drain"/>
	<mnemonic name="oxygen drain"/>
	<mnemonic name="minor hummer"/>
	<mnemonic name="major hummer"/>
	<mnemonic name="durandal hummer"/>
	<mnemonic name="minor cyborg ball"/>
	<mnemonic name="major cyborg ball"/>
	<mnemonic name="ball"/>
	<mnemonic name="minor fusion dispersal"/>
	<mnemonic name="major fusion dispersal"/>
	<mnemonic name="overloaded fusion dispersal"/>
	<mnemonic name="yeti"/>
	<mnemonic name="sewage yeti"/>
	<mnemonic name="lava yeti"/>
	<mnemonic name="smg bullet"/>
      </mnemonics>
    </enum>
    <enum name="scenery_type">
      <mnemonics>
	<mnemonic name="light dirt"/>
	<mnemonic name="dark dirt"/>
	<mnemonic name="lava bones"/>
	<mnemonic name="lava bone"/>
	<mnemonic name="ribs"/>
	<mnemonic name="skull"/>
	<mnemonic name="hanging light 1"/>
	<mnemonic name="hanging light 2"/>
	<mnemonic name="small cylinder"/>
	<mnemonic name="large cylinder"/>
	<mnemonic name="block 1"/>
	<mnemonic name="block 2"/>
	<mnemonic name="block 3"/>

	<mnemonic name="pistol clip"/>
	<mnemonic name="water short light"/>
	<mnemonic name="water long light"/>
	<mnemonic name="siren"/>
	<mnemonic name="rocks"/>
	<mnemonic name="blood drops"/>
	<mnemonic name="water thing"/>
	<mnemonic name="gun"/>
	<mnemonic name="bob remains"/>
	<mnemonic name="puddles"/>
	<mnemonic name="big puddles"/>
	<mnemonic name="security monitor"/>
	<mnemonic name="water alien supply can"/>
	<mnemonic name="machine"/>
	<mnemonic name="staff"/>
	
	<mnemonic name="sewage short light"/>
	<mnemonic name="sewage long light"/>
	<mnemonic name="junk"/>
	<mnemonic name="antenna"/>
	<mnemonic name="big antenna"/>
	<mnemonic name="sewage alien supply can"/>
	<mnemonic name="sewage bones"/>
	<mnemonic name="sewage big bones"/>
	<mnemonic name="pfhor pieces"/>
	<mnemonic name="bob pieces"/>
	<mnemonic name="bob blood"/>
	
	<mnemonic name="alien short light"/>
	<mnemonic name="alien long light"/>
	<mnemonic name="alien ceiling rod light"/>
	<mnemonic name="bulbous yellow alien object"/>
	<mnemonic name="square gray organic object"/>
	<mnemonic name="pfhor skeleton"/>
	<mnemonic name="pfhor mask"/>
	<mnemonic name="green stuff"/>
	<mnemonic name="hunter shield"/>
	<mnemonic name="alien bones"/>
	<mnemonic name="alien sludge"/>

	<mnemonic name="jjaro short light"/>
	<mnemonic name="jjaro long light"/>
	<mnemonic name="weird rod"/>
	<mnemonic name="pfhor ship"/>
	<mnemonic name="sun"/>
	<mnemonic name="large glass container"/>
	<mnemonic name="nub 1"/>
	<mnemonic name="nub 2"/>
	<mnemonic name="lh'owon"/>
	<mnemonic name="floor whip antenna"/>
	<mnemonic name="ceiling whip antenna"/>
      </mnemonics>
    </enum>
    <enum name="side_type">
      <mnemonics>
	<mnemonic name="full"/>
	<mnemonic name="high"/>
	<mnemonic name="low"/>
	<mnemonic name="split"/>
      </mnemonics>
    </enum>
    <enum name="sound">
      <mnemonics>
	<mnemonic name="startup"/>
	<mnemonic name="teleport in"/>
	<mnemonic name="teleport out"/>
	<mnemonic name="crushed"/>
	<mnemonic name="nuclear hard death"/>
	<mnemonic name="absorbed"/>
	<mnemonic name="breathing"/>
	<mnemonic name="oxygen warning"/>
	<mnemonic name="suffocation"/>
	<mnemonic name="energy refuel"/>
	<mnemonic name="oxygen refuel"/>
	<mnemonic name="cant toggle switch"/>
	<mnemonic name="switch on"/>
	<mnemonic name="switch off"/>
	<mnemonic name="puzzle switch"/>
	<mnemonic name="chip insertion"/>
	<mnemonic name="pattern buffer"/>
	<mnemonic name="destroy control panel"/>
	<mnemonic name="adjust volume"/>
	<mnemonic name="got powerup"/>
	<mnemonic name="get item"/>
	<mnemonic name="bullet ricochet"/>
	<mnemonic name="metallic ricochet"/>
	<mnemonic name="empty gun"/>
	<mnemonic name="spht door opening"/>
	<mnemonic name="spht door closing"/>
	<mnemonic name="spht door obstructed"/>
	<mnemonic name="spht platform starting"/>
	<mnemonic name="spht platform stopping"/>
	<mnemonic name="loon"/>
	<mnemonic name="smg firing"/>
	<mnemonic name="smg reloading"/>
	<mnemonic name="heavy spht platform starting"/>
	<mnemonic name="heavy spht platform stopping"/>
	<mnemonic name="fist hitting"/>
	<mnemonic name="pistol firing"/>
	<mnemonic name="pistol reloading"/>
	<mnemonic name="assault rifle firing"/>
	<mnemonic name="grenade launcher firing"/>
	<mnemonic name="grenade expolding"/>
	<mnemonic name="grenade flyby"/>
	<mnemonic name="fusion firing"/>
	<mnemonic name="fusion exploding"/>
	<mnemonic name="fusion flyby"/>
	<mnemonic name="fusion charging"/>
	<mnemonic name="rocket exploding"/>
	<mnemonic name="rocket flyby"/>
	<mnemonic name="rocket firing"/>
	<mnemonic name="flamethrower"/>
	<mnemonic name="body falling"/>
	<mnemonic name="body exploding"/>
	<mnemonic name="bullet hit flesh"/>
	<mnemonic name="fighter activate"/>
	<mnemonic name="fighter wail"/>
	<mnemonic name="fighter scream"/>
	<mnemonic name="fighter chatter"/>
	<mnemonic name="fighter attack"/>
	<mnemonic name="fighter projectile hit"/>
	<mnemonic name="fighter projectile flyby"/>
	<mnemonic name="spht attack"/>
	<mnemonic name="spht death"/>
	<mnemonic name="spht hit"/>
	<mnemonic name="spht projectile flyby"/>
	<mnemonic name="spht projectile hit"/>
	<mnemonic name="cyborg moving"/>
	<mnemonic name="cyborg attack"/>
	<mnemonic name="cyborg hit"/>
	<mnemonic name="cyborg death"/>
	<mnemonic name="cyborg projectile bounce"/>
	<mnemonic name="cyborg projectile hit"/>
	<mnemonic name="cyborg projectile flyby"/>
	<mnemonic name="drone activate"/>
	<mnemonic name="drone start attack"/>
	<mnemonic name="drone attack"/>
	<mnemonic name="drone dying"/>
	<mnemonic name="drone death"/>
	<mnemonic name="drone projectile hit"/>
	<mnemonic name="drone projectile flyby"/>
	<mnemonic name="bob wail"/>
	<mnemonic name="bob scream"/>
	<mnemonic name="bob hit"/>
	<mnemonic name="bob chatter"/>
	<mnemonic name="assimilated bob chatter"/>
	<mnemonic name="bob trash talk"/>
	<mnemonic name="bob apology"/>
	<mnemonic name="bob activation"/>
	<mnemonic name="bob clear"/>
	<mnemonic name="bob angry"/>
	<mnemonic name="bob secure"/>
	<mnemonic name="bob kill the player"/>
	<mnemonic name="water"/>
	<mnemonic name="sewage"/>
	<mnemonic name="lava"/>
	<mnemonic name="goo"/>
	<mnemonic name="underwater"/>
	<mnemonic name="wind"/>
	<mnemonic name="waterfall"/>
	<mnemonic name="siren"/>
	<mnemonic name="fan"/>
	<mnemonic name="spht door"/>
	<mnemonic name="spht platform"/>
	<mnemonic name="alien harmonics"/>
	<mnemonic name="heavy spht platform"/>
	<mnemonic name="light machinery"/>
	<mnemonic name="heavy machinery"/>
	<mnemonic name="transformer"/>
	<mnemonic name="sparking transformer"/>
	<mnemonic name="water drip"/>
	<mnemonic name="walking in water"/>
	<mnemonic name="exiting water"/>
	<mnemonic name="entering water"/>
	<mnemonic name="small water splash"/>
	<mnemonic name="medium water splash"/>
	<mnemonic name="large water splash"/>
	<mnemonic name="walking in lava"/>
	<mnemonic name="entering lava"/>
	<mnemonic name="exiting lava"/>
	<mnemonic name="small lava splash"/>
	<mnemonic name="medium lava splash"/>
	<mnemonic name="large lava splash"/>
	<mnemonic name="walking in sewage"/>
	<mnemonic name="exiting sewage"/>
	<mnemonic name="entering sewage"/>
	<mnemonic name="small sewage splash"/>
	<mnemonic name="medium sewage splash"/>
	<mnemonic name="large sewage splash"/>
	<mnemonic name="walking in goo"/>
	<mnemonic name="exiting goo"/>
	<mnemonic name="entering goo"/>
	<mnemonic name="small goo splash"/>
	<mnemonic name="medium goo splash"/>
	<mnemonic name="large goo splash"/>
	<mnemonic name="major fusion firing"/>
	<mnemonic name="major fusion charged"/>
	<mnemonic name="assault rifle reloading"/>
	<mnemonic name="assault rifle shell casings"/>
	<mnemonic name="shotgun firing"/>
	<mnemonic name="shotgun reloading"/>
	<mnemonic name="ball bounce"/>
	<mnemonic name="you are it"/>
	<mnemonic name="got ball"/>
	<mnemonic name="computer login"/>
	<mnemonic name="computer logout"/>
	<mnemonic name="computer page"/>
	<mnemonic name="heavy spht door"/>
	<mnemonic name="heavy spht door opening"/>
	<mnemonic name="heavy spht door closing"/>
	<mnemonic name="heavy spht door open"/>
	<mnemonic name="heavy spht door closed"/>
	<mnemonic name="heavy spht door obstructed"/>
	<mnemonic name="hunter activate"/>
	<mnemonic name="hunter attack"/>
	<mnemonic name="hunter dying"/>
	<mnemonic name="hunter landing"/>
	<mnemonic name="hunter exploding"/>
	<mnemonic name="hunter projectile hit"/>
	<mnemonic name="hunter projectile flyby"/>
	<mnemonic name="enforcer activate"/>
	<mnemonic name="enforcer attack"/>
	<mnemonic name="enforcer projectile hit"/>
	<mnemonic name="enforcer projectile flyby"/>
	<mnemonic name="flickta melee attack"/>
	<mnemonic name="flickta melee hit"/>
	<mnemonic name="flickta projectile attack"/>
	<mnemonic name="flickta projectile sewage hit"/>
	<mnemonic name="flickta projectile sewage flyby"/>
	<mnemonic name="flickta projectile lava hit"/>
	<mnemonic name="flickta projectile lava flyby"/>
	<mnemonic name="flickta dying"/>
	<mnemonic name="machine binder"/>
	<mnemonic name="machine bookpress"/>
	<mnemonic name="machine puncher"/>
	<mnemonic name="electric hum"/>
	<mnemonic name="alarm"/>
	<mnemonic name="night wind"/>
	<mnemonic name="surface explosion"/>
	<mnemonic name="underground explosion"/>
	<mnemonic name="sphtkr attack"/>
	<mnemonic name="sphtkr projectile hit"/>
	<mnemonic name="sphtkr projectile flyby"/>
	<mnemonic name="sphtkr hit"/>
	<mnemonic name="sphtkr exploding"/>
	<mnemonic name="tick chatter"/>
	<mnemonic name="tick falling"/>
	<mnemonic name="tick flapping"/>
	<mnemonic name="tick exploding"/>
	<mnemonic name="ceiling lamp exploding"/>
	<mnemonic name="pfhor platform starting"/>
	<mnemonic name="pfhor platform stopping"/>
	<mnemonic name="pfhor platform"/>
	<mnemonic name="pfhor door opening"/>
	<mnemonic name="pfhor door closing"/>
	<mnemonic name="pfhor door obstructed"/>
	<mnemonic name="pfhor door"/>
	<mnemonic name="pfhor switch off"/>
	<mnemonic name="pfhor switch on"/>
	<mnemonic name="juggernaut firing"/>
	<mnemonic name="juggernaut warning"/>
	<mnemonic name="juggernaut exploding"/>
	<mnemonic name="juggernaut start attack"/>
	<mnemonic name="enforcer exploding"/>
	<mnemonic name="alien noise 1"/>
	<mnemonic name="alien noise 2"/>
	<mnemonic name="vacbob wail"/>
	<mnemonic name="vacbob scream"/>
	<mnemonic name="vacbob hit"/>
	<mnemonic name="vacbob chatter"/>
	<mnemonic name="assimilated vacbob chatter"/>
	<mnemonic name="vacbob trash talk"/>
	<mnemonic name="vacbob apology"/>
	<mnemonic name="vacbob activation"/>
	<mnemonic name="vacbob clear"/>
	<mnemonic name="vacbob angry"/>
	<mnemonic name="vacbob secure"/>
	<mnemonic name="vacbob kill the player"/>
      </mnemonics>
    </enum>
    <enum name="texture_type">
      <mnemonics>
        <mnemonic name="wall"/>
        <mnemonic name="landscape"/>
        <mnemonic name="sprite"/>
        <mnemonic name="weapon in hand"/>
        <mnemonic name="interface"/>
      </mnemonics>
    </enum>
    <enum name="transfer_mode">
      <mnemonics>
	<mnemonic name="normal"/>
	<mnemonic name="pulsate"/>
	<mnemonic name="wobble"/>
	<mnemonic name="fast wobble"/>
	<mnemonic name="static"/>
	<mnemonic name="landscape"/>
	<mnemonic name="horizontal slide"/>
	<mnemonic name="fast horizontal slide"/>
	<mnemonic name="vertical slide"/>
	<mnemonic name="fast vertical slide"/>
	<mnemonic name="wander"/>
	<mnemonic name="fast wander"/>
      </mnemonics>
    </enum>
    <enum name="weapon_type">
      <mnemonics>
	<mnemonic name="fist"/>
	<mnemonic name="pistol"/>
	<mnemonic name="fusion pistol"/>
	<mnemonic name="assault rifle"/>
	<mnemonic name="missile launcher"/>
	<mnemonic name="flamethrower"/>
	<mnemonic name="alien weapon"/>
	<mnemonic name="shotgun"/>
	<mnemonic name="ball"/>
	<mnemonic name="smg"/>
      </mnemonics>
    </enum>
    <enum-accessor name="AmbientSounds" contains="ambient_sound" nice-name="Ambient Sounds"/>
    <enum-accessor name="CompletionStates" contains="completion_state" nice-name="Completion States"/>
    <enum-accessor name="Collections" contains="collection" nice-name="Collections"/>
    <enum-accessor name="ControlPanelClasses" contains="control_panel_class" nice-name="Control Panel Classes"/>
    <enum-accessor name="ControlPanelTypes" contains="control_panel_type" nice-name="Control Panel Types"/>
    <enum-accessor name="DamageTypes" contains="damage_type" nice-name="Damage"/>
    <enum-accessor name="DifficultyTypes" contains="difficulty_type" nice-name="Difficulty"/>
    <enum-accessor name="EffectTypes" contains="effect_type" nice-name="Effects"/>
    <enum-accessor name="FadeTypes" contains="fade_type" nice-name="Faders"/>
    <enum-accessor name="GameTypes" contains="game_type" nice-name="Game Types"/>
    <enum-accessor name="ItemTypes" contains="item_type" nice-name="Items"/>
    <enum-accessor name="MediaTypes" contains="media_type" nice-name="Media"/>
    <enum-accessor name="LightFunctions" contains="light_function" nice-name="Light Functions"/>
    <enum-accessor name="LightPresets" contains="light_preset" nice-name="Light Presets"/>
    <enum-accessor name="LightStates" contains="light_state" nice-name="Light States"/>
    <enum-accessor name="MonsterActions" contains="monster_action" nice-name="Monster Actions"/>
    <enum-accessor name="MonsterClasses" contains="monster_class" nice-name="Monster Classes"/>
    <enum-accessor name="MonsterModes" contains="monster_mode" nice-name="Monster Modes"/>
    <enum-accessor name="MonsterTypes" contains="monster_type" nice-name="Monsters"/>
    <enum-accessor name="OverlayColors" contains="overlay_color" nice-name="Overlay Colors"/>
    <enum-accessor name="PlatformTypes" contains="platform_type" nice-name="Platform Types"/>
    <enum-accessor name="PlayerColors" contains="player_color" nice-name="Player and Team Colors"/>
    <enum-accessor name="PolygonTypes" contains="polygon_type" nice-name="Polygons"/>
    <enum-accessor name="ProjectileTypes" contains="projectile_type" nice-name="Projectiles"/>
    <enum-accessor name="SceneryTypes" contains="scenery_type" nice-name="Scenery"/>
    <enum-accessor name="ScoringModes" contains="scoring_mode" nice-name="Scoring Modes"/>
    <enum-accessor name="SideTypes" contains="side_type" nice-name="Side Types"/>
    <enum-accessor name="Sounds" contains="sound" nice-name="Sounds"/>
    <enum-accessor name="TextureTypes" contains="texture_type" nice-name="Texture Types"/>
    <enum-accessor name="TransferModes" contains="transfer_mode" nice-name="Transfer Modes"/>
    <enum-accessor name="WeaponTypes" contains="weapon_type" nice-name="Weapons"/>
  </tables>
  <types id="types">
    <description>The string mnemonics listed below can be used for assignment and as arguments to functions. Additionally, Aleph One's Lua interpreter has been modified so that equality comparisons between userdata types and strings are possible.</description>
    <description>For example, this script would move all players on the blue team to the red team:
<span class="pre">for p in Players() do
  if p.team == "blue" then
    p.team = "red"
  end
end</span>
And this one would damage all major compilers with 10 points of fusion damage:
<span class="pre">for m in Monsters() do
  if m.type == "major compiler" then
    m:damage(10, "fusion")
  end
end</span>
Each type has a read-only .index field, which represents the game's internal index:
<span class="pre">&gt; =ItemTypes["pistol"].index
1
</span>
Each type also has a .mnemonic field, which is handy for finding the mnemonic of a given type:
<span class="pre">&gt; =MonsterTypes["major compiler"].class.mnemonic
compiler
</span>
You can even use the mnemonic field to customize the mnemonics for your scenario. Note that you can only have one string mnemonic per type index:
<span class="pre">&gt; WeaponTypes["fist"].mnemonic = "puncher"
&gt; =WeaponTypes["puncher"].index
0
&gt; =WeaponTypes["fist"]
nil
</span>
If you do this, you should customize them all at the beginning of the script. Changing mnemonics mid-game will confuse anyone who tries to read your script, and probably yourself as well!
</description>
  </types>
  <section name="Example Icon" id="example_icon">
    <description>
      <pre>
--[[
This is  an example  of an  icon  in  the format  used by  Aleph One's  overlay
functions.
The first characters  are a digit string  describing the number of  colors. (in
this example, it's 7.
The first character that  is not a digit is ignored,  as are all the characters
following it  that are the same  character. (i.e. I  could use a q instead of a
newline here.
Then,  for  every color,  it reads  a character,  followed by  a six-digit  hex
string,  which is the  HTML-style color corresponding  to that character in the
image.  After reading this string,  it ignores the next character,  whatever it
is.
Once it has  read every color,  it reads all the following characters,  and for
every character it reads for which a color has defined, it puts that color into
the icon as the next pixel. Other characters are ignored. (see below.)
Icons are always 16x16.
]]

[[
7
 0000FF
#000000
.FFFFFF
$7FAE20
%EBD52A
,45983C
*5B4714
*************# The fact
*************# that it
*$$$#*********# ignores
$$$$$#********# characters
$$$$$#$$******# that
$$##$##$$*****# are
$$$$##.#$$#**# not colors
$%%$$#.,#$#**# can be
%%%%%%##,#$$# exploited to interesting
%%%%%%%##$$# effect by a sufficiently
#%%%%%%%$$$$# resourceful and obnoxious
*##%%%%%%$$$$###
#**#%%#%%%###**#
*#*##%%#%%$$$$# person
**#  #%%##%$$# such as
**#   #%%%#%$# myself :)
Additionally, once it has read 256 valid characters, it ignores the rest of the
string.
]]
      </pre>
    </description>
  </section>
</document>
