  <refentry id="scr-aiitemgiver">
   <refnamediv><refname>AIItemGiver</refname>
    <refpurpose>Allows an AI to transfer an item from it’s inventory to another object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>AIItemGiver</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>TransferItem</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>Contains</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script is intended to be used from a pseudo-script; usually a conversation. Place the script on an AI in the conversation that <flavor>Contains</flavor> some object. Use the <symbol>Script message</symbol> command to send the message <message>TransferItem</message> to the actor. The other two arguments are the destination (<symbol>MsgData1</symbol>) and the object to transfer (<symbol>MsgData2</symbol>). The item will then be removed from the AI’s inventory and put in the inventory of the destination. Objects that combine, even loot, will transfer properly.</para>
   </refsection>
  </refentry>

  <refentry id="scr-forwarder">
   <refnamediv><refname>Forwarder</refname>
    <refpurpose>Relays specific messages to other objects.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Forwarder</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>ScriptParams</flavor>(<replaceable>message</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a generic relay and filter that works with any message. Instead of the usual <flavor>ControlDevice</flavor> or <flavor>SwitchLink</flavor> links, it uses <flavor>ScriptParams</flavor> where the data of the link is the name of the message that will be relayed. You can have any number of links with different data. The length of the <flavor>ScriptParams</flavor> data field is only 15 characters, though. You can get around this redirecting the script to read the message name from an object property. For the link data, type the character ‘<literal>#</literal>’ then the name or ID of an object. On that object, add a <link linkend="designnote">design note</link> and set it to the name of the message to be relayed. The entire design note will be read, so you can’t be using it for any other parameter.</para>
   </refsection>
  </refentry>

  <refentry id="scr-intrinsiccover">
   <refnamediv><refname>IntrinsicCover</refname>
    <refpurpose>Display text when focused.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>IntrinsicCover</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">IntrinsicText</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>WorldFocus</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A variation of <script moreinfo="refentry">IntrinsicText</script> that displays the text when it receives <message>WorldFocus</message>.</para>
   </refsection>
  </refentry>

  <refentry id="scr-intrinsicplaque">
   <refnamediv><refname>IntrinsicPlaque</refname>
    <refpurpose>Display text when frobbed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>IntrinsicPlaque</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">IntrinsicText</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>FrobWorldEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A variation of <script moreinfo="refentry">IntrinsicText</script> that displays the text when it receives <message>FrobWorldEnd</message>.</para>
   </refsection>
  </refentry>

  <refentry id="scr-intrinsictext">
   <refnamediv><refname>IntrinsicText</refname>
    <refpurpose>Display colored text.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>IntrinsicText</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>text</parameter><type>(string)</type></member>
      <member><parameter>clr</parameter><type>(color)</type></member>
      <member><parameter>clr_red</parameter><type>(integer)</type></member>
      <member><parameter>clr_green</parameter><type>(integer)</type></member>
      <member><parameter>clr_blue</parameter><type>(integer)</type></member>
      <member><parameter>time</parameter><type>(time)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Book\Text</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para><script>IntrinsicText</script> displays text on-screen when triggered. If the <property>Book\Text</property> property exists, then it is used as the name of a string file to read. Without a book file, the text to display can be written in the <link linkend="designnote">design note</link>. Using a book allows you to display translatable text; but the design note doesn’t require you to create a custom resource.</para>
    <para>When reading the text from the design note, the <parameter>text</parameter> parameter will be used if it exists. Otherwise, the entire design note is shown. You must use <parameter>text</parameter> if you want other parameters.</para>
    <para>The <parameter>clr</parameter> parameter will change the color of the text in <application>Thief</application>. Alternately, the three parameters <parameter>clr_red</parameter>, <parameter>clr_green</parameter>, and <parameter>clr_blue</parameter> can be used. On-screen text color can’t be changed in <application>System Shock 2</application>. The length of time the text is shown is determined by the number of words. You can specify an duration with the <parameter>time</parameter> parameter. The <parameter>time</parameter> and <parameter>clr</parameter> parameters can be used with either <property>Book\Text</property> or the <parameter>text</parameter> parameter.</para>
   </refsection>
  </refentry>

  <refentry id="scr-invschema">
   <refnamediv><refname>InvSchema</refname>
    <refpurpose>Play a schema when frobbed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>InvSchema</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>FrobInvEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SoundDescription</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Sound\Object Sound</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When the object is frobbed in the inventory, a specified schema will be played. If the frobber is the <object>Player</object>, the schema will be played as an ambient, otherwise it is played normally at the location of the frobber.</para>
    <para><application>Thief</application>: Create a <flavor>SoundDescription</flavor> link to the schema. The link can be from an archetype of the script object as well.</para>
    <para><application>SS2</application>: Set the schema name in the <property>Sound\Object Sound</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr-linktemplate">
   <refnamediv><refname>LinkTemplate</refname>
    <refpurpose>Move links from one object to another, including data.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>LinkTemplate</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>object</parameter><type>(object)</type></member>
      <member><parameter>dest</parameter><type>(object)</type></member>
      <member><parameter>flavor</parameter><type>(string)</type></member>
      <member><parameter>on_create</parameter><type>(boolean)</type></member>
      <member><parameter>off_destroy</parameter><type>(boolean)</type></member>
      <member><parameter>singleton</parameter><type>(boolean)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap will add links to another object when turned on, and remove them when turned off. It is a template because the links are originally created anchored to the script object. That way, the link data can be set appropriately.</para>
    <para>The <parameter>object</parameter> parameter is required and specifies the object that will become the new source of the links. If <parameter>dest</parameter> is specified, then only links to that object will be moved. <parameter>Flavor</parameter> will only move those types of links. If it isn’t specified, then all links <emphasis>except</emphasis> reverse <link linkend="triggerlink">trigger links</link> will be moved.</para>
    <para>On <message>TurnOn</message>, a copy of each valid link will be created with the <parameter>object</parameter> object in place of the script object. The link that was on the script object will then be deleted. If <parameter>on_create</parameter> is set, then the old links are not removed. On <message>TurnOff</message>, valid links with <parameter>object</parameter> as the endpoint will be removed, and re-linked to the script object. If <parameter>off_destroy</parameter> is set, then the links are not re-linked. Note that it’s possible that the links removed from <parameter>object</parameter> could be different than the ones originally copied to it. For instance, if you just add one <flavor>Contains</flavor> link on <message>TurnOn</message>, then <message>TurnOff</message> will move <emphasis>all</emphasis> the <flavor>Contains</flavor> links including those not added by <script>LinkTemplate</script>. Using a specific <parameter>dest</parameter> will usually avoid unexpected side-effects.</para>
    <para>Some links, such as <flavor>AIAwareness</flavor>, only work right if there is just one link between any two objects. Otherwise you’ll get an error that says “<computeroutput>Singleton link expected</computeroutput>”. You can instruct <script>LinkTemplate</script> to avoid duplicate links by setting the <parameter>singleton</parameter> flag.</para>
   </refsection>
  </refentry>

  <refentry id="scr-physmodelcorrect">
   <refnamediv><refname>PhysModelCorrect</refname>
    <refpurpose>Adjust the object’s physics to match its true size.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>PhysModelCorrect</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>PMResize</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Model\Dimensions</property></member>
      <member><property>Shape\Scale</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Normally, resizing an object in DromEd does not alter the physical size of the object. You could manually adjust each resized object, or you could save time and just add this script. When the game starts, this script evaluates the <property>Shape\Scale</property> of the object and its archetype to determine the true size of the object. The <property>Physics\Model\Dimensions</property> property is then set accordingly. This works for <constant>Sphere</constant> and <constant>SphereHat</constant> objects as well as <constant>OBB</constant>s.</para>
    <para>The dimensions can be readjusted at any time by sending <message>PMResize</message> to the object.</para>
   </refsection>
  </refentry>

  <refentry id="scr-randomrelay">
   <refnamediv><refname>RandomRelay</refname>
    <refpurpose>Trigger a randomly selected object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>RandomRelay</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>
      <member><flavor>SwitchLink</flavor></member>
      <member><flavor>ScriptParams</flavor>(<replaceable>weight</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>reusable</parameter><type>(boolean)</type></member>
      <member><parameter>rechargeable</parameter><type>(boolean)</type></member>
      <member><parameter>preserve</parameter><type>(boolean)</type></member>
      <member><parameter>weighted</parameter><type>(boolean)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A <script>RandomRelay</script> relays a <message>TurnOn</message> or <message>TurnOff</message> message to a randomly selected destination. The simplest mode is un-weighted and uses standard <link linkend="triggerlink">trigger links</link>. After the relay has been used, it will lock itself. Essentially, this trap has the <constant>Once</constant> <link linkend="trapflags">trap control flag</link> on by default. You must set <parameter>reusable</parameter> to use the relay more than once. But each destination will only be triggered once, and the link to the destination removed. To keep the links intact, set <parameter>preserve</parameter>.</para>
    <para><script>RandomRelay</script> can also work with weighted destinations. Destinations with higher weights, relative to the other destinations, are more likely to be chosen. The destinations are linked to with <flavor>ScriptParams</flavor> and the data of the links are set to the weight for that destination. <parameter>Reusable</parameter> and <parameter>preserve</parameter> also apply to weighted relays. Additionally, the relay can be <parameter>rechargeable</parameter>, which implies <parameter>preserve</parameter>. A rechargeable relay will disable a destination after it is used, but maintains the link. When all links have been used, the relay is reset and it can send to previous destinations again.</para>
    <para>This script is also named <script>RandomRelay1x2</script>. There is no difference.</para>
   </refsection>
  </refentry>

  <refentry id="scr-sippable">
   <refnamediv><refname>Sippable</refname>
    <refpurpose>An object that can be used a fixed number of times.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Sippable</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>FrobInvEnd</message></member>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Inventory\Object Name</property></member>
      <member><property>Obj\Object name</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>sips</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A <script>Sippable</script> object display a usage count as part of its inventory name. When it is frobbed in the inventory, the count is reduced by one and, if there are no more uses left, the object is destroyed. The inventory name of the object is set as usual, in the <property>Inventory\Object Name</property> or <property>Obj\Object name</property> property. In the string resource, include the sub-string “<literal>%d</literal>” in the name. That sub-string will be replaced with the number of uses.
     <informalexample>
      <simpara><literal>Magic Potion\n %d sips left</literal></simpara>
     </informalexample>
    </para>
    <para>If the string resource doesn’t exist, or there is no “<literal>%d</literal>” in the name, then a fallback, but untranslatable, method is used. The number of uses plus the words “<literal>sips left</literal>” will be added to the end of the object name.</para>
   </refsection>
  </refentry>

  <refentry id="scr-spy">
   <refnamediv><refname>Spy</refname>
    <refpurpose>Display all messages received by the object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Spy</script></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a debugging aid. It shows every message that is received by an object. The messages are shown on-screen as well as coped to the <link linkend="monolog">monolog</link>. Much of the additional data that accompanies messages is also displayed. Using <script>Spy</script> can help you make sense of the complex interactions of objects. Or it’ll just confuse you way more than you already are.</para>
   </refsection>
  </refentry>

  <refentry id="scr-timedstimulator">
   <refnamediv><refname>TimedStimulator</refname>
    <refpurpose>Periodically stimulate linked objects.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TimedStimulator</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">TrapStim</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<replaceable>interval</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>interval</parameter><type>(time)</type></member>
      <member><parameter>stage</parameter><type>(integer)</type></member>
      <member><parameter>device</parameter><type>(boolean)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-toolmp">
   <refnamediv><refname>ToolMP</refname>
    <refpurpose>...</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ToolMP</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>FrobToolEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>S</userinput>...)</member>
      <member><flavor>ScriptParams</flavor>([<userinput>AR</userinput>]<userinput>@</userinput>...)</member>
      <member><flavor>ScriptParams</flavor>(<userinput>MeantDest</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event Activate</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>effect</parameter><type>(string)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapcamshift">
   <refnamediv><refname>TrapCamShift</refname>
    <refpurpose>Attach the camera to another object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapCamShift</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script will attach the camera to the script object. The camera is returned to the <object>Player</object> when the trap is deactivated.</para>
    <para>The camera object cannot be changed in <application>Thief 1</application>.</para>
    <para>In <application>System Shock 2</application>, the object you attach to must be given a unique name.</para>
   </refsection>
  </refentry>

  <refentry id="scr-traphp">
   <refnamediv><refname>TrapHP</refname>
    <refpurpose>Adjust the hitpoints of an object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapHP</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Game\Damage Model\Hit Points</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>hitcount</parameter><type>(integer)</type></member>
      <member><parameter>target</parameter><type>(object)</type></member>
      <member><parameter>culprit</parameter><type>(object)</type></member>
      <member><parameter>damage</parameter><type>(object)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Heals the <parameter>target</parameter> by <parameter>hitcount</parameter> points, which defaults to 1. Turning the trap off will damage the <parameter>target</parameter> by <parameter>hitcount</parameter> points. <parameter>Hitcount</parameter> can be negative, which would have the same effect as a positive value with the <link linkend="trapflags">trap control flag</link> <constant>Invert</constant> set. The source of the stim is the script object by default, you can change it with <parameter>culprit</parameter>. <parameter>Damage</parameter> sets the type of the stim.</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapmetaprop">
   <refnamediv><refname>TrapMetaProp</refname>
    <refpurpose>Add or remove meta-properties.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapMetaProp</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>ScriptParams</flavor>(<userinput>S</userinput>...)</member>
      <member><flavor>ScriptParams</flavor>([<userinput>AR</userinput>]<userinput>@</userinput>...)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script will add or remove metaproperties on linked objects. Either operation can be performed when the trap is activated. First create a <flavor>ScriptParams</flavor> link to each metaproperty you want to add or remove. Set the data of each link to “<literal>S</literal>” followed by some key, such as a number or name. Each key should be different. Next create <flavor>ScriptParams</flavor> links to the objects you want to modify. Set the data of each link to either “<literal>A@</literal>” or “<literal>R@</literal>” followed by the key from one of the metaproperty links. When turned on, the objects with an “<literal>A@</literal>” link will have the referenced metaproperty added, and those with “<literal>R@</literal>” will have the metaproperty removed. Turning off the trap will do the opposite for each link.</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapmotion">
   <refnamediv><refname>TrapMotion</refname>
    <refpurpose>Play a motion schema.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapMotion</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>mot</parameter><type>(string)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script on an AI to make it play a specific motion when triggered. The name of the motion schema to play is specified in the <parameter>mot</parameter> parameter. It must be the motion name, like “<literal>humgulp</literal>”, and not the schema tags “<literal>Drink 0</literal>”.</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapphantom">
   <refnamediv><refname>TrapPhantom</refname>
    <refpurpose>Gradually fade in/out.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapPhantom</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>Renderer\Transparency (alpha)</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>alpha_min</parameter><type>(float)</type></member>
      <member><parameter>alpha_max</parameter><type>(float)</type></member>
      <member><parameter>rate</parameter><type>(integer)</type></member>
      <member><parameter>curve</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script will manipulate the transparency of the object it’s on. When turned on, the object will become more visible, up to the value of <parameter>alpha_max</parameter>. Turning it off will make it transparent, stopping at <parameter>alpha_min</parameter>. The transparency level will change by the amount of <parameter>rate</parameter> every second. When the object becomes fully visible, a <message>TurnOn</message> is relayed along <link linkend="triggerlink">trigger links</link>. <message>TurnOff</message> is relayed when it becomes invisible.</para>
    <para>The <parameter>curve</parameter> parameter, which didn’t appear in the original version of this script, allows you to tweak the equation used to calculate the transparency. The transition is linear by default, which is a curve value of 0. The other equations are:
    <variablelist>
     <varlistentry>
      <term>1</term>
      <listitem>
       <simpara><literal>x<superscript>2</superscript></literal></simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>2</term>
      <listitem>
       <simpara><literal>&radic;x</literal></simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>3</term>
      <listitem>
       <simpara><literal>log x</literal></simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>4</term>
      <listitem>
       <simpara><literal>10<superscript>x</superscript></literal></simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>5</term>
      <listitem>
       <simpara><literal>ln x</literal></simpara>
      </listitem>
     </varlistentry>
     <varlistentry>
      <term>6</term>
      <listitem>
       <simpara><literal>e<superscript>x</superscript></literal></simpara>
      </listitem>
     </varlistentry>
    </variablelist>
    </para>
   </refsection>
  </refentry>

  <refentry id="scr-trapscrmsgrelay">
   <refnamediv><refname>TrapScrMsgRelay</refname>
    <refpurpose>Convert <message>TurnOn</message> to any other message.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapScrMsgRelay</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>ScriptParams</flavor>(<replaceable>message</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>status_index</parameter><type>(integer)</type></member>
      <member><parameter>data</parameter><type>(string)</type></member>
      <member><parameter>data1</parameter><type>(string)</type></member>
      <member><parameter>data2</parameter><type>(string)</type></member>
      <member><parameter>data3</parameter><type>(string)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapsmtrans">
   <refnamediv><refname>TrapSMTrans</refname>
    <refpurpose>Convert any message to <message>TurnOn</message>.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapSMTrans</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>ScriptParams</flavor>(<replaceable>message</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapstim">
   <refnamediv><refname>TrapStim</refname>
    <refpurpose>Stimulate linked objects.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapStim</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>Stimuli</term>
     <listitem><inlinelist>
      <member><stimulus>ScriptStim</stimulus></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>stim</parameter><type>(object)</type></member>
      <member><parameter>strength</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trapteleportdelta">
   <refnamediv><refname>TrapTeleportDelta</refname>
    <refpurpose>Teleport an object maintaining relative position to a pair of reference objects.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapTeleportDelta</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>
      <member><flavor>ScriptParams</flavor>(<userinput>dm</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trigaiawareshift">
   <refnamediv><refname>TrigAIAwareShift</refname>
    <refpurpose>Trigger when an AI becomes aware of an object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigAIAwareShift</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>DHNotify</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIAwareness</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>af</userinput>...)</member>
      <member><flavor>ScriptParams</flavor>(<userinput>av</userinput>...)</member>
      <member><flavor>ScriptParams</flavor>(<userinput>aa</userinput>...)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Requires <osm>dh2.osl</osm>.</para>
   </refsection>
  </refentry>

  <refentry id="scr-trigbodypickup">
   <refnamediv><refname>TrigBodyPickup</refname>
    <refpurpose>Send <message>TurnOn</message> when an object is picked up.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigBodyPickup</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>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</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 sends <message>TurnOn</message> when the object it is on is picked up. <message>TurnOff</message> is sent when it is dropped. Despite the name, the object doesn’t have to be an AI corpse.</para>
   </refsection>
  </refentry>

  <refentry id="scr-trigdamagertc">
   <refnamediv><refname>TrigDamageRTC</refname>
    <refpurpose>Trigger the object that causes damage.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigDamageRTC</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>TurnOn</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When the object is damaged, the source of the damage gets a <message>TurnOn</message> message sent back to it. The “RTC” stands for “return to culprit.”</para>
   </refsection>
  </refentry>

  <refentry id="scr-trigobbspec">
   <refnamediv><refname>TrigOBBSpec</refname>
    <refpurpose>Trigger when certain types of objects enter a bounding-box.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigOBBSpec</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>
      <member><message>Obituary</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>arc</userinput>)</member>
      <member><flavor>ScriptParams</flavor>(<userinput>cd</userinput>)</member>
      <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>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-trigsim">
   <refnamediv><refname>TrigSim</refname>
    <refpurpose>Send <message>TurnOn</message> when the game starts.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigSim</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>Sim</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trigger activates once, when the game starts, and then it destroys itself.</para>
   </refsection>
  </refentry>

  <refentry id="scr-validator">
   <refnamediv><refname>Validator</refname>
    <refpurpose>Relay to one in a list of objects.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Validator</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>Validate</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<replaceable>index</replaceable>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>order</parameter><type>(string)</type></member>
      <member><parameter>increment</parameter><type>(integer)</type></member>
      <member><parameter>rollover</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>

  <refentry id="scr-zapper">
   <refnamediv><refname>Zapper</refname>
    <refpurpose>Attack with a magical projectile.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Zapper</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>EndAttack</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AITarget</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Stimuli</term>
     <listitem><inlinelist>
      <member><stimulus>MagicZapStim</stimulus></member>
      <member><stimulus>Anti-Human</stimulus></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member><object>ghmagic</object></member>
      <member><object>hit_magic</object></member>
      <member><object>dam_sting</object></member>
      <member><object>exp_cryopsi</object></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>zap_strength</parameter><type>(float)</type></member>
      <member><parameter>no_zap_sound</parameter><type>(boolean)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>...</para>
   </refsection>
  </refentry>
