  <refentry id="scr2-burplauncher">
   <refnamediv><refname>Burplauncher</refname>
    <refpurpose>Helper for burrick gas clouds.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Burplauncher</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Slain</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Firer</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script is meant to be put on the <object>burplauncher</object> object that is emitted by burricks. When any part of the cloud of gas collides with something else, this script will destroy all other parts of the cloud. However, <object>burplauncher</object> works just fine without the script, and the difference isn’t very noticeable.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-cleanobjdestroy">
   <refnamediv><refname>CleanObjDestroy</refname>
    <refpurpose>Destroy objects when they aren’t visible.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CleanObjDestroy</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap will destroy objects in a way that the player doesn’t see them disappear. Objects that are currently visible, or are being carried by the player, will be skipped. The script continues to check every few seconds until all linked objects have been destroyed.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-collapsefloor">
   <refnamediv><refname>CollapseFloor</refname>
    <refpurpose>An object that will fall down when stepped on.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CollapseFloor</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>PressurePlateActive</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Corpse</flavor></member>
      <member><flavor>Flinderize</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Misc\Pressure Plate</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A collapsing floor is a type of pressure plate. The object is usually placed above a pit. You can configure the <property>Physics\Misc\Pressure Plate</property> however you like. A slower speed and longer travel distance will give the player time to get off of the collapsing section before it falls. When the object is fully depressed, it will be destroyed. To make the object appear to fall to the bottom of the pit, you need to create a separate archetype for the falling object. Create a <flavor>Corpse</flavor> link from the collapsing floor to the falling object. You can also use <flavor>Flinderize</flavor> links for falling objects that will be scattered.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-controlwindowshade">
   <refnamediv><refname>ControlWindowShade</refname>
    <refpurpose>An animated light that automatically turns on and off.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ControlWindowShade</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">WindowShade</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Sim</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Script\Timing</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>auto_time_min</parameter></member>
      <member><parameter>auto_time_max</parameter></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a variation of <script moreinfo="refentry">WindowShade</script> that also periodically turns the light on or off. The time between changes is randomly selected, between 5 and 15 seconds by default. This can be changed with the <parameter>auto_time_min</parameter> and <parameter>auto_time_max</parameter> parameters. Whether the light will be changed to on or to off depends on the <property>Script\Timing</property> property. This number is the probability that the light will be turned on. A value of 100 or greater will keep the light turned on all the time.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-convcontrol">
   <refnamediv><refname>ConvControl</refname>
    <refpurpose>Controller for complex multi-part conversations.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ConvControl</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
      <member><message>NowLocked</message></member>
      <member><message>NowUnlocked</message></member>
      <member><message>Presence</message></member>
      <member><message>Absence</message></member>
      <member><message>Intrusion</message></member>
      <member><message>Privacy</message></member>
      <member><message>ConvNext</message></member>
      <member><message>ConvEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script allows you to make complex multi-part conversations that can be interrupted and resumed. The controller is linked to a number of conversation traps. When the controller is turned on, it will trigger the first of the linked conversations. One of the conversation actors should have the <script moreinfo="refentry">ConvSpeaker</script> script so it can send a <message>ConvNext</message> message back to the controller. When this happens, the controller will remove the link to the conversation that was just triggered and proceed to the next one. This continues until an actor sends <message>ConvEnd</message>, or if the controller is turned off.</para>
    <para>A locked controller does not trigger any conversation. If the controller is turned on while locked, or was turned on when it became locked, then it will continue the conversations once it is unlocked.</para>
    <para>The messages <message>Presence</message> and <message>Absence</message> are also accepted and will turn the controller on and off, respectively. The message <message>Intrusion</message> will act like locking the controller, and <message>Privacy</message> is like unlocking it.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-convspeaker">
   <refnamediv><refname>ConvSpeaker</refname>
    <refpurpose>Allow an AI to perform complex conversation actions.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ConvSpeaker</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>ConvNext</message></member>
      <member><message>ConvEnd</message></member>
      <member><message>Slay</message></member>
      <member><message>PlayVO</message></member>
      <member><message>PlayAmbient</message></member>
      <member><message>CompleteGoal</message></member>
      <member><message>FailGoal</message></member>
      <member><message>CancelGoal</message></member>
      <member><message>ShowGoal</message></member>
      <member><message>HideGoal</message></member>
      <member><message>SwapGoal</message></member>
      <member><message>IsGoalShown</message></member>
      <member><message>IsGoalComplete</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script responds to messages from an AI involved in a conversation or other pseudo-script. Add this script to the AI and use the action <symbol>Script message</symbol> with the message name as the first argument. Some of these messages use the other arguments of the command. Where the description mentions the “first argument”, it is referring to the arguments the message receives, which are offset by one in the pseudo-script action dialog box. So you’d type the “first” argument for the message as the second argument for the action.</para>
    <variablelist>
     <varlistentry>
      <term>
       <inlinelist>
        <member>ConvNext</member>
        <member>ConvEnd</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Relay the message to the controller of a conversation. Meant to be used with <script moreinfo="refentry">ConvControl</script>. The controller object will be located automatically, but you can specify a specific object as the first argument.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>PlayAmbient</member>
        <member>PlayVO</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Play a schema as either an ambient sound, or as a voice-over. The first argument is the name of the schema object.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>Slay</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Slays a specified argument. Leave the argument blank, or type “<literal>self</literal>” to slay this AI. Otherwise, the argument is the object to slay.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>CompleteGoal</member>
        <member>FailGoal</member>
        <member>CancelGoal</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Changes the state of an objective. The argument is a comma (‘<literal>,</literal>’) separated list of objective numbers that will be modified.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>ShowGoal</member>
        <member>HideGoal</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Changes the visibility of an objective. The argument is a comma (‘<literal>,</literal>’) separated list of objective numbers that will be modified.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>SwapGoal</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Simultaneously makes one objective visible and hides another. This message takes two arguments; both comma (‘<literal>,</literal>’) separated lists of objective numbers. The first argument is the objectives to hide, and the second is the objectives to show.</simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>
       <inlinelist>
        <member>IsGoalShown</member>
        <member>IsGoalComplete</member>
       </inlinelist>
      </term>
      <listitem>
       <simpara>Checks if an objective is visible or if it is completed. The argument is a comma (‘<literal>,</literal>’) separated lists of objective numbers. If any of the objectives are hidden or incomplete, then the pseudo-script stops.</simpara>
      </listitem>
     </varlistentry>
    </variablelist>
   </refsection>
  </refentry>

  <refentry id="scr2-corpsefrobfixed">
   <refnamediv><refname>CorpseFrobFixed</refname>
    <refpurpose>Lets you pick up AI after they have been disabled.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CorpseFrobFixed</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>AIModeChange</message></member>
      <member><message>Slain</message></member>
      <member><message>FrobWorldEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>FrobInert</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The standard script <script>CorpseFrobHack</script> doesn’t work with AI that contain unfrobbable objects. This replacement fixes that problem.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-cuttycell">
   <refnamediv><refname>CuttyCell</refname>
    <refpurpose>Trigger for complex conversations.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CuttyCell</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>PlayerRoomEnter</message></member>
      <member><message>PlayerRoomExit</message></member>
      <member><message>Presence</message></member>
      <member><message>Absence</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a room script that generates the <message>Presence</message> and <message>Absence</message> message for the <script moreinfo="refentry">ConvControl</script> script. It activates when the <object>Player</object> enters or leaves the room.</para>
    <para>The controller can also be triggered with standard <message>TurnOn</message> and <message>TurnOff</message> messages, so this script isn’t really necessary.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-elemental">
   <refnamediv><refname>Elemental</refname>
    <refpurpose>An object that can grow and shrink when damaged.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Elemental</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Damage</message></member>
      <member><message>Slain</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Shape\Scale</property></member>
      <member><property>Tweq\Scale</property></member>
      <member><property>Tweq\ScaleState</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>health_curve</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script will adjust the <property>Shape\Scale</property> to match the health of the object. Add the <property>Tweq\Scale</property> property to the object and it will shrink when slain.</para>
    <para>The <parameter>health_curve</parameter> parameter modifies the relationship between the health of the object and its size. See the description of <script moreinfo="refentry">TrapPhantom</script> for the possible values.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorybase">
   <refnamediv><refname>FactoryBase</refname>
    <refpurpose>Abstract script for factory switches.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryBase</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TweqComplete</message></member>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
      <member><message>SynchUp</message></member>
      <member><message>Target?</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>ErrorOutput</userinput>)</member>
      <member><flavor>FrobProxy</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Joints</property></member>
      <member><property>Tweq\JointState</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event StateChange DirectionState ...</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The objects that are used in factory set-ups share many actions. Because most of the objects are levers, or act similarly to levers, this script mostly does all the things that you would expect from the <script>StdTwoState</script> script, such as activating tweqs, environmental schemas, and sending <message>TurnOn</message> and <message>TurnOff</message> messages.</para>
    <para>A typical factory uses one cauldron, two levers, a gauge, one mold, and a product. Optional devices include, a buzzer, a mold socket, a gear, and sparks. With a worker, the factory can be automated. See the scripts for each individual device for specific directions.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorycauldron">
   <refnamediv><refname>FactoryCauldron</refname>
    <refpurpose>Controller for a cauldron in a factory.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryCauldron</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">FactoryBase</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Synch</userinput>)</member>
      <member><flavor>ScriptParams</flavor>(<userinput>Sparks</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Models</property></member>
      <member><property>Renderer\AnimLight</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member><object>cauldron_lp</object></member>
      <member><object>lava_pour</object></member>
      <member><object>cauldron_pivot</object></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A cauldron is a lever that, when on, indicates that molten iron is being poured into a mold. It has a joint tweq for tilting, and a model tweq for showing pouring iron. It can also be illuminated while pouring.</para>
    <para>A cauldron is normally activated by a lever using a <flavor>ControlDevice</flavor> link. The cauldron should link to a gauge using <flavor>ControlDevice</flavor>. While moving forwards or backwards, it will turn a gear that is linked using <flavor>ScriptParams</flavor> links with the data “<userinput>Synch</userinput>”. The gear should use the script <script>TweqOnOff</script>. While pouring, a particle SFX can be activated. Link to the SFX using a <flavor>ScriptParams</flavor> link with the data “<userinput>Sparks</userinput>”. If the factory is automated, the worker AI must link to the cauldron using <flavor>Owns</flavor>.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorygauge">
   <refnamediv><refname>FactoryGauge</refname>
    <refpurpose>Controller for a gauge in a factory.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryGauge</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">FactoryBase</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Halt</message></member>
      <member><message>Full</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Mold</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>rates</parameter><type>(float,float,float)</type></member>
      <member><parameter>overflow</parameter><type>(float)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A gauge in a factory indicates when a mold has been filled. The joint tweq of the gauge can be in three stages: rising, overflow, and falling. The speed of the tweq in each stage must be set using the parameter <parameter>rates</parameter> set to three floating-point values separated by commas. You also configure the <property>Tweq\Joints</property> property for the first stage. After the first stage, the gauge will continue moving forward at the speed from the second value in <parameter>rates</parameter>, and will add the value of <parameter>overflow</parameter> to the “high” position of the tweq. After the second stage, the tweq will reverse and return to the “low” position at the third speed from <parameter>rates</parameter>. The default rates are “<literal>1.75,0.5,30</literal>” and the default overflow is “<literal>20</literal>”.</para>
    <para>When the gauge goes from the first to the second stage, it will send the message <message>Full</message> along <flavor>ScriptParams</flavor> links that have the data set to “<userinput>Mold</userinput>”. This link should point to the factory mold. It sends <message>TurnOn</message> along <flavor>ControlDevice</flavor> links after the second stage. This message should pass through an <object>Inverter</object> to turn off the lever that controls the cauldron. Another link can also go to a buzzer. It does not send <message>TurnOff</message> at any time.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorylever">
   <refnamediv><refname>FactoryLever</refname>
    <refpurpose>A lever in a factory.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryLever</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">FactoryBase</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>FrobWorldEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>LockMe</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A factory lever uses locks to prevent it from being toggled at inappropriate times. There are typically two factories in each factory: one controlling a cauldron and one controlling a mold. The lever will link to the controlled object using <flavor>ControlDevice</flavor>. Each lever has an associated <object>FnordLock</object> that the lever links to using <flavor>Lock</flavor>. There should also be a <flavor>ScriptParams</flavor> link with the data “<userinput>LockMe</userinput>” from each lever to the lock for the other lever. The lever can also link to a buzzer using a <flavor>ScriptParams</flavor> link with the data set to “<userinput>ErrorOutput</userinput>”. This will be used if the lever is frobbed while it is locked.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorylight">
   <refnamediv><refname>FactoryLight</refname>
    <refpurpose>A light that automatically turns off.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryLight</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Renderer\Render Type</property></member>
      <member><property>Renderer\AnimLight</property></member>
      <member><property>Script\Timing</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event Activate</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A factory light is most often used as a buzzer. When activated, the light will turn on and play a schema. After the time set in <property>Script\Timing</property>, the light will turn off. If <property>Script\Timing</property> is not set, then the light will be on for 550 milliseconds.</para>
    <para>The object doesn’t have to use <property>Renderer\AnimLight</property>. Without the property, the “light” will be turned on by setting the <property>Renderer\Render Type</property> to <constant>Unlit</constant>, and turned off by resetting it to <constant>Normal</constant>.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorymold">
   <refnamediv><refname>FactoryMold</refname>
    <refpurpose>...</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryMold</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">FactoryLever</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>FrobToolEnd</message></member>
      <member><message>Contained</message></member>
      <member><message>SocketMe</message></member>
      <member><message>UnsocketMe</message></member>
      <member><message>Full</message></member>
      <member><message>Full?</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Mold</userinput>)</member>
      <member><flavor>Owns</flavor></member>
      <member><flavor>Contains</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Model\Attributes</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr2-factorywork">
   <refnamediv><refname>FactoryWork</refname>
    <refpurpose>...</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FactoryWork</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>ObjActResult</message></member>
      <member><message>MotionEnd</message></member>
      <member><message>Alertness</message></member>
      <member><message>AIModeChange</message></member>
      <member><message>Slain</message></member>
      <member><message>Report</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Owns</flavor></member>
      <member><flavor>Route</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>WithHammer</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-FactoryWorker</metaproperty></member>
      <member><metaproperty>M-WithHammer</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Objects</term>
     <listitem><inlinelist>
      <member><object>TrolPt</object></member>
      <member><object>Molds</object></member>
      <member><object>Hammers</object></member>
      <member><object>SmeltingCauldr</object></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>frobmotion</parameter><type>(string)</type></member>
      <member><parameter>pickupmotion</parameter><type>(string)</type></member>
      <member><parameter>dropmotion</parameter><type>(string)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr2-fireelemsparx">
   <refnamediv><refname>FireElemSparx</refname>
    <refpurpose>Adjust the color of a SFX.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FireElemSparx</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
      <member><message>Mood0</message></member>
      <member><message>Mood1</message></member>
      <member><message>Mood2</message></member>
      <member><message>Mood3</message></member>
      <member><message>Die</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>SFX\Particles</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The <script moreinfo="refentry">FireElement</script> sends messages to its attached SFX indicating the alert level of the AI. This script adjusts the color of the particles based on those messages.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-fireelement">
   <refnamediv><refname>FireElement</refname>
    <refpurpose>An AI made out of fire.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FireElement</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">Elemental</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Damage</message></member>
      <member><message>Alertness</message></member>
      <member><message>Mood0</message></member>
      <member><message>Mood1</message></member>
      <member><message>Mood2</message></member>
      <member><message>Mood3</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Renderer\Dynamic Light</property></member>
      <member><property>Renderer\Extra Light</property></member>
      <member><property>Renderer\Transparency</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>BigHeatSource</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Stimuli</term>
     <listitem><inlinelist>
      <member><stimulus>WaterStim</stimulus></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Objects</term>
     <listitem><inlinelist>
      <member><object>FElemHit</object></member>
      <member><object>SteamPuff</object></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A fire elemental glows brighter when alerted, generates extra heat at high alert, and is damaged by water. Fire elementals can be created without using this script, but they’re much better with it.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-hestartedit">
   <refnamediv><refname>HeStartedIt</refname>
    <refpurpose>Wake up AI when the player attacks.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>HeStartedIt</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Damage</message></member>
      <member><message>Slain</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-Swaying Burrick</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Stimuli</term>
     <listitem><inlinelist>
      <member><stimulus>Knockout</stimulus></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>If the <object>Player</object> damages or knocks out this AI, then the metaproperty <metaproperty>M-Swaying Burrick</metaproperty> will be removed from all creatures.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-horn">
   <refnamediv><refname>Horn</refname>
    <refpurpose>Wake up AI when grabbed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Horn</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>AmbientHacked</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-Swaying Burrick</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Removes the metaproperty <metaproperty>M-Swaying Burrick</metaproperty> from all creatures when this object is picked up. It also disables the ambient schema on the object.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-hotplate">
   <refnamediv><refname>HotPlate</refname>
    <refpurpose>Stimulate objects that touch this one.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>HotPlate</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>PhysContactCreate</message></member>
      <member><message>PhysContactDestroy</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When an object touches this one, it will receive any contact stimuli from it.</para>
    <para>This is actually the same as the <script>PhysARContact</script> script.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-hotplatecontrol">
   <refnamediv><refname>HotPlateControl</refname>
    <refpurpose>Toggles the state of hot plates.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>HotPlateControl</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TweqComplete</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Joints</property></member>
      <member><property>Tweq\Flicker</property></member>
      <member><property>Shape\Joint Positions</property></member>
      <member><property>Renderer\Extra Light</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>HotPlateHeat</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script uses a combination of a joint tweq and a flicker tweq to determine when linked hot plates are dangerous. The joint tweq, which determines when the plates are on or off, should vary between <literal>-1</literal> and <literal>1</literal>. The flicker tweq determines how often the plates are updated and should have a fairly low period. Each time the flicker triggers, the <property>Renderer\Extra Light</property> amount is set to the position of joint 1. If the value is greater than zero, then the meta-property <metaproperty>HotPlateHeat</metaproperty> is added, and it is removed if the value is less than zero.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-junkvines">
   <refnamediv><refname>JunkVines</refname>
    <refpurpose>Stimulate the player when contained.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>JunkVines</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The <object>JunkEarthWebs</object> should have both this script and <script>JunkWebs</script> in order to work properly. When the object is put in the inventory of the <object>Player</object>, it will stimulate the player by contact.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-magicbones">
   <refnamediv><refname>MagicBones</refname>
    <refpurpose>Trigger when colliding with a specific object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>MagicBones</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Slain</message></member>
      <member><message>PhysCollision</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Owns</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script is meant to be used with <script moreinfo="refentry">MagicCoffin</script>. When the object collides with its owner, it will slay itself and send <message>BoneSlain</message> to the owner.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-magiccoffin">
   <refnamediv><refname>MagicCoffin</refname>
    <refpurpose>Trigger when owned objects have been slain.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>MagicCoffin</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>BoneSlain</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Owns</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This object should be an unrendered bounding-box. Create <flavor>Owns</flavor> links to objects that have the <script moreinfo="refentry">MagicBones</script> script. That script will slay each object when it collides with this one. When all of the objects have been slain, the trap will be activated.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-modelbycount">
   <refnamediv><refname>ModelByCount</refname>
    <refpurpose>Change the shape of an object to match it’s stack size.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ModelByCount</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Engine Features\Stack Count</property></member>
      <member><property>Tweq\Models</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script doesn’t work right now. Please ignore it.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-moldsocket">
   <refnamediv><refname>MoldSocket</refname>
    <refpurpose>...</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>MoldSocket</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>SocketMe</message></member>
      <member><message>UnsocketMe</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor></member>
      <member><flavor>Owns</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Model\Attributes</property></member>
      <member><property>Engine Features\KeySrc</property></member>
      <member><property>Engine Features\KeyDst</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr2-nearcuttycell">
   <refnamediv><refname>NearCuttyCell</refname>
    <refpurpose>Trigger for complex conversations.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>NearCuttyCell</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>CreatureRoomEnter</message></member>
      <member><message>CreatureRoomExit</message></member>
      <member><message>Obituary</message></member>
      <member><message>Intrusion</message></member>
      <member><message>Privacy</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Population</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-NotifyRegion</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a room script that generates the <message>Intrusion</message> and <message>Privacy</message> messages for the <script moreinfo="refentry">ConvControl</script> script. It activates when an AI on a bad team enters or leaves the room.</para>
    <para>Putting a lock on the controller does the same thing as this script, and can be more flexible. This script only exists to ease the transition from <application>Thief 1</application>.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-prisoner">
   <refnamediv><refname>Prisoner</refname>
    <refpurpose>Makes the AI flee when triggered.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Prisoner</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-Escapee</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Signals</term>
     <listitem><inlinelist>
      <member><message>Escape</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script on an AI that has the metaproperty <metaproperty>M-Escapee</metaproperty>. When a <message>TurnOn</message> message is sent to it, the AI will receive the signal <message>Escape</message>. You can also use a metaproperty that inherits from <metaproperty>M-Escapee</metaproperty>.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-reallylocked">
   <refnamediv><refname>ReallyLocked</refname>
    <refpurpose>Makes a locked object unfrobbable.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ReallyLocked</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>NowLocked</message></member>
      <member><message>NowUnlocked</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>FrobInert</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When the object is locked it will have the <metaproperty>FrobInert</metaproperty> put on it. The metaproperty is removed when the object is unlocked.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-resetlockbox">
   <refnamediv><refname>ResetLockbox</refname>
    <refpurpose>Lock the object again after it has been unlocked.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ResetLockbox</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>NowUnlocked</message></member>
      <member><message>TweqComplete</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Lock</flavor></member>
      <member><flavor>AIDoor</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Flicker</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Add the property <property>Tweq\Flicker</property> to the object and configure it for the time when the lock should reset. The tweq will be activated when the object is unlocked. When the tweq halts, the object is locked again. If the lock is linked to a door that is being used by an AI, then it wait some more before locking the object.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-securedoor">
   <refnamediv><refname>SecureDoor</refname>
    <refpurpose>Set watch links when a door is opened.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>SecureDoor</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Sim</message></member>
      <member><message>DoorOpening</message></member>
      <member><message>DoorClose</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIWatchObj</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>watcher</parameter><type>(object)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para><flavor>AIWatchObj</flavor> links will be created to this door if it changes from its original state. The links will be removed if it returns to normal. Put <property>AI\Utility\Watch: Watch link defaults</property> on the door to configure the links. The links will be created for all <object>Human</object> objects by default. Set the <parameter>watcher</parameter> parameter to the name of an archetype to override this.</para>
    <para>You can make a door start in the open state by adding the property <property>Difficulty\Close (Open) Door</property> and leaving the flags unchecked.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-stickyvines">
   <refnamediv><refname>StickyVines</refname>
    <refpurpose>Create crushing vines when the object hits the player.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>StickyVines</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>PhysCollision</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Objects</term>
     <listitem><inlinelist>
      <member><object>JunkEarthWebs</object></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Use this script on the <object>EarthShot</object> projectile. When it hits the <object>Player</object>, a <object>JunkEarthWebs</object> object will be put in his inventory.</para>
    <para><object>JunkEarthWebs</object> needs to have both <script>JunkWebs</script> and <script moreinfo="refentry">JunkVines</script> on it.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trapaiwake">
   <refnamediv><refname>TrapAIWake</refname>
    <refpurpose>Wakes up inactive AI.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapAIWake</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
      <member><message>WakeyWakey</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Use this to activate the <script moreinfo="refentry">WakeableAI</script> script.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trapcreate">
   <refnamediv><refname>TrapCreate</refname>
    <refpurpose>Reveal a contained object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapCreate</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Contains</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When activated, the objects contained by the trap will be revealed at its location.</para>
    <para>It’s much better to use <script>TrapRelease</script> instead. This only exists for the sake of compatibility.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trapsecuredoor">
   <refnamediv><refname>TrapSecureDoor</refname>
    <refpurpose>Make an object suspicious.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapSecureDoor</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIWatchObj</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Engine Features\Suspicious</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>watcher</parameter><type>(object)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The simplest way to use this script is to add the <property>Engine Features\Suspicious</property> property to the object. Then the <symbol>Is Suspicious</symbol> flag will be just be turned on and off.</para>
    <para>Another way creates <flavor>AIWatchObj</flavor> links to the object when it is turned on, and removes the links when turned off. Use the <property>AI\Utility\Watch: Watch link defaults</property> property to configure the links. The links will be created on all <object>Human</object> objects by default, or on the archetype specified in the <parameter>watcher</parameter> parameter.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trapslayer">
   <refnamediv><refname>TrapSlayer</refname>
    <refpurpose>Slay an object using a stimulus.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapSlayer</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Game\Damage Model\Hit Points</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Stimuli</term>
     <listitem><inlinelist>
      <member><stimulus>BashStim</stimulus></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap will slay linked objects by damaging them with a <stimulus>BashStim</stimulus>. The hit-points of the object is set to 1 first, so the damage results in death. If this isn’t done, the object won’t do some things, such as playing a schema or leaving a corpse behind.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trapterminator">
   <refnamediv><refname>TrapTerminator</refname>
    <refpurpose>Destroy objects when activated.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapDestroy</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The standard <script>TrapDestroy</script> script doesn’t really destroy all objects. This script, when activated, will destroy all <flavor>ControlDevice</flavor> linked objects, no questions asked.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-trigobbplayerstuff">
   <refnamediv><refname>TrigOBBPlayerStuff</refname>
    <refpurpose>Trigger when the player trips the trap.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigOBBPlayerStuff</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>PhysEnter</message></member>
      <member><message>PhysExit</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Firer</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is an bounds trigger that is activated by the player. It trips either when the <object>Player</object> object walks into the bounding-box, or if something the player throws or shoots enters.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-wakeableai">
   <refnamediv><refname>WakeableAI</refname>
    <refpurpose>Wake up an inactive AI.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>WakeableAI</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>WakeyWakey</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>AI\State\Current mode</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Use this script on AI that won’t be part of the mission until teleported in. Set the <property>AI\State\Current mode</property> property to <constant>Asleep</constant> for improved performance. Then trigger the sleeping AI with the <script moreinfo="refentry">TrapAIWake</script> script and they will wake up.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-watchme">
   <refnamediv><refname>WatchMe</refname>
    <refpurpose>Create watch links.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>WatchMe</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseScript</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>BeginScript</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIWatchObj</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>watcher</parameter><type>(object)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script in a metaproperty. When the metaproperty is added to an object, that object will have <flavor>AIWatchObj</flavor> links created to it. By default, the links are created from every <object>Human</object> object in the mission. You can change the archetype with the <parameter>watcher</parameter> parameter.</para>
   </refsection>
  </refentry>

  <refentry id="scr2-windowshade">
   <refnamediv><refname>WindowShade</refname>
    <refpurpose>An animated light that changes nearby textures.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>WindowShade</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Toggle</message></member>
      <member><message>Slain</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Renderer\Anim Light</property></member>
      <member><property>Script\TerrReplaceOn</property></member>
      <member><property>Script\TerrReplaceOff</property></member>
      <member><property>Script\TerrReplaceDestroy</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a combination of <script>AnimLight</script> and <script>TrapTexture</script>. When the light is turned on, nearby terrain will be set to the texture specified in <property>Script\TerrReplaceOn</property>. When turned off, <property>Script\TerrReplaceOff</property> is used. The object can also be slain, and then it will turn the light off and set the terrain to <property>Script\TerrReplaceDestroy</property>. The light can be turned back on after being slain, but the texture won’t change anymore.</para>
    <para>The starting texture should be set to match the initial state of the light.</para>
   </refsection>
  </refentry>

