  <refentry id="scr3-animlight">
   <refnamediv><refname>AnimLight</refname>
    <refpurpose>Controls animated lights.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>AnimLight</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>TurnOff</message></member>
      <member><message>Toggle</message></member>
      <member><message>Slain</message></member>
      <member><message>TweqComplete</message></member>
      <member><message>LightChange</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</flavor></member>
      <member><flavor>ParticleAttachement</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Renderer\Anim Light</property></member>
      <member><property>Renderer\Self Illumination</property></member>
      <member><property>AmbientHacked</property></member>
      <member><property>Tweq\Flicker</property></member>
      <member><property>Tweq\FlickerState</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is an alternative to <script>BaseLight</script> with features that should be familiar to <application>Thief</application> users. Along with <message>TurnOn</message> and <message>TurnOff</message>, the light can be changed with the <message>Toggle</message> message. The script also toggles the <property>AmbientHacked</property> property, and toggles any attached SFX. (You may want to use <script moreinfo="refentry">StdParticleGroup</script> as well.) The light can be configured to flicker when it is turned on or off. An <script>AnimLight</script> can also act as a trigger.</para>
    <para>This script doesn’t play any environmental schemas, though. If you want the object to play an activate or deactivate sound, you’ll need to add the <script>LightSound</script> script to the object.</para>
    <para>Some of the <property>Renderer\Anim Light</property> modes do not work, including <constant>smoothly dim</constant>, <constant>smoothly brighten</constant>, and <constant>random</constant>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-clonecontactfrob">
   <refnamediv><refname>CloneContactFrob</refname>
    <refpurpose>An object that stims the user when frobbed in inventory.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>CloneContactFrob</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>Properties</term>
     <listitem><inlinelist>
      <member><property>Engine Features\Stack Count</property></member>
      <member><property>Renderer\Has Refs</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this object is frobbed in the inventory, an invisible copy is made and used to stimulate the frobber by contact. The stack count of the visible object is then decremented. The life cycle of the stimulus source for the object should be configured to eventually destroy the object. Because the object is copied, any relevant properties should be set on the archetype.</para>
    <para>This is the script that <application>Thief</application> uses for its healing potions.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-notifyregion">
   <refnamediv><refname>NotifyRegion</refname>
    <refpurpose>Send a message when an AI dies.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>NotifyRegion</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>Obituary</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>Population</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this AI is killed, a <message>Obituary</message> property is sent along <flavor>ScriptParams</flavor> links that have the data “<userinput>Population</userinput>”. These links are usually created by a room or OBB trigger script. Without this script, the trigger will see the AI enter, but never leave.</para>
    <para>This script is normally put on the metaproperty <metaproperty>M-NotifyRegion</metaproperty>, which gets added to the AI by a trigger that needs it.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-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>
   </refsection>
  </refentry>

  <refentry id="scr3-stdparticlegroup">
   <refnamediv><refname>StdParticleGroup</refname>
    <refpurpose>Control a particle SFX.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>StdParticleGroup</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>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>This script toggles particle SFX for the object. It uses a slightly different method than the standard <script>TrapParticle</script> script. It also handles the <message>Die</message> message by destroying the object.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-traitmachinereusable">
   <refnamediv><refname>TraitMachineReusable</refname>
    <refpurpose>An upgrade machine that can be used more than once.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TraitMachineReusable</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>
      <member><message>TurnOn</message></member>
      <member><message>TurnOff</message></member>
      <member><message>Used</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Engine Features\Locked</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Schemas</term>
     <listitem><inlinelist>
      <member>“<literal>Event Activate</literal>”</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script acts like the standard <script>TraitMachine</script> script; but instead of permanently disabling the machine after use, it just locks it. The machine can then be used a second time if it becomes unlocked. The machine can be unlocked by sending a <message>TurnOn</message> message, or locked by sending <message>TurnOff</message>.</para>
    <para>The lock only prevents a player from opening the trait selection overlay. If the object has already been frobbed, and the machine receives a <message>TurnOff</message>, then a trait can still be selected.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trapaddpsi">
   <refnamediv><refname>TrapAddPsi</refname>
    <refpurpose>Gives psi points to the player.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapAddPsi</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>psi</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Increases the player’s psi points when activated, or decreases them when turned off. The <parameter>psi</parameter> parameter is the number of psi points to add.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trapcapacitor">
   <refnamediv><refname>TrapCapacitor</refname>
    <refpurpose>Relay messages with a minimum time between them.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapCapacitor</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\Delay Time</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When a capacitor sends <message>TurnOn</message>, it will block other messages from being relayed for a period of time. If a message attempts to pass through during the discharge time, then it will be queued until the timer expires. Only the most recently received message will be sent.</para>
    <para>This script is used when a device takes a significant amount of time to activate. A capacitor will prevent it from being turned off too quickly after it has been turned on.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trapconverse">
   <refnamediv><refname>TrapConverse</refname>
    <refpurpose>Start a conversation.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapConverse</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>AIConversationActor</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>AI\Conversations\Conversation</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>A conversation is an elaborate set of pseudo-scripts. They are used a lot in <application>Thief</application>, but not at all in <application>System Shock 2</application>. I can’t imagine why.</para>
    <para>A conversation can involve up to six different AI, known as actors. Create <flavor>AIConversationActor</flavor> links from the conversation trap to the actors, and set the data for each link to the actor number for that AI, starting with 1. (It’s easy to forget this, since the default value is 0.) Add the property <property>AI\Conversations\Conversation</property> to the trap and set the actions you want to occur. Each step of the conversation is a set of actions that will be taken. The next step doesn’t occur until the previous step has completed.</para>
    <para>The normal AI behavior can sometimes interfere with a conversation. It helps to add the metaproperty <metaproperty>Silent</metaproperty> to the actors in a conversation.</para>
    <para>I could say more, but I’m afraid that I might say something wrong. Conversations are damned tricky and I don’t have very good luck with them.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trapkeypad">
   <refnamediv><refname>TrapKeypad</refname>
    <refpurpose>Relay if the correct code is entered in a keypad.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapKeypad</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>KeypadDone</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>ScriptParams</flavor>(<userinput>ErrorOutput</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Script\Keypad Code</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When this trap is activated, it will prompt for a code to be entered. The correct code will cause <message>TurnOn</message> to be relayed. Entering the wrong code sends <message>TurnOn</message> along <flavor>ScriptParams</flavor> links that have the data set to “<userinput>ErrorOutput</userinput>”. Of course, the code is specified in the <property>Script\Keypad Code</property> property.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trapnanites">
   <refnamediv><refname>TrapNanites</refname>
    <refpurpose>Relay if the player has enough credits.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapNanites</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>ErrorOutput</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>nanites</parameter><type>(integer)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a relay that will add nanites to the player when turned on. Turning off the trap, or specifying a negative value for <parameter>nanites</parameter>, will deduct the amount from the player. If there aren’t enough nanites to deduct, then a message is displayed, and a <message>TurnOn</message> message is sent along <flavor>ScriptParams</flavor> links that have the data “<userinput>ErrorOutput</userinput>”. Adding nanites will always succeed. The trap can have a revert timer set and the player will only be charged once.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trappatrol">
   <refnamediv><refname>TrapPatrol</refname>
    <refpurpose>Activate a patrol route on linked AI.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapPatrol</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>SwitchLink</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 enables or disables patrolling of AI. The AI to control are linked from the trap with <flavor>SwitchLink</flavor>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-traprequireall">
   <refnamediv><refname>TrapRequireAll</refname>
    <refpurpose>Trigger if all the controllers are turned on.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapRequireAll</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>Require</userinput>)</member>
      <member><flavor>SwitchLink</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script monitors a number of triggers. When they have all been turned on, the trap relays <message>TurnOn</message>. <message>TurnOff</message> is sent if any of the triggers turns off. The triggers that have been turned on are tracked using <flavor>ScriptParams</flavor> links with the data set to “<userinput>Require</userinput>”. The triggers must all link to this trap using <flavor>SwitchLink</flavor>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-traprequireany">
   <refnamediv><refname>TrapRequireAny</refname>
    <refpurpose>Trigger if any of the controllers is turned on.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrapRequireAny</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>Require</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script monitors a number of triggers and sends <message>TurnOn</message> when at least one of them is turned on. <message>TurnOff</message> is sent when all the triggers are turned off. The triggers that have been turned on are tracked using <flavor>ScriptParams</flavor> links with the data set to “<userinput>Require</userinput>”. Unlike <script moreinfo="refentry">TrapRequireAll</script>, the triggers can communicate with this trap over links other than <flavor>SwitchLink</flavor>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-traprevert">
   <refnamediv><refname>TrapRevert</refname>
    <refpurpose>A relay that will automatically turn itself off.</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>BaseTrap</script></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This is a <link linkend="scr-traps">standard trap</link> that just relays messages. The <link linkend="scripttiming">revert timer</link> will function for <message>TurnOff</message> messages, though, as well as <message>TurnOn</message>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-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>Engine Features\Retexture Radius</property></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Parameters</term>
     <listitem><inlinelist>
      <member><parameter>terrreplaceon</parameter><type>(string)</type></member>
      <member><parameter>terrreplaceoff</parameter><type>(string)</type></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trap controls the texture of nearby terrain. Set the parameters to the path to the texture resource for when the trap is turned on and when it is turned off. 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. The default value of <property>Engine Features\Retexture Radius</property> is zero, so you must set the property for this script to function.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigaialert">
   <refnamediv><refname>TrigAIAlert</refname>
    <refpurpose>Trigger when an AI is alerted.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigAIAlert</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>Alertness</message></member>
      <member><message>TurnOn</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>When an AI goes to alert level 3, a <message>TurnOn</message> will be sent along <flavor>SwitchLink</flavor> links.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigcontained">
   <refnamediv><refname>TrigContained</refname>
    <refpurpose>Trigger when an object goes into or out of a container.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigContained</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>Contained</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This script sends <message>TurnOn</message> when an object is picked up or dropped.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigflicker">
   <refnamediv><refname>TrigFlicker</refname>
    <refpurpose>A repeating trigger.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigFlicker</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>TweqComplete</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Properties</term>
     <listitem><inlinelist>
      <member><property>Tweq\Flicker</property></member>
      <member><property>Tweq\FlickerState</property></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Flicker triggers send alternating <message>TurnOn</message> and <message>TurnOff</message> messages controlled by a flicker tweq. The tweq is turned on and off when the trap is activated or deactivated. The <property>Tweq\Flicker</property> property should be configured to <constant>Continue</constant> and have the <constant>Scripts</constant> flag turned on.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-triginvfrob">
   <refnamediv><refname>TrigInvFrob</refname>
    <refpurpose>Trigger when an object is frobbed in the inventory</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigInvFrob</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>FrobInvEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Activates when the object is frobbed while in the inventory.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigpplate">
   <refnamediv><refname>TrigPPlate</refname>
    <refpurpose>Trigger when a pressure plate is depressed.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigPPlate</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>
      <member><message>PressurePlateInactive</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</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>Pressure plates are a specialized type of terrain-like object. The object must have an OBB physics model and the property <property>Physics\Misc\Pressure Plate</property>. When sufficient weight is placed atop the object, it will move down. This script is activated by that movement. <message>TurnOn</message> is relayed along <flavor>SwitchLink</flavor> links when the pressure plate is completely lowered, and <message>TurnOff</message> is relayed when it raises up again.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigpplateimmed">
   <refnamediv><refname>TrigPPlateImmed</refname>
    <refpurpose>Trigger when a pressure plate begins moving.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigPPlateImmed</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>PressurePlateActivating</message></member>
      <member><message>PressurePlateDeactivating</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</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>This script is activated by a pressure plate object, like <script moreinfo="refentry">TrigPPlate</script>. <message>TurnOn</message> is relayed when the pressure plate begins moving down, and <message>TurnOff</message> is relayed when it begins moving upwards.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigroomcreature">
   <refnamediv><refname>TrigRoomCreature</refname>
    <refpurpose>Trigger when an AI enters a room.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomCreature</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>
      <member><message>Obituary</message></member>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>Population</userinput>)</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 trigger for rooms. It is activated when an AI enters the room. The trigger will deactivate after all AI have left the room. The AI inside the room are tracked using <flavor>ScriptParams</flavor> links that have the data set to “<userinput>Population</userinput>”. You should create a metaproperty named <metaproperty>M-NotifyRegion</metaproperty> that contains the script <script>NotifyRegion</script>. The trigger will add this metaproperty to the AI it is tracking so it can get the <message>Obituary</message> message if the AI were to be slain inside the room.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigroomdelivery">
   <refnamediv><refname>TrigRoomDelivery</refname>
    <refpurpose>Trigger when a 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 one of the players. The trigger turns off if the object is dropped, even inside a target room. The object is linked to the target rooms with <flavor>ScriptParams</flavor> links that have the data set to “<userinput>Route</userinput>”.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-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>ScriptParams</flavor> links that have the data set to “<userinput>Route</userinput>”.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-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>SwitchLink</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>Route</userinput>)</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>ScriptParams</flavor> links that have the data set to “<userinput>Route</userinput>”.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigroomplayertrans">
   <refnamediv><refname>TrigRoomPlayerTrans</refname>
    <refpurpose>Trigger when moving between two rooms.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigRoomPlayerTrans</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>
     </inlinelist></listitem>
    </varlistentry>
    <varlistentry>
     <term>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</flavor></member>
      <member><flavor>ScriptParams</flavor>(<userinput>Route</userinput>)</member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Create a <flavor>ScriptParams</flavor> link between two rooms. Give the link the data “<userinput>Route</userinput>”. When a player moves from the room that’s the source of the link into the room that’s the destination of the link, then the trigger will send <message>TurnOn</message>. Moving in the opposite direction sends <message>TurnOff</message>.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-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 moreinfo="refentry">TrigRoomCreature</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>
      <member><message>Obituary</message></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>

  <refentry id="scr3-trigunlock">
   <refnamediv><refname>TrigUnlock</refname>
    <refpurpose>Trigger when the object is locked or unlocked.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigUnlock</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>Links</term>
     <listitem><inlinelist>
      <member><flavor>SwitchLink</flavor></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>Sends a <message>TurnOn</message> message when the object is unlocked. <message>TurnOff</message> is sent when it is locked.</para>
   </refsection>
  </refentry>

  <refentry id="scr3-trigworldfrob">
   <refnamediv><refname>TrigWorldFrob</refname>
    <refpurpose>Trigger when frobbed in the world.</refpurpose>
   </refnamediv>
   <refsynopsisdiv>
    <variablelist>
    <varlistentry>
     <term>Script</term>
     <listitem><inlinelist>
      <member><script>TrigWorldFrob</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>FrobWorldEnd</message></member>
     </inlinelist></listitem>
    </varlistentry>
    </variablelist>
   </refsynopsisdiv>
   <refsection>
    <para>This trigger activates when the object is frobbed in the world.</para>
   </refsection>
  </refentry>

