  <refentry id="scr1-cleanupattack">
   <refnamediv><refname>CleanUpAttack</refname>
    <refpurpose>Disable an attack SFX when an AI is knocked-out.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CleanUpAttack</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>AbortAttack</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>The standard scripts don’t properly handle the case of an AI being knocked-out while in the middle of an attack. To make sure that the attached SFX are disabled, use this script alongside <script>AttackActivate</script>.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-frobfind">
   <refnamediv><refname>FrobFind</refname>
    <refpurpose>Reveal a secret when the object is frobbed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>FrobFind</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>FrobWorldEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Dark GameSys\Stats</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>DrSSecrets</qvar></member>
      <member><qvar>DrSScrtCnt</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Adds to <application>Thief 1</application> the ability to count secrets in a mission. The number of secrets is automatically tallied when the game begins. This script will mark a secret as having been found when the object is frobbed in the world. You also have to set the <constant>Hidden</constant> flag on the <property>Dark GameSys\Stats</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-hiddendoor">
   <refnamediv><refname>HiddenDoor</refname>
    <refpurpose>Reveal a secret when the door is opened.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>HiddenDoor</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>DoorOpen</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Dark GameSys\Stats</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>DrSSecrets</qvar></member>
      <member><qvar>DrSScrtCnt</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Adds to <application>Thief 1</application> the ability to count secrets in a mission. The number of secrets is automatically tallied when the game begins. This script will mark a secret as having been found when the door is opened. You also have to set the <constant>Hidden</constant> flag on the <property>Dark GameSys\Stats</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-invisipotion">
   <refnamediv><refname>InvisiPotion</refname>
    <refpurpose>Makes the player invisible when used.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>InvisiPotion</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">TimedPotion</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Invisible</message></member>
      <member><message>Visible</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>AI\State\Current visibility</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>M-Invisible</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this potion is used by the <object>Player</object>, then he will be made invisible using the metaproperty <metaproperty>M-Invisible</metaproperty>. The metaproperty only needs to include a <property>Scripts</property> with <script moreinfo="refentry">Invisible</script> in it.</para>
    <para>The <property>Renderer\Invisible</property> doesn’t exist in <application>Thief 1</application>, so the player’s weapon doesn’t disappear like in <application>Thief 2</application>.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-invisible">
   <refnamediv><refname>Invisible</refname>
    <refpurpose>Makes the object invisible.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>Invisible</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>Invisible</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIAttack</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>AI\State\Current visibility</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script is activated by the message <message>Invisible</message>, which is sent by the <script moreinfo="refentry">InvisiPotion</script> script. The object will be made invisible to AI.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-lastmissionloot">
   <refnamediv><refname>LastMissionLoot</refname>
    <refpurpose>Use the loot collected in the previous mission.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>LastMissionLoot</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>Difficulty</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Dark Gamesys\Loot</property></member>
      <member><property>Difficulty\Script</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>total_loot</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script will set the object’s <property>Dark Gamesys\Loot</property> property to the amount of loot collected in the previous mission. To activate it, you need to add the <property>Difficulty\Script</property> property and set the flags for which difficulty levels you want to use the script on. If the script isn’t activated, then the <property>Dark Gamesys\Loot</property> property is left unmodified.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-logravpotion">
   <refnamediv><refname>LoGravPotion</refname>
    <refpurpose>Decreases the player’s gravity and movement speed when used.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>LoGravPotion</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">TimedPotion</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Model\Attributes</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this potion is used by the <object>Player</object>, his speed and gravity will be cut in half. Multiple uses don’t affect the overall speed and gravity, but instantaneous speed is reduced each time.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-nopingback">
   <refnamediv><refname>NoPingBack</refname>
    <refpurpose>Ignore mines when the AI is disabled.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>NoPingBack</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>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Metaproperties</term>
     <listitem><inlinelist>
      <member><metaproperty>NoPingBack</metaproperty></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When the AI is knocked-out or killed, the <metaproperty>NoPingBack</metaproperty> metaproperty is added to it. The metaproperty should contain a <stimulus>PingStim</stimulus> receptron with no limit an an effect of <command>Abort</command>.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-nonautodoor">
   <refnamediv><refname>NonAutoDoor</refname>
    <refpurpose>A door that remains closed when unlocked.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>NonAutoDoor</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>DoorOpen</message></member>
      <member><message>DoorClose</message></member>
      <member><message>DoorOpening</message></member>
      <member><message>DoorClosing</message></member>
      <member><message>DoorHalt</message></member>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
      <member><message>FrobWorldEnd</message></member>
      <member><message>Slain</message></member>
      <member><message>NowLocked</message></member>
      <member><message>NowUnlocked</message></member>
      <member><message>SynchUp</message></member>
      <member><message>PlayerToolFrob</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Double</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Door\Rotating</property></member>
      <member><property>Door\Translating</property></member>
      <member><property>Engine Features\Locked</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event StateChange, OpenState, OldOpenState</literal>”</member>
      <member>“<literal>Event Reject, Operation OpenDoor</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Just like the <script>StdDoor</script> script, but when the door is unlocked it remains closed.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-noticesplayerbumps">
   <refnamediv><refname>NoticesPlayerBumps</refname>
    <refpurpose>Become alerted when bumped by the player.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>NoticesPlayerBumps</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>Properties</term>
     <listitem><inlinelist>
      <member><property>AI\AI Core\Alertness cap</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When the <object>Player</object> object collides with this AI, its alert level will momentarily be raised to level 2. <application>Thief 2</application> has this on the robots. I don’t know why it isn’t on all AI.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-physarcontact">
   <refnamediv><refname>PhysARContact</refname>
    <refpurpose>Stimulate objects that touch this one.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>PhysARContact</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>HotPlate</script> script from <application>Thief Gold</application>, but I’m including it for the sake of completeness.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-regravitize">
   <refnamediv><refname>ReGravitize</refname>
    <refpurpose>Set the object’s gravity when touched.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ReGravitize</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>Properties</term>
     <listitem><inlinelist>
      <member><property>Physics\Model\Attributes</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When something collides with this object, its gravity is set to 3.2578125. I honestly don’t know why.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-shutupyerdead">
   <refnamediv><refname>ShutUpYerDead</refname>
    <refpurpose>Cancels an AI’s behavior when it is killed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>ShutUpYerDead</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>IgnorePotion</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>AIAwareness</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script should be part of the <metaproperty>M-KnockedOut</metaproperty> metaproperty. It activates automatically. The <flavor>AIAwareness</flavor> links will be reset, and the message <message>IgnorePotion</message> is sent to the object.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-slayfind">
   <refnamediv><refname>SlayFind</refname>
    <refpurpose>Reveal a secret when the object is slain.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>SlayFind</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>Properties</term>
     <listitem><inlinelist>
      <member><property>Dark GameSys\Stats</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>DrSSecrets</qvar></member>
      <member><qvar>DrSScrtCnt</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Adds to <application>Thief 1</application> the ability to count secrets in a mission. The number of secrets is automatically tallied when the game begins. This script will mark a secret as having been found when the object is slain. You also have to set the <constant>Hidden</constant> flag on the <property>Dark GameSys\Stats</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-slayhaltspeech">
   <refnamediv><refname>SlayHaltSpeech</refname>
    <refpurpose>Silence an AI when killed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>SlayHaltSpeech</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>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Halts the AI’s current speech when it is slain. <application>Thief 2</application> uses this on frogs and rats.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-timedpotion">
   <refnamediv><refname>TimedPotion</refname>
    <refpurpose>A generic potion with a timed activation period.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TimedPotion</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>StartPotion</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Potion</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Script\Timing</property></member>
      <member><property>Engine Features\Combine Type</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event Deactivate</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script is used for potions that activate when frobbed in the inventory. The potion will be active for a specified period of time. Using another potion of the same type will restart the timer. The duration of the potion is specified with the <property>Script\Timing</property> property in milliseconds. The default time is 8.6 seconds, and the potion will always last at least 1 second. The environmental schema tags “<literal>Event Deactivate</literal>” will be played just before the potion ends. This script doesn’t make any sound when the potion begins, though.</para>
    <para>If the object is in an AI’s inventory when the game starts, then the metaproperty <metaproperty>M-QuaffHeal</metaproperty> is added to the AI. This already exists in <application>Thief 1</application>, so you don’t have to create it yourself.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-transformlock">
   <refnamediv><refname>TransformLock</refname>
    <refpurpose>Change an object’s shape when unlocked.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TransformLock</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>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Models</property></member>
      <member><property>Engine Features\KeyDst</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this object is unlocked, the model tweq will be activated. It also disables the lock by setting the <symbol>Region Mask</symbol> to 0.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trapdirection">
   <refnamediv><refname>TrapDirection</refname>
    <refpurpose>Control a tweqable object.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapDirection</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>GoForward</message></member>
      <member><message>GoReverse</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 converts <message>TurnOn</message> and <message>TurnOff</message> messages into <message>GoForward</message> and <message>GoReverse</message>. The messages are relayed along <flavor>ControlDevice</flavor> links. The <script>TweqOnOff</script> script can be used on the controlled object to respond to these messages.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trapfindsecret">
   <refnamediv><refname>TrapFindSecret</refname>
    <refpurpose>Reveal a secret when the trap is activated.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapFindSecret</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>Dark GameSys\Stats</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>DrSSecrets</qvar></member>
      <member><qvar>DrSScrtCnt</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Adds to <application>Thief 1</application> the ability to count secrets in a mission. The number of secrets is automatically tallied when the game begins. This script will mark a secret as having been found when the trap is turned on. You also have to set the <constant>Hidden</constant> flag on the <property>Dark GameSys\Stats</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trapnonfinalcomplete">
   <refnamediv><refname>TrapNonFinalComplete</refname>
    <refpurpose>Trigger when a mission is almost over.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapNonFinalComplete</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>
      <member><message>QuestChange</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>QVars</term>
     <listitem><inlinelist>
      <member><qvar>goal_state_*</qvar></member>
      <member><qvar>goal_visible_*</qvar></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap monitors the objective quest variables. When all of the visible objectives, except for those marked as “final” or “optional”, have been completed, then the trigger is turned on.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trapofffilter">
   <refnamediv><refname>TrapOffFilter</refname>
    <refpurpose>Only relay <message>TurnOff</message> messages.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapOffFilter</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>TurnOff</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is an old-fashioned relay that only passes <message>TurnOff</message>. It doesn’t support any of the more advanced <link linkend="scr-traps">trap features</link>.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-traponce">
   <refnamediv><refname>TrapOnce</refname>
    <refpurpose>Relay a message one time only.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapOnce</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>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is an old-fashioned trap that will relay a single <message>TurnOn</message> or <message>TurnOff</message> only. It doesn’t support any of the more advanced <link linkend="scr-traps">trap features</link>.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trappatroller">
   <refnamediv><refname>TrapPatroller</refname>
    <refpurpose>Activate AI patrol routes.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapPatroller</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>AI\Ability Settings\Patrol: Does patrol</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap activates and deactivates the patrol property of all the AI that it is linked to. The standard <script>TrapPatrol</script> script of <application>Thief 1</application> only changes the property on one object at a time.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-traprevert">
   <refnamediv><refname>TrapRevert</refname>
    <refpurpose>Automatically turn off after being turned on.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapRevert</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>Timer</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Script\Timing</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is an old-fashioned trap. It relays a <message>TurnOn</message> or <message>TurnOff</message> message then, after a period of time, sends the opposite message. The time is specified in the <script>Script\Timing</script> property as milliseconds. If it is not present, or is 0, then the trap acts like a normal relay. Sending a message while the timer is active will cancel the previous timer.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-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="scr1-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="scr1-traptexture">
   <refnamediv><refname>TrapTexture</refname>
    <refpurpose>Change the texture of terrain.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapTexture</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>Script\TerrReplaceOn</property></member>
      <member><property>Script\TerrReplaceOff</property></member>
      <member><property>Engine Features\Retexture Radius</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap controls the texture of nearby terrain. Set the properties to the path to the texture resource for when the trap is turned on and when it is turned off. The destroyed texture isn’t supported by this script. Any cells within the retexture radius will have their polygons swapped between the old and new textures. You need to have the textures initially set to the same state as the trap. Changing textures won’t work if the new texture isn’t also loaded into the mission.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trigobbplayer">
   <refnamediv><refname>TrigOBBPlayer</refname>
    <refpurpose>Trigger when the player enters a region.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigOBBPlayer</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>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event Activate</literal>”</member>
      <member>“<literal>Event Deactivate</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap triggers when the <object>Player</object> object enters the bounding-box dimensions of the object. The properties of the object should be set like the standard <object>BoundsTrigger</object> trap. Of course, you’ll want to modify the dimensions to the appropriate size. An environmental schema with tags “<literal>Event Activate</literal>” will be played when the trap turns on, and “<literal>Event Deactivate</literal>” when turned off.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trigroomdelivery">
   <refnamediv><refname>TrigRoomDelivery</refname>
    <refpurpose>Trigger when the player carries an object into a room.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomDelivery</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">TrigRoomObject</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script on an object and it will trigger when it is carried into a room by the <object>Player</object>. The trigger turns off if the object is dropped, even inside a target room. The object is linked to the target rooms with <flavor>Route</flavor> links.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trigroomdeposit">
   <refnamediv><refname>TrigRoomDeposit</refname>
    <refpurpose>Trigger when the object is dropped in a room.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomDeposit</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Inherits</term>
     <listitem><inlinelist>
      <member><script moreinfo="refentry">TrigRoomObject</script></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Messages</term>
     <listitem><inlinelist>
      <member><message>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script on an object and it will trigger when dropped in a specific room. The trigger turns off if the object leaves the room, or is picked up again. The object is linked to the target rooms with <flavor>Route</flavor> links.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trigroomobject">
   <refnamediv><refname>TrigRoomObject</refname>
    <refpurpose>Trigger when an object enters a room.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomObject</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>ObjRoomTransit</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ControlDevice</flavor></member>
      <member><flavor>Route</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Put this script on an object and it will trigger when entering a target room. You can specify any number of target rooms using <flavor>Route</flavor> links.</para>
   </refsection>
  </refentry>

  <refentry id="scr1-trigroompopchange">
   <refnamediv><refname>TrigRoomPopChange</refname>
    <refpurpose>Trigger when someone enters or exits a room.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomPopChange</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>PlayerRoomEnter</message></member>
      <member><message>PlayerRoomExit</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 is for room objects. It sends a <message>TurnOn</message> message anytime an AI or the <object>Player</object> enters or leaves the room.</para>
   </refsection>
  </refentry>

