There are four significantly different versions of the basic scripts. The original "convict" in Thief: The Dark Project (I describe this as "Thief 1"), the second-generation "convict" from Thief Gold, the first set of scripts from Thief 2: The Metal Age, and the version 1.18 scripts of Thief 2. "Thief 2" in this document refers only to the version 1.18 scripts. The names "convict" and "gen" refer to the modules that the scripts are usually seperated into. For historical reasons, the two modules were combined in Thief 1 and Thief Gold; the combined module being named "convict". Many of the mission-specific modules (all of them in Thief 1/G) also contain duplicates of the standard scripts. This is primarily done for technical reasons, and most duplicated scripts are not any different. This is an issue for Thief 1, however, where it is possible to use the "convict" module from Thief Gold. But they may be overridden if a mission-specific script is used. With the latest versions of DromEd, it is possible to load multiple script modules. When doing so, a script will be used from the first module it is found in, where modules are searched in the reverse order that they are entered in DromEd. (You can see the actual order by typing script_dump_files.) So when using mission-specific scripts from Thief 1/G, you should also load "convict", and be sure that it is searched first.

In the past, designers had to consider the minimum version of the game that their missions would function on, partly because of the scripts used. The most common concern being the TrapTimedRelay script of Thief 2. The consensus now is that it is reasonably acceptable to distribute copies of the original script modules for the sake of compatibility. I have seen no reports of technical problems caused by using a more recent script module with an earlier game executable. For this purpose, I collected what I believe are the most recent up-to-date copies of these scripts and have made them available for download. If you use a script that may not be available in all versions of the game, then you should include the appropriate script module with the mission.

ActivateAmbient
gen.osm 1/G/2

Receives TurnOn and TurnOff messages. The AmbientHacked property will be activated or deactivated accordingly. An ambient sound is inactive if the TurnedOff flag is set.

ActiveMine
gen.osm 1/G/2

Handles the behavior of mines. A mine is armed when a PhysFellAsleep message is received. A PhysCollision messages will cause the object to be Slain. Thief 1/G mines are also triggered by TurnOn, and will destroy any objects linked to this one with ControlDevice. In Thief 2, the mine is not armed until a PhysFellAsleep message is received. Thief 2 mines generate a PingStim stimulus which is echoed back (with a negative intensity) to the mine by creatures and the player. The script adds the meta-property MineSensePing with a receptron that will slay the object when it receives a PingStim less than 0. When a mine is unlocked, the Thief 2 script will destroy the object and create an unarmed mine in its place.

ActiveFlashMine
gen.osm 2

A derivative of ActiveMine (mutually exclusive). The response to messages (PhysFellAsleep, PhysCollision, PingStim) is similar to that of ActiveMine. Along with a Slain message, the script will create a flash SFX specified by a RenderFlash link from the object's archetype. A flash is not created when the object receives a Slain message directly. When unlocked, an unarmed flash mine is created and the active flash mine destroyed.

ActiveGasMine
gen.osm 2

A derivative of ActiveMine (mutually exclusive). This script is identical to ActiveMine except that it will create a gas mine when unlocked.

AdvPickScript
gen.osm 2

When a PickStateChange message is received, a TurnOn message will be sent along ScriptParams links with the data set to the new pick state (as an integer). TurnOff will be sent along ScriptParams links with the data set to old pick state.

Requires the use of AdvPickCfg on the lock.

AI
gen.osm 1/G/2

A root script. Listens for messages relating to AI.

AICheatScript
gen.osm 2

Handles the FailOnSee and FailOnKO cheats. If the config variable FailOnSee is set, the mission will fail if a creature sees the player. If FailOnKO is set, the mission fails if a creature is knocked out. The mission is failed by marking all visible objectives as "failed". Only the first 20 objectives are checked. This script is placed on the Creature archetype and handles the messages received by AI that trigger the cheat. Rats, Eyeball Plants, and AI on a friendly team will not fail the mission if they see the player.

AirPotion
gen.osm 1/G/2

On FrobInvEnd, restores the player's air supply to full. Inherits from EatFood

AllAIScript
gen.osm 2

On Sim start, if the AI isn't already posed, it copies the Creature\Current Pose from M-StandPose. The Creature\Current Pose property will be removed from the object. Responds to the Randomize message with a reply or "1" or "0". The first data parameter of the message should be the probability as an integer.

I really don't know if this script is actually used anywhere.

AmbientSounds
gen.osm 1/G/2

A derivative of DescribeSounds. Plays the schema as an ambient sound. Does not interfere with AmbientHacked sounds.

AnimLight
gen.osm 1/G/2

Controls the Renderer\Anim Light and AmbientHacked properties of an object. The Renderer\Self Illumination property will be set to 1.875 when the light is on. Responds to TurnOn, TurnOff, and Toggle messages. TurnOn and TurnOff are relayed along ControlDevice links. Objects linked to this one with ParticleAttachement will also receive TurnOn and TurnOff. With Tweq\Flicker, the tweq will be made active when turned on, and halted when turned off. The properties are automatically set at initialization to match the light mode.

Arrow
gen.osm 1/G/2

Manages the bow arm model and sounds, as well as cloning the projectile and subtracting it from inventory. While the bow is being drawn, the player's speed is scaled to 0.75. The arrow is non-physical while it is being drawn.

Attack
gen.osm 1/G/2

A root script. Listens for the messages that are sent when an AI is attacking.

AttackActivate
gen.osm 1/G/2

When the AI begins an attack (messages StartWindup and StartAttack), then either the weapon being used, or all objects linked to the AI with ParticleAttachement will be sent TurnOn. At the end of the attack, or when the AI is slain, TurnOff is sent. TurnOff will also be sent if AbortAttack is received.

This script is commonly used on human spellcasters, but will work with any AI that can fight. Since the generic TurnOn and TurnOff messages are used, it isn't even necessary to control particle SFX with this script.

BlackJack
gen.osm 1/G/2

This script translates the inventory and tool messages into the proper motions and sounds of the player arm for the blackjack. The object is made physical when readied (for attack or block) and made non-physical when released.

BigClockFace
gen.osm 2

A derivative of Clock. This script moves the hands of the ClockFace (-426) object. The clock face has 24 hour marks, however the hands move like a standard 12-hour clock. The initial time is determined by the Script\Timing property; set it to the number of minutes past midnight.

The hour hand of ClockFace is joint 1; the minute hand is joint 2. They can be made to act like minute and second hands by overriding the BigClockFace script and setting up a manual tweq. A rate of 0.01 for the minute hand and 0.6 for the second hand is close.

Burplauncher
gen.osm 1/G

This is on the leading edge of a cloud of burrick gas. When the object is Slain, the object that emitted it (has a Firer link to this object, usually the invisible projectile at the center of the cloud) will be Slain as well.

Actually, I think it looks better with this script disabled. Although the gas tends to build-up more.

CameraAlert
gen.osm 2

The different alert states of a camera are determined by a model tweq. On Alertness, the Shape\Model Name will be set to the appropriate value from Tweq\Models, unless the object has the meta-property M-AI-Stasis. TurnOn and TurnOff messages are sent along ControlDevice links when entering or leaving full alert. A TurnOff message is relayed when Slain. A mysterious CUSIC message is also sent. On TurnOff, the meta-property M-AI-Stasis is added to the object, the property AI\State\Current mode is set to Asleep, and AI\State\Current alertness is set to High. Any AIAwareness links are also deleted. On TurnOn, the mode is set to Normal and M-AI-Stasis is removed.

This script has a bug. While a camera is at full alert, it is supposed to check every 2 seconds if the time since last contact, as specified by AIAwareness links, is greater than the time in Script\Timing, and remove the link if it is. However, instead of checking every 2 seconds, the Timer is set for the number of seconds as the object ID.

CameraAlert2
gen.osm 2

A derivative of CameraAlert. This script will not trigger any messages when the object is Slain.

CamGrenade
gen.osm 2

Activates when the object has stopped moving. (The PhysFellAsleep message. Also uses a timer to measure velocity.) Stims the object that emitted it, which only has an effect when it is the player. When the remote camera is activated or deactivated, a flash SFX is created, specified by a RenderFlash link from the archetype of the player.

CamReturn
gen.osm 2

Causes the remote camera to be returned in response to a Damage message.

CleanUpAttack
gen.osm 2

The companion to AttackActivate. This script sends AbortAttack when the AI mode changes to Dead.

AttackActivate can handle Slain, so this script is required for dealing with knockouts.

Clock
gen.osm 2

Moves the hands of the CuckooClock (-2873) object. The initial time can be set using the Script\Timing property. As the clock runs, the property will be updated with the current time. When frobbed, the hour hand will be advanced one hour, and the minute hand set to zero.

The pendulum of the CuckooClock is joint 3 and can be tweqed. The hour hand is joint 4, and the minute hand is joint 5.

CloneContactDmg
gen.osm 1/G/2

When damaged by a VenomStim, clones the culprit and initiates AR contact between the cloned object and this one.

CloneContactFrob
gen.osm 1/G/2

On FrobInvEnd, clones the object and initiates AR contact between the cloned object and the frobber. The cloned object is created from the archetype, so properties on the concrete object won't be carried over.

CollapseFloor
gen.osm 1/G

On PressurePlateActive, the object is Slain, causing it to never reverse direction and thus fall down (or in whichever direction the object is oriented) forever, including through solid space.

Water will slow down the pressure plate, although the velocity still remains locked. If the speed is low enough, it will cause the object to float in the water.

The peculiar behavior when slain is unique to Thief 1.

CollisionStick
gen.osm 1/G/2

On PhysCollision, determines if the object is able to attach to the material. If not, slay the object. If it can attach, the object is made non-physical until it is picked up. If the object doesn't yet have a stack count, it is given a count of 1, just in case. A timer of 30 seconds, or 150 seconds if the Player is culpable for the arrow, will destroy objects that have been sticking around for too long. Objects are not destroyed while they are still in view. If the arrow has the Script\Timing property, it is the probability that the arrow will stick.

Two objects can attach if they have a flag in Physics\Terrain\Can Attach in common, and neither is a door or moving terrain.

Container
gen.osm 1/G/2

On FrobWorldEnd, transfers the contained objects to the player and activates tweqs. Plays schemas appropriate for doors. Sends TurnOn messages along its ControlDevice links. Always opens when LockCheat of Thief 2 is being used.

ContainWaterProp
gen.osm 2

Propogates a WaterStim to its container.

ControlWindowShade
gen.osm 1/G

A variation of WindowShade. The script will randomly turn on or off the light, checking sometime within the first 15 seconds of Sim time, then repeatedly between 5 to 15 seconds afterwards. The Script\Timing property specifies the probability that the light will be turned on (or remain on) when the script checks; the default is 32. The light stops changing when the object is Slain.

ConveyorBelt
gen.osm 2

Responds to PhysContactCreate and PhysContactDestroy. Calculates the correct velocity for the colliding object based on its orientation and the Physics\Model\ConveyorVelocity of the script object. If the colliding object is Player, a Physics\Model\ConveyorVelocity property is added to it; otherwise the Velocity control of Physics\Model\Controls is set. The property or control is removed when contact ends.

Corpsed
gen.osm 1/G/2

When an Avatar picks up the object, the player arm is revealed and the property Creature\Is Non-Physical is set on the object. When dropped, and the object doesn't have the meta-property M-KnockedOut, then the Remove On Sleep flag of Physics\Model\Type is set. On BeginScript, the Game\Damage Model\Death Stage property will be deleted if it equals 0.

Allows the body to be dropped in Thief 1/G. In Thief 1/G, the functionality of the Lugged script is incorporated into Corpsed.

CorpseFrobHack
gen.osm 1/G/2

Keeps AIs unfrobbable until they are killed or knocked-out. When Slain, the M-KnockedOut metaproperty is removed, and the Remove On Sleep flag of Physics\Model\Type is turned on. Also manages the auto-search option of Thief 2.

Crystal
gen.osm 1/G/2

When the object is contained by the player, this script creates an arrow (or multiple arrows, depending on Engine Features\Stack Count) in its place and destroys the object.

The transmogrification is hard-coded. EarthCrystal:EarthArrow, WaterCrystal:water, FireCrystal:firearr, AirCrystal:GasArrow.

DeathSentence
gen.osm 1/G/2

When created, the object is killed after a period of time. The maximum time to live is set by the Tweq\FlickerState property's Frame #. The Script\Timing determines the speed with which the timer will count down. Larger values increase the likelihood that the object will be slain. The actual time is randomized. The object will live for at least 1 second.

Thief uses this for bloodstains that automatically evaporate. The standard setup has the Script\Timing twice as large as the Frame #.

DeployRope
gen.osm 1/G/2

A derivative of CollisionStick. When the object is attached, a RopeArrowRope is created. There is an Owns link from the arrow to the created object. On FrobWorldEnd, the rope is destroyed. The object does not automatically destroy itself. Deployed ropes are made explicitly suspicious in Thief 2.

DeployVine
gen.osm 2

Like DeployRope but creates a VineArrowVine and VineClump.

DescribeSounds
gen.osm 1/G/2

Plays all schemas linked from it with SoundDescription when turned on.

Other scripts derive from this by playing the schema in different ways: AmbientSounds and VOSounds. I doubt you want to use more than one at a time.

DiffSpoof
gen.osm 2

When created, gets the current difficulty and adds one of M-GarrettDiffNormal, M-GarrettDiffHard, or M-GarrettDiffExpert to the object, then sets Dark Gamesys\Air Supply appropriately.

DoFlameSource
gen.osm 1/G/2

Adds the meta-property FlameHeatSource. Removes the meta-property in response to Slain.

Adding this script to a creature is a fun way to really ruin his day. Objects emitted by Tweq\Emit will not activate this script.

Door
gen.osm 1/G/2

A root script. Listens for messages related to doors.

DoubleButton
gen.osm 2

A derivative of StdLever. Manages objects with two joints. When joint 1 is on, joint 2 is off; and vice-versa. The lever is toggled when an inanimate object collides with it.

EatFood
gen.osm 1/G/2

On FrobInvEnd, plays an environmental schema with the Event Activate tag. If the object was frobbed by the player, the schema is played with the ambient option.

Elemental
gen.osm 1/G

Manipulates the Shape\Scale property proportionately to the health of the object. When Slain, the Tweq\Scale property is activated so that the object will shrink down from its current size.

ElevatorSounds
gen.osm 1/G/2

Manages the sounds that elevators make. The schemas are played with the Event tag ActiveLoop or Deactivate

Strange that LGS didn't include Event Activate.

Extinguishable
gen.osm 1/G/2

A derivative of AnimLight. Manages a model tweq that is active when the light is on, and halts at Model 5 when turned off. Makes the object suspicious or not accordingly. Responds to WaterStim and KOGas by turning off the light. FireStim will turn the light on.

FireElement
gen.osm 1/G

A variation of Elemental. As AI\State\Current alertness changes, Renderer\Extra Light, Renderer\Transparency, and Renderer\Self Lit are modified accordingly. If the alert level is greater than 2, the meta-property BigHeatSource is added to the object. One of the messages Mood0, Mood1, Mood2, or Mood3 is sent to all objects that link to this one with ParticleAttachement. On Damage with a WaterStim, a SteamPuff object is created; otherwise, a FElemHit object is created.

FireElemSparx
gen.osm 1/G

Modifies the red field of the SFX\Particles property. The messages Mood0, Mood1, Mood2, and Mood3 will set the property to 185, 187, 187, and 122 respectively. Derives from StdParticleGroup.

SFX\Particles does not, however, actually have a field named red, so this script doesn't do squat. (Except respond to TurnOn and TurnOff like its parent.) If it did, the colors would correspond to #E71821, #FF8C18, and #FFB510.

FireShadowEcology
gen.osm G

When a flicker tweq fires, and the object is not currently visible, a FireShadow object is created at this location. A new object will not be spawned if the old one still exists.

FireShadowFree
gen.osm G

On Slain, a FireCrystalPhys is created at this location. The AI is made non-hostile and given a time warp of 1.8125. The speed will be gradually increased by 17.65% until the AI disappears from view, or after 15 seconds. Then it is destroyed.

FlashBomb
gen.osm 1/G/2

Triggers a world flash on PhysCollision. The flash parameters are linked from the object's archytype with RenderFlash. AI that are looking at the object will be stunned, even if there is no RenderFlash link.

FlashMine
gen.osm 2

A derivative of Mine. Creates an ActiveFlashMine.

FrobFind
gen.osm 2

On an object with Hidden flag of Dark GameSys\Stats set, counts a secret as being found when it receives FrobWorldEnd.

FrobSounds
gen.osm G/2

Plays an environmental schema from an object with the tag Event Activate. Responds to FrobWorldEnd.

FrobSlay
gen.osm 1/G/2

On FrobWorldEnd, slays the object. The frobber is the culprit.

GasLight
gen.osm 2

A derivative of Extinguishable. Turns the light off when it receives FrobWorldEnd. When the light is on, the meta-property FrobInert is added to the object.

GasMine
gen.osm 1/G/2

Derivative of Mine. Creates an ActiveGasMine.

Glyph
gen.osm 1/G/2

A derivative of TrigOBB. When triggered, the Engine Features\Stack Count is checked and, if greater than zero, the glyph is activated and the stack count decremented. All the tweqs are activated and when any one of them halts, all the other tweqs are halted as well. Shape\Scale is reset to (1,1,1) also. On TweqComplete, the object is destroyed if there are no shots left, or if there are no ControlDevice links from the object.

GoMissing
gen.osm 1/G/2

Responds to FrobWorldEnd. The first time the object is moved, a MissingLoot object is created in its place. In Thief 2, the new object is explicitly made suspicious with the type missingloot.

Gong
gen.osm 1/G/2

When the gong is rung, plays the Event Activate schema tag. A gong_ring signal is sent to the AI that have an Owns link to this object. The gong will ring in response to FrobWorldEnd, PhysCollision (with submodel 1 or 4, and not with an Avatar or a Creature), or TurnOn.

HolyFont
gen.osm 1/G/2

On FrobWorldEnd, sends the Sanctify message to the frobber, and plays a schema with Event Activate.

HolyH2O
gen.osm 1/G/2

On FrobInvEnd, looks for objects that inherit from water in the frobber's inventory. If found, sends the Sanctify message to the frobber. This script inherits from EatFood, so it also plays the Event Activate schema.

HotPlate
gen.osm G

Translates PhysContactCreate and PhysContactDestroy messages into stimulus contact with this object as the source. When stimmed with WaterStimStimulus, the meta-property HotPlateHeat is removed from the object, and a copy of the object that links to this one with ControlDevice is cloned. The new object is linked to this one using Owns and the speed of its Tweq\Joints is doubled. The Script\Timing property of the new object is set to 0. The ControlDevice link from the previously existing object is removed, and a new link created from the new object. An Owns link is added from the old object to this one. A counter on this object is set to 2, or the value of Script\Timing if it exists. The counter is decremented when the object receives TurnOn. When the counter reaches zero, any Owns links from the source of the message are removed, and a ControlDevice link is created.

HotPlateControl
gen.osm G

The script is triggered by a flicker tweq. On TweqComplete, the Renderer\Extra Light property of all objects linked from this object with ControlDevice will be set to the Joint 1 field of Shape\Joint Positions on this object. If the value is greater than 0, the meta-property HotPlateHeat is added to the linked objects; otherwise it is removed. When the join tweq begins moving forward after having been in reverse, then a TurnOn message is sent to all objects linked with Owns. If the property Script\Timing exists and is greater than zero, then the script will subtract one from the value. The object is destroyed when Script\Timing equals zero.

IllumeBearer
gen.osm G/2

Illuminates the container of the object. The container is lit when the object is added to the container. The effect is reversed when the object is removed, or Slain. The container is illuminated by copying the Renderer\Dynamic Light and Renderer\LightColor properties from this object. In Thief 2, if the M-Invisible meta-property is set, then the Light rating and Level of AI\State\Current visibility are set to the value of Renderer\Dynamic Light, and a Visible message is sent to the container. To un-illuminate the container, the Renderer\Dynamic Light and Renderer\LightColor properties are removed; Thief 2 sends an Invisible message to the container.

InstantiateSuspicious
gen.osm 2

Make sure that the Engine Features\Suspicious property is on the concrete object. Activates on BeginScript.

Instrument
gen.osm 2

On FrobWorldEnd or FrobInvEnd, plays a schema with the tag Event Activate.

Invisible
gen.osm 2

Listens for the message Invisible. Sets all the ratings of AI\State\Current visibility to 0, and removes all AIAttack links to the object.

InvisiPotion
gen.osm 2

A derivative of TimedPotion. Activates when frobbed by a type of Avatar. The meta-property M-Invisible is added to the frobber, Renderer\Invisible is set to -1, and the field Last update time of AI\State\Current visibility is set ahead the duration of the potion. The message Invisible will be sent to the frobber. The potion deactivates by setting Renderer\Invisible to 0, removing the meta-property M-Invisible, and sending Visible to the frobber. Last update time of AI\State\Current visibility is set to the current time.

JAccuse
gen.osm 1/G/2

When Slain, if the Player is the culprit, has a CulpableFor link to the culprit, or has a CulpableFor link to this object, then J'Accuse will be sent to the Player.

JumperSwitch
gen.osm 1/G/2

A variation of StdLever. TurnOn is sent when the joint tweq reaches the on state, and TurnOff is sent when it leaves that state.

JunkWebs
gen.osm 1/G/2

When Contained by the Player, reduces the player's speed depending on the Engine Features\Stack Count of the object. On FrobInvEnd, the speed control is removed if Engine Features\Stack Count is 0. Otherwise, the meta-property FrobInert is added and will be removed 500 milliseconds later. The amount the player's speed is reduced is recalculated on each frob. The speed is scaled by 0.76 for 1 item, and down (in increments of 0.04) to 0.0 for 20 or more. In Thief Gold, AR contact is established when the object is Contained, and released when Engine Features\Stack Count reaches 0.

Obviously, something else has to actually decrement Engine Features\Stack Count. This is handled by setting the Use Ammo flag of Engine Features\FrobInfo.

LastMissionLoot
gen.osm 2

Activates on Difficulty. Sets the Gold field of Dark Gamesys\Loot to the value of the total_loot quest variable. The Gems and Art values are set to 0. Does nothing if the quest variable is 0.

To get the Difficulty message you need to set the appropriate flags in Difficulty\Script.

Legible
gen.osm 1/G/2

The base script for readable objects. You need to use one of the derived scripts to get it to do anything. First checks for the Book\Text property and aborts if it isn't found. If Book\Art is set, it enters book-mode with the text and art resources specified. Without Book\Art, it loads the string Page_0 from the text and displays it on-screen. In Thief 2, if Trap\Quest Var is set, it appends the value of the quest variable to the Book\Text. ("Book" will become "Book00", for example.)

Just the name of the quest variable is written in Trap\Quest Var. The syntax of QVarTrapTrigBase doesn't apply.

LeverNoChain
gen.osm 2

Like StdLever, but sends ToggleNoSE along ControlDevice links, instead of TurnOn. The features of StdController are not used.

LightFlare
gen.osm G/2

On FrobInvEnd, creates a LitFlare and adds a Contains link from the frobber to the new object.

LoadoutBox
gen.osm 1/G/2

Activates on Sim start. The script looks for a Contains link to this object. If it exists, it will move all the objects contained by this one into the beneficiary. After transfering the items, the script object is destroyed. Does nothing if there is no beneficiary.

LoadoutCache
gen.osm 1/G/2

Inherits from LoadoutBox. Activates on Sim the same way, but determines which object will receive the items differently. First checks for a Contains link to the object. Then it will look for an object named Player. Finally, it will try to find an object that has a PlayerFactory link to the object named Garrett.

This is the preferred script to use. You do not need to create any links.

Lock
gen.osm 1/G/2

Toggles the Engine Features\Locked property. TurnOn or Lock turns it on. TurnOff or Unlock turns it off. Does nothing if the property doesn't exist.

LockPick
gen.osm 1/G/2

Translates the inventory and tool messages to make lock picks work.

LockSounds
gen.osm 1/G/2

Plays an environmental schema when the lock state changes. On NowLocked, the event tags Event StateChange, LockState Locked are used. On NowUnlocked, the tags are Event StateChange, LockState Unlocked. If the object had recently received the PlayerToolFrob message, then the tag CreatureType Player is added to the list. On FrobWorldEnd, the tags Event Reject, Operation FrobLock is played. When the object receives WrongKey, it plays the tags Event Reject, Operation KeyFit, but without considering whether it was frobbed by the player.

LoGravPotion
gen.osm 2

A derivative of TimedPotion. Only works when frobbed by a type of Avatar. When activated, the player's gravity is set to 0.5 and a speed multiplier of 0.5 (named LoGrav) is added. The vertical velocity at that moment is also divided in half. When deactivated, the speed multiplier is removed and the gravity set to normal.

LootSounds
gen.osm 1/G/2

When Contained by Player while the sim is running, an ambient schema will be played. If the object inherits from IsLoot, the schema is pickup_loot; otherwise it is pickup_power.

Lugged
gen.osm 2

Responds to being Contained by an Avatar. When picked up, the ambient schema garlift is played and the player's speed is slowed by 0.6. When dropped, the ambient schema gardrop is played and the speed control is removed.

MapSupplement
gen.osm G/2

Activates on FrobInvEnd. Sets the quest variable map_max_page to the value of the Page field of Room\Automap. The automap is then displayed. In Thief 2, the variable is only changed if it is less than the property. Does nothing if there is no Room\Automap property.

Mine
gen.osm 1/G/2

Creates an ActiveMine in place of the object when it is armed. A mine is armed when it receives PhysFellAsleep and there is a CulpableFor link to the object. The environmental schema with tag Event Activate or, in Thief 1/G, the schema named mine_arming, is played first. The mine will be created when the schema finishes playing, or after 6 seconds. The arming sequence will be aborted if the mine is frobbed. In Thief 1/G, a MineBounds object is also created and is linked to the ActiveMine with ControlDevice.

ModelByCount
gen.osm G

Sets Shape\Model Name to one of the Model n fields of Tweq\Models based on the value of Engine Features\Stack Count. The model number is one less than the stack count. Model 0 is used if the count is 1 or less, and Model 5 is used if it is 6 or more. The model is updated when the object is Contained.

MossLump
gen.osm 1/G/2

On PhysFellAsleep, creates a Mosslauncher at this location and activates the emitter tweq on it. The Tweq\Emit and Tweq\EmitterState properties of this object will be copied to the new one. The Remove On Sleep flag of Physics\Model\Type for this object will be set, and its velocity will be set to (0,0,-2). Thief 1/G creates the object on PhysMadeNonPhysical and does not manipulate the tweq or properties.

MossSpore
gen.osm 1/G/2

On PhysCollision, if the collision is not with the ground (normal vector is vertical and positive), then the Game\Damage Model\Slay Result property is set to Destroy. The script replies with "3".

MovingTerrain
gen.osm 1/G/2

A root script. Listens for MovingTerrainWaypoint.

NonAutoDoor
gen.osm 2

A child of StdDoor. When the door is locked or unlocked, it does not automatically close or open.

NoPingBack
gen.osm 2

Adds the meta-property NoPingBack when it receives an AIModeChange to mode 5 (Dead).

NoticesPlayerBumps
gen.osm 2

On PhysCollision with the Player object, the Min level of AI\AI Core\Alertness cap will be set to 2, unless AI\State\Current alertness is already higher than 2. The cap will be removed 1 second later.

NotifyRegion
gen.osm 1/G/2

When the object is Slain, will send the message Obituary to objects that have a Population link to the object.

NoTweqElevator
gen.osm G

Controls a moving terrain object like StdElevator, but does not use the joint tweq.

NumberButton
gen.osm 2

A derivative StdButton. In addition to the normal behavior, the script will set the quest variable specified in Trap\Quest Var. A single decimal digit is put in the least-significant position of the variable, up to 8 digits. The digit is determined from the Shape\TxtRepl r0 property. The script looks for the first digit that is in the last path component of the texture name. That is, everything up until the last slash (forward: "/", or backward: "\") is discarded. Then the first character between "0" and "9" is the digit that will be added. If no digit could be found, the variable is unchanged.

Odometer
gen.osm 2

Controls the joints of the Odometer object. The object has four joint tweqs corresponding to four decimal digits. The joints will be tweqed to match the value of the quest variable specified in Trap\Quest Var. Each joint is tweqed individually, from 1 to 4. When the script receives TweqComplete, a schema is played and the next joint is tweqed. If the number displayed is a valid code for the device, the schema object digisuc is played; otherwise, it is the object digiclk. Valid codes are specified by a ScriptParams link with data CodeRelay to exactly one "code relay" object. The code relay has ScriptParams links with data CodeRelay to any number of objects that have a Trap\Quest Var property in the format of TrigQVar. The name of the quest variable in the target Trap\Quest Var property must match the variable that the odometer looks for, and the number must be exactly four digits. The objects do not necessarily have to be triggers.

The operator of a quest variable trigger is ignored and it will play digisuc even if the trigger would be off. It also only considers the four least-significant digits of the quest variable. The "digit-match" operator (") for TrigQVar makes the trigger behave the same way as the odometer.

OnOffSounds
gen.osm 1/G/2

On TurnOn, plays the environmental schema with tag Event Activate. On TurnOff, plays the tag Event Deactivate. When the Event Activate schema finishes, the schema tag Event ActiveLoop is played. Other schemas are halted before activating or deactivating. The active loop schema will not play unless bit 2 of Script\Timing is set. If Script\Timing has either of bits 1 or 2 set, then the activate and deactivate schemas will not play until the opposite one has been played.

OutDamnSpot
gen.osm 1/G/2

On Slain, will clean up any blood within a radius of 5 feet from the object. Objects within the radius that have Prox\Blood set are Slain.

OverheadDoor
gen.osm 2

A derivative of StdElevator. A rotate tweq is activated when the object moves to the lowest or highest terrain point. As well, the sound and vision blocking of the door is disabled. On MovingTerrainWaypoint or TweqComplete, checks the position of the object and will enable the blocking if it is down and not moving or rotating.

This script was not used in Thief 2. The warehouse doors use the regular StdDoor script. The Call message should not be used, as it will not activate the rotate tweq. The only parts of the Door\ property used are the fields related to sound and vision blocking.

PathElevator
gen.osm 2

A variation of StdElevator. When it receives Call, it will move along the terrain path in the direction of the object that sent the message. Is otherwise the same as StdElevator.

I'm having a bit of trouble getting this to work correctly, so I'm not sure if this is indeed what the script is really trying.

Phantom
gen.osm 2

When the script receives PhantomBegin, it looks for a Route link from the object and will teleport the object to the destination of the link. If there are no Route links, it gets the teleport destination from the AI\State\Idling: Origin property. The Renderer\Has Refs property is turned on, and Renderer\Transparency is set to 0. A Timer named In is started. When the message is PhantomEnd, any schemas on the object are halted and a Timer named Out is started. When fading in, Renderer\Transparency will be increased by 0.05 until it reaches 0.5. When fading out, it will be reduced until it reaches 0, then Renderer\Has Refs will be turned off.

PhysARContact
gen.osm 2

Translates PhysContactCreate and PhysContactDestroy messages into stimulus contact with this object as the source.

Ref. HotPlate.

PlayerCheatScript
gen.osm 2

Handles the FailOnKill cheat. If the config variable FailOnKill is set, then this script will mark all visible objectives as "failed" when it receives J'Accuse. Only the first 20 objectives are recognized.

PlayNoisemaker
gen.osm 1/G/2

Plays the schema noisemaker in response to PhysCollision. On PhysMadeNonPhysical, the emitter tweq on the object is halted. The schema will be halted in response to Container or EndScript. In Thief 2, the AI\Utility\Sound value of the noisemaker schema is modified to signal "noisemaker<id>" with this object's ID.

QuaffHeal
gen.osm 1/G/2

Allows an AI to use healing potions. On AIModeChange or, in Thief 2, on Damage, the script pauses (to allow the damage reactions to be played), then checks if the hit points are less than maximum. If so, it looks for a Contains link to a type of HealingPotion where the link data is Belt or Alternate. If found, the motion schema BH214113 (Thief 1/G) or humgulp (Thief 2) is played, and when it finishes the healing potion will be frobbed by the AI. In Thief 2, when the motion schema is played, one of the meta-properties M-LeftHandAlt or M-LeftHandBelt, as appropriate for the link, is added to the AI. It is removed once the motion finishes. The message IgnorePotion will prevent the AI from trying to use the healing potion in Thief 2; the setting is permanent.

The standard healing potion "damages" the frobber by -1 point at a time. This message will trigger the script to frob another healing potion, if available, which sends another Damage message, etc... If you want to give an AI more than one healing potion, you should create a specialized archetype that heals the frobber all at once. Otherwise, the AI will stand there gulping down potions one at a time until it reaches full health. You could modify BeltHealingPotion which is also designed to fit correctly on the typical AI's belt and hand.

QVarTrapTrigBase
gen.osm G/2

The base for TrapSetQVar and TrigQVar. Does nothing by itself.

Quest variable operations are specified in Trap\Quest Var. These scripts expect the property to contain an operation, followed by a numerical argument, then a colon, and then the name of the quest variable. See QVar Script Options for a detailed description of these operations.

RainSound
gen.osm 2

Sets or clears the TurnedOff flag of AmbientHacked based on whether the render_weather config variable is set. Activates on Sim and DarkGameModeChange.

ReactsNoisemakers
gen.osm 2

Makes an AI go to the source of a noisemaker signal. Signals from noisemaker arrows begin with "noisemaker" and have the object ID of the arrow at the end. When this script receives SignalAI from a noisemaker, it will go to the location that the arrow is at when the signal is received. Any further noisemaker signals from the same object id will be ignored until another noisemaker arrow sends a signal.

ReGravitize
gen.osm 2

On PhysCollision, sets the field Gravity % of Physics\Model\Attributes to 3.2578125.

ReloadTweqEmit
gen.osm 1/G/2

On TweqComplete, resets the Frame # and Cur Time of Tweq\EmitterState so the emitter can be activated again. Does nothing if the object doesn't have Tweq\Emit.

The frame is set to 0. The current time is set to one less than the tweq rate.

RoboSteam
gen.osm 2

Turns on and off a RoboSteam particle SFX that links to the object with ParticleAttachement. When a flicker tweq fires, the SFX is activated and is deactivated after the time specified in Script\Timing. When the AI is alerted, the flicker tweq rate will be set to 2000.

RobotSlayScript
gen.osm 2

When the AI mode changes to Dead, the object will be slain if Game\Damage Model\Hit Points is greater than 0.

An AI that is knocked-out is in "dead" mode, but has positive hit points.

RopeFX
gen.osm 1/G/2

On FrobWorldEnd, looks for an object with an Owns link to this one, and adds it to the frobber's inventory, then slays itself. When Slain, a particle SFX the size of the rope is created in its place. In Thief 2, if the Shape\Model Name of the object isropevine, then the object created is ExVine; otherwise, it is ExRope. The number of particles in the SFX will be multiplied by the length of the rope.

RootScript
gen.osm 1/G/2

The primary root script. All scripts derive from this. There is actually another script above this one, called EngineRootScript, but it isn't seen by the script manager. The other root scripts are immediate descendants of this one. The root scripts do nothing on their own. They are distinguished by the types of messages they expect to receive. Any script can receive any message, not just those the root script specially looks for. These scripts exist only as a convenience for the script writers. This script listens for general-purpose messages.

Roulette
gen.osm G/2

On FrobWorldEnd, sets the first joint tweq on the object to turn completely at a speed of 60. It activates the joint tweq and a flicker tweq. A schema is played with the tag Event Activate. TurnOn is sent to all ControlDevice linked objects. If the object is frobbed while the tweqs are active, it stops them. When the wheel stops, the tweqs are halted and TurnOff is sent along ControlDevice links. On TweqComplete from the flicker tweq, it slows down the speed of the joint tweq proportionately to the length of the schema wheel_spin, which is about 10 seconds. The faster the flicker tweq, the smoother the deceleration will be. When the speed of the tweq slows to a rate below 0.0078125, it is automatically halted.

Without the flicker tweq, the joint tweq will not be automatically halted. Also if the flicker tweq halts early, the joint tweq will continue until it is frobbed again.

Sanctifier
gen.osm 1/G/2

On Sanctify, a countdown of 30 seconds is begun. If the object contains a type of water, then that object gets the meta-property ArrowIsHoly added to it, and it will become the active weapon. The Inventory\Object Name of the arrow is modified to display the number of seconds remaining in the countdown. It is updated every second. When the countdown reaches 0, the meta-property ArrowIsHoly is removed from the arrow, and its name is reset.

SecretSounds
gen.osm 2

Notifies the player when a secret has been found. Listens for QuestChange messages with the quest variable DrSSecrets. When the quest variable increases, the player will be notified. The script displays the string labelled FoundSecret from the file PlayHint.str and plays the ambient schema new_obj. If the config variable goal_notify is not set, the player is not notified. When a Popup message is received, the script will prevent notifications from being displayed for 3 seconds. If a QuestChange occurs during this time, it will be delayed for 3 seconds. If the value of the quest change decreases, the script won't make any notifications until it returns to its previously maximum value.

SecureDoor
gen.osm 1/G

When the door is opened or halted, AIWatchObj links will be created from all Human type objects to this object. The links are removed when the door is closed. The door is assumed closed to begin with.

SecurityDoor
gen.osm 2

A SecurityDoor keeps track of its initial state and sets the Engine Features\Suspicious property when it changes. When the door is open, the flag is turned on unless the door began in the open state. When it is closed, the flag will be set unless the door began closed. Nothing happens if the door is in a transition state (opening or closing), or if it is halted. If the door begins in a transitional state, the initial state will be considered the final result of the transition. The Engine Features\Suspicious property must already exist on the object for the script to work.

If you want a door to start-off as open, you need to add the Difficulty\Close (Open) Door property. If the difficulty flag is turned on, then the door will be closed; it will be open if the flag is cleared. Trying to change the door state manually won't work.

ShutUpYerDead
gen.osm 2

This is what prints "Snapping awareness links..." to the monolog. On BeginScript, the script will clear the Flags field of all AIAwareness links from the object, and it sends the message IgnorePotion to itself.

SlayFind
gen.osm 2

On Slain, indicate that a secret has been found if the property Dark GameSys\Stats has the Hidden flag set.

SlayHaltSpeech
gen.osm 2

Halts speech in response to Slain.

SlayHush
gen.osm G

Halts speech in response to Slain.

SpeedPotion
gen.osm 1/G/2

Derives from EatFood in Thief 1/G and TimedPotion in Thief 2. When activated by an Avatar, the player's speed will be multiplied by 1.75. The multiplier is removed when deactivated. Thief 2 uses a multiplier named Speedy. Thief 1/G will add the meta-property M-SpeedyPlayer and send the message Speedy to the frobber.

SpeedyPlayer
gen.osm 1/G

Multiplies the player's speed by 1.75 when the message Speedy is received. The multiplier will be removed 8.6 seconds later, as well as the meta-property M-SpeedyPlayer. The delay is reset each time the message is received.

StdBook
gen.osm 1/G/2

Derivation of Legible. Responds to FrobWorldEnd.

StdButton
gen.osm 1/G/2

Inherits from StdController. When a button is pushed, along with sending TurnOn, it plays a schema with the event tag Event Activate and activates the joint tweq. The button is activated on FrobWorldEnd or on PhysCollision on submodel 4 with an object except for a Creature or Avatar.

StdController
gen.osm 1/G/2

A base script for button and lever types of objects. In Thief 2, this script manages the Script\Trap Control Flags, and marking a secret as found if the object has the Hidden flag of Dark Gameys\Stats set.

StdDoor
gen.osm 1/G/2

The door is opened by the messages TurnOn or Open. It is closed with TurnOff or Close. It is also operates in response to FrobWorldEnd. Frobbing normally toggles the state of the door. In Thief 2, if the door had previously been halted, frobbing it will reverse the action it was engaged in before the halt. The door states are closed, open, closing, opening, and halted. A door that is locked and closed cannot be opened by FrobWorldEnd. Instead, it plays an environmental schema with the event tags Event Reject, Operation OpenDoor. The lock is disregarded when the door opens any other way. The lock will also be disregarded if the config variable LockCheat is set (only in Thief 2). When a door is locked, it will close itself. Unlocking a door also opens it. Doors cannot be killed. When Slain, the door will be resurrected with 1 hit point. Any Lock links from the door are removed, and the Engine Features\Locked and Engine Features\KeyDst properties are removed. The Engine Features\Locked property is set to 0 before being removed, so the door will receive a NowUnlocked message. The door opens with it is slain. In Thief 2, if the door has the Script\Timing property, it will automatically close itself that many milliseconds after it is opened. The timer aborts if the door begins to close. When the door state changes, an environmental schema is played with the event tags Event StateChange, OpenState <state>, OldOpenState ><state>. Previous schemas are halted if the state is closed or open. If the door had recently been frobbed by the player, with FrobWorldEnd or PlayerToolFrob, the tag CreatureType Player is added to the list. The flag that determines whether to add the tag is cleared when the door state is closed, open, or halted. When the door is opened, it will set a secret as being found if it is marked as Hidden in Dark Gamesys\Stats. Two or more doors can be combined into a set of "double" doors by creating ScriptParams links between the doors and setting the link data to Double. There must be at least one link between any two doors in a group. More than one link between two doors is unnecessary, but harmless. The doors will keep in synch for most state changes. A halted door will not cause the linked doors to halt. If the linked doors are meant to be locked, they should all have the Engine Features\Locked property (or a Lock link). A door without the property will not synch properly with the others. (This is because it might have been Slain and lost the property that way.) Doors keep in synch by sending the SynchUp message from the door that had its state changed to each door it has a link with. When a double door spans an opening, it can cause AI to get stuck between them. The AI tries to frob both doors, which makes them start to open, then immediately close. Thief 2 solves this by creating a marker with the property AI\Utility\Path avoid on it. The marker is placed at the midpoint between two doors, but only if the doors share a room boundary, and are touching (or close to) at the midpoint. The marker will be created for pairs of doors with a ScriptParams link between them, regardless of whether the data is set to Double. So you can take advantage of the feature without having to synchronize the doors.

Keep in mind that link data is case-sensitive. It's "Double" not "double". And why is it that these descriptions keep getting longer and longer the more of them I do?

StdElevator
gen.osm 1/G/2

Activates and deactivates moving terrain objects. Listens for TurnOn and TurnOff and will move to the lowest or highest point (respectively) in the terrain path. A Call message will move the elevator directly to the object that sent the message. A joint tweq is activated while the elevator is moving. In Thief 2, the Script\Trap Control Flags are respected. (Except for Once.) When the elevator begins to move, it sends the message Starting to itself.

The script searches for the highest or lowest point by following forward TPath links. To make TurnOn and TurnOff work, you should link the terrain points in a loop. The object that sends Call must be in the terrain path of the elevator.

StdGauge
gen.osm 1/G/2

A variation of StdLever. Manipulates the joint 1 settings of Tweq\Joints. Does nothing by itself.

StdKey
gen.osm 1/G/2

On FrobToolEnd, an attempt is made to lock or unlock the frobbed object. If the operation was successful, the key is Slain. Otherwise, the message Wrongkey with the object ID of the key as the first data parameter is sent to the object that was frobbed. If it was unsuccessful, but the frobbed object is a door that does not have the Engine Features\Locked property, then the operation is considered a success and the door is opened. If the frobber was Player, the message PlayerToolFrob is sent to the object that was frobbed and the quest variable tr_UseKeyLock or tr_UseKeyUnlock (as appropriate) is set. When the object is Contained by an Avatar, an environmental schema is played with the event tag Event Acquire. In Thief 1/G, the schema named pickup_key is played, and the container must be the Player object. If the Engine Features\Combine Type property doesn't exist, it is added when the game starts. The generated name is a combination of the fields in Engine Features\KeySrc in the form "keyF<reg>i<id>" with substitutions made for RegionMask and LockID. If the MasterBit is set, then "T" is used instead of "F".

The StdKey script in Thief 2 has a bug. The PlayerToolFrob message is sent after the key is used on the object. So the first use of a key by the player doesn't have the CreatureType Player tag, but the next frob will even if it's not by the player.

StdLever
gen.osm 1/G/2

A child of StdTwoState. The tweq is toggled in response to FrobWorldEnd. On TweqComplete, will send TurnOn or TurnOff along ControlDevice links. If the object is locked, TurnOn will be sent along ScriptParams links with the data set to ErrorOutput.

StdParticleGroup
gen.osm 1/G/2

Responds to TurnOn and TurnOff by activating or deactivating the particle SFX on the object. Will destroy itself when it receives Die.

StdScroll
gen.osm 1/G/2

Read a book in response to FrobInvEnd. See Legible for details.

StdTerrpoint
gen.osm 1/G/2

On TurnOn, traverses TPath links looking for the object that is linked into the network with TPathNext or TPathInit. Sends Call to the moving terrain object.

StdTwoState
gen.osm 1/G/2

Base script for objects that can be in one of two positions; usually a lever. Inherits from StdController. Manages a joint or rotate tweq on the object. The tweq is moved to the forward state in response to TurnOn or GoForward. TurnOff or GoBackward will send it back. The Toggle and ToggleNoSE messages activate the tweq back and forth. When another object sends SynchUp to this one, it will move the tweq to match the state on the other object. The script will reply with the current state of the tweq when it receives Target?. If the object does not have a joint or rotate tweq, it will always be "off". When the tweq activates, a SynchUp message will be sent to all objects that link to this one with FrobProxy. If the tweq changes, an environmental schema is played with the event tags Event StateChange and either DirectionState Forward or DirectionState Reverse. Except when triggered by ToggleNoSE, a ToggleNoSE message is sent along ScriptParams links that have the data set to SideEffect.

A lever is "on" if the Reverse flag of AnimS in Tweq\JointsState is set.

StdTrap
gen.osm 2

The base for most simple traps in Thief 2. Doesn't do much by itself. Listens for TurnOn and TurnOff messages, and Timer messages with the name TurnOn or TurnOff. Reads the Script\Trap Control Flags and acts accordingly. Will not do anything if the script is locked, either by Engine Features\Locked, or a Lock link from the object. If the Once flag is set, the Engine Features\Locked property is set after the script is finished, but before any Timer messages can be processed. The NoOn and NoOff flags are checked against the un-inverted message.

The descriptions of the derived scripts may refer to the script responding to TurnOn and TurnOff. Unless otherwise mentioned, this is taking into account the Invert option. The actual message that was received may be the opposite.

StickyWebs
gen.osm 1/G/2

On PhysCollision with the Player object, adds a JunkWebs object to the player's inventory. In Thief Gold, if the object inherits from EarthShot, then a JunkEarthWebs object is created. The script reply is "3".

StopAtWaypoints
gen.osm 1/G/2

On MovingTerrainWaypoint, turns off the Physics\Misc\MovingTerrain property and halts the joint tweq. Sends the message Stopping to itself.

StopHere
gen.osm G/2

On WaypointReached, turns off the Physics\Misc\MovingTerrain property and sends Stopping to the moving terrain object.

SubDoorJoints
gen.osm 2

Activates all of the joints in Tweq\JointsState. Goes forward on DoorClose and reverse on DoorOpening.

SummonMeBoiler
gen.osm 2

On Sim start, creates a RobotBoiler and links to it with Contains. The properties Physics\Model\Attributes and Physics\Model\Type are added to the boiler, and Renderer\Has Refs is turned on. When the AI mode changes to Dead, the boiler is destroyed.

The script saves the object ID of the boiler in the script variable MyBoiler, but does not use it. Instead, it looks for a Contains link with the data set to Alternate to find the boiler. This script was not used in Thief 2.

SuspiciousReactions
gen.osm 2

Manages the various reactions that an AI can have to a Suspicious message. The script will respond to suspicious types of door, torch, gaslight, blood, missingloot, or Generic. A Generic suspicious type will be further categorized based on the archetype that the object descends from: Windows, ExBanner, or RopeArrowRope. There is no reaction if AI\State\Current alertness is greater than or equal to 2. Most reactions include performing the reactions on any other AISuspiciousLink links from the object, where the destination of the link has the Is Suspicious field of Engine Features\Suspicious set. For torch and rope reactions, this is all they do. A window or missing loot reaction will set the minimum alert level to 2, then reset it 5 seconds later. The minimum alert level is reset to 1, not 0. A blood reaction will set the minimum alert level to 3 for 10 seconds. The door and gaslight reactions are to go to the suspicious object then frob it. Other reactions will not occur while this is happening. If there is an AIDoor link from the AI to the object, the door reaction is ignored. The gaslight reaction will only occur approximately 16% of the time.

Suspicious messages use the generic message data parameters, so they can be sent from a pseudo-script. The first parameter is the suspicious object ID. The second parameter is the suspicious type.

Sword
gen.osm 1/G/2

Manages the motions and sounds for the sword and the player arm that holds it. While the sword is selected, the player's speed is scaled by 0.75.

TimedPotion
gen.osm 2

Handles the activation and deactivation of potions that persist for a period of time. This script doesn't do anything when the potion is activated. On FrobInvEnd, a duplicate of the object is created with Renderer\Has Refs turned off. A ScriptParams link with data set to Potion is created from the frobber to the newly created object. If the frobber already has a ScriptParams link with data Potion to an object that has the same Engine Features\Combine Type as this object, then no new object is created and the already linked-to object is used. The cloned object is then sent a StartPotion message. When the script receives StartPotion, it will activate the potion then set a Timer with the name PreEndPotion. The time is specified in the Script\Timing property as milliseconds, and defaults to 8600. The time must be at least 1000 milliseconds. When the Timer expires, an environmental schema with tag Event Deactivate is played. If the original frobber was Player, the schema is played as an ambient sound. The potion will be deactivated 1 second later, and the cloned object destroyed. The Timer is reset for every StartPotion message. If, on BeginScript, the object is currently contained by an AI, then the meta-property M-QuaffHeal will be added to the container.

ToggleDoor
gen.osm 1/G/2

A child of StdDoor. Responds to TurnOn and TurnOff by toggling the state of the door.

TransformLock
gen.osm 2

On NowUnlocked, the model tweq on the object is activated and the RegionMask field of Engine Features\KeyDst is set to 0.

TrapCapacitor
gen.osm G/2

A derivative of StdTrap in Thief 2. The trap may be locked in Thief 1/G. When a TurnOn message is received, it is relayed to all ControlDevice linked objects and a Timer (named Decharge) is started for Script\Timing seconds. A TurnOn or TurnOff message received before this timer expires will not be relayed until the timer expires. After the timer expires, the last message received, if any, while the timer was active will be sent. TurnOff messages received when there is no active timer will simply be relayed. The default timer is 30 seconds. In Thief 1/G, the discharge period is specified with a ScriptParams link from the object to itself. The data of the link is the time in seconds, specified as a floating-point number. Thief 2 will use the link if it exists, and will ignore Script\Timing.

TrapConverse
gen.osm 1/G/2

Derives from StdTrap in Thief 2. Starts the AI\Conversations\Conversation when turned on.

TrapCreate
gen.osm 1/G

A variation of TrapRelease that will only release objects (responds to TurnOn) but will not contain them (ignores TurnOff).

This script has been deprecated in Thief 2. Use the NoOff setting of Script\Trap Control Flags with TrapRelease.

TrapDeadfall
gen.osm 1/G/2

A derivative of StdTrap in Thief 2. On TurnOn, makes all ControlDevice linked objects fall. Each object has the Location and Rotation flags of Physics\Model\Controls removed. The script object is destroyed.

TrapDestroy
gen.osm 1/G/2

Derives from StdTrap in Thief 2. On TurnOn, send Slain to all the ControlDevice linked objects, then destroy itself. The script object will not receive Slain. If it is an AI, its speech will be halted.

TrapDirection
gen.osm 2

A derivative of StdTrap. When turned on, sends the message GoForward to objects linked with ControlDevice. Sends GoReverse when turned off.

TrapInverter
gen.osm 1/G

Relay the opposite of TurnOn and TurnOff to ControlDevice linked objects unless the trap is locked..

In Thief 2, this trap is deprecated by Script\Trap Control Flags.

TrapFindSecret
gen.osm 2

A derivative of StdTrap. When turned on, counts a secret as being found if Dark GameSys\Stats has the Hidden flag set.

TrapLocker
gen.osm 2

A derivative of StdTrap. Sets or clears the Engine Features\Locked property of the object when turned on or off.

TrapNonFinalComplete
gen.osm 2

A derivative of StdTrap, but doesn't take advantage of it. Sends TurnOn to ControlDevice linked objects when all of the goals except for those marked as "final" are completed. Or, in the case of "reverse" goals, not completed. Will send TurnOff when the condition is no longer true. Goals that have been marked as inactive are considered to be completed. Essentially, when this script is on, then only "final" goals remain for the mission to end. Listens for QuestChange on the quest variables goal_state_n and goal_visible_n with n from 0 to 20.

TrapOnFilter
gen.osm 1/G

Relay only TurnOn messages to ControlDevice linked objects, unless the trap is locked.

In Thief 2, this trap is deprecated by Script\Trap Control Flags. There is no "TrapOffFilter", you have to create it from scratch by linking a TrapInverter before and after a TrapOnFilter.

TrapPatrol
gen.osm G/2

A derivative of StdTrap in Thief 2. Will turn on or off the AI\Ability Settings\Patrol: Does patrol property. In Thief 1/G, the script object is modified. In Thief 2, the property is modified on objects linked from it with ControlDevice.

TrapRelay
gen.osm 1/G/2

A derivative of StdTrap in Thief 2. The trap may be locked in Thief 1/G. Receives TurnOn and TurnOff messages and sends the same message to all ControlDevice linked objects. The message will be relayed Script\Timing percent of the time, which defaults to 100.

In Thief 1/G, some messages other than TurnOn and TurnOff can be relayed. The scripts are written so that well-known messages, like Sim or FrobWorldEnd are passed to specific handlers, with default handlers in-place that do nothing. If there isn't a specific handler for a message, a generic one is used. TurnOn and TurnOff are usually passed to the generic handler. So in Thief 1/G, any message which goes to the generic handler will be relayed. Most messages that originate from the game engine have specific handlers; most that are only sent from scripts do not.

TrapRelease
gen.osm 1/G/2

A derivative of StdTrap in Thief 2. On TurnOn, remove all the Contains links from the object and relink them as Owns. When turned off, the objects that are linked with Owns are contained. When released, an object is teleported to the location of the trap. When the trap contains an object, it teleports itself to the object's location. Objects that do not have a physical presence (the Renderer\Has Refs property) will not be contained, but they will be released.

TrapRequireAll
gen.osm 1/G/2

A derivative of TrapRequirement. Sends TurnOn when all of the objects that link to this one with ControlDevice have been turned on. After having been activated, it will send TurnOff once it is turned off. If there are no ControlDevice links, the trap will be always on; it will behave like a simple relay. The ScriptParams links are update before sending TurnOn and after sending TurnOff. A linked object is considered "on" if it has a ScriptParams link to it.

TrapRequireAny
gen.osm 1/G/2

A derivative of TrapRequirement. TurnOn will be sent when it is turned on with no previous ScriptParams links to other objects. When turned off, it will send TurnOff if the last ScriptParams link from the object is removed after having been processed by TrapRequirement.

Unlike TrapRequireAll, the sources of the messages don't have to be linked to it with ControlDevice.

TrapRequirement
gen.osm 1/G/2

The base for TrapRequireAll and TrapRequireAny. Is derived from StdTrap in Thief 2. On TurnOn, creates a ScriptParams link from this object to the object that sent the message, if one doesn't already exist. On TurnOff, removes any ScriptParams links from this object to the one that sent the message. Does nothing if the source object ID is 0.

The requirement scripts make ScriptParams links from the script object. While it is safe to create ScriptParams links to the object, any links from it will interfere with normal operation.

TrapRevert
gen.osm 2

A derivative of StdTrap. Relays TurnOn or TurnOff along its ControlDevice links. If Script\Timing is greater than 0, starts a Timer (named Revert) for that many milliseconds. The optional parameter for the timer will be 0 if the object was turned on, and 1 if it was turned off. Only the most recent timer will be active; any previous timers are killed. When the timer expires, it will relay TurnOn or TurnOff based on whether the Timer parameter is 1 or 0. (That is, the opposite of the last message it sent.) Timer messages are handled outside of StdTrap.

TrapSetQVar
gen.osm 1/G/2

Based on QVarTrapTrigBase and StdTrap. Modifies a quest variable based on the directives in Trap\Quest Var. If the message is TurnOff, the meaning of the operation is reversed. A quest variable that is not set defaults to 0.

Thief 1 only supports the value-set (=) and bit-set (!) operations. It also won't recognize negative numbers. If Trap\Quest Var isn't available, the Thief 1 script will read the Editor\Design Note property. See QVar Script Options for a detailed description of the Thief 2 operations.

TrapTeleporter
gen.osm 1/G/2

A derivative of StdTrap in Thief 2. When turned on, teleports a single ControlDevice linked object to this object's location and rotation. If the linked object has a PlayerFactory link from it, then the object named Player is teleported instead. Objects are removed from containers before being teleported. Thief 2 will remove AICurrentPatrol links from the teleported object.

TrapTexture
gen.osm 2

A derivative of StdTrap. Changes textures on brush faces near the object when turned on or off. Script\TerrReplaceOff is the name of the texture when turned off, Script\TerrReplaceOn is the texture that will replace it when turned on. Both properties must be specified. You must create the brushes with the textures set to the initial state. All cells within Engine Features\Retexture Radius of the object will have their textures changed.

Use blockable type brushes to isolate cells that will be changed. The texture names are the full path to the resource. When you click on a texture in DromEd's texture palette, the full name of the texture is displayed in the status line. This script does not handle Script\TerrReplaceDestroy, unfortunately.

TrapTimedRelay
gen.osm 2

A derivative of StdTrap. When a TurnOn or TurnOff message is received a Timer is started for Script\Timing milliseconds. The name of the timer is TimedTurnOn or TimedTurnOff as appropriate. If a timer from a previous message is still running, it's killed before starting the new timer. The Timer message is handled outside of StdTrap.

This script is only present in Thief 2 version 1.18. There are a few ways to work without it, though. You could use TrapDelay or TrapDelayer from a mission-specific script module. The tweq speed of a lever can act similar to a timer. Emit an object with a slow velocity that triggers when it collides with another object. Emit an object with a delete tweq and TrigSlain. A flicker tweq that halts on completion. Or an AI controlled by a pseudo-script with a Wait action.

TrapTweqEmit
gen.osm 1/G/2

A derivative of StdTrap in Thief 2. Only responds to TurnOn. Activates the Tweq\Emit on the object.

TrigAIAlert
gen.osm 1/G/2

When the object goes to high alert (message Alertness with an alert level of 3), sends TurnOn to ControlDevice linked objects.

TrigBrainDead
gen.osm G/2

Sends TurnOn along its ControlDevice links when the AI dies. Listens for the AIModeChange message.

TrigContained
gen.osm G/2

Will send TurnOn over ControlDevice links when it receives Contained. Does not differentiate between adding or removing from the container.

TrigDoorOpen
gen.osm 1/G/2

When a door that was closed opens (DoorOpening), sends TurnOn along its ControlDevice links. When closed (DoorClose), sends TurnOff.

TrigFlicker
gen.osm 1/G/2

In Thief 2, this is derived from StdTrap. Activates or deactivates Tweq\Flicker and on a TweqComplete frame event, sends TurnOn and TurnOff alternately. When turned off, it will send TurnOff if the last message sent was TurnOn. A Timer with the name Check backs up the tweq. If it hasn't done so already, it will send TurnOff after the maximum time of the tweq, or 15 seconds if the tweq time can't be determined.

The Script\Trap Control Flags of StdTrap only apply to turning the tweq on and off, not the messages sent.

TrigInvFrob
gen.osm 1/G/2

Responds to FrobInvEnd by sending TurnOn along its ControlDevice links.

TrigOBB
gen.osm 1/G/2

Trigger that activates when an Avatar or a Creature that is not dead enters the previously unpopulated bounding-box of the object. (Message PhysEnter.) When all the objects that had previously triggered the script leave (PhysExit), it deactivates. On activation, a schema is played with the Event Activate tag, and TurnOn is sent along ControlDevice links. When deactivated, the Event Deactivate schema tag is played, and TurnOff is sent. Objects that enter the bounding-box have the M-NotifyRegion meta-property added to them; it is removed when they exit. Uses Population links to track the objects that are in the bounding-box.

The script is supposed to listen for when an object in the bounding-box dies (Obituary), but it fails to do that. So when it happens, the trigger never turns off. Because objects in the player's inventory are non-physical, it won't get the PhysExit message if you carry the corpse out of the bounding-box.

TrigOBBPlayer
gen.osm 2

Just like TrigOBB, but only triggers when an Avatar enters the bounding-box.

TrigPPlate
gen.osm 1/G/2

Responds to PressurePlateActive and PressurePlateInactive. Sends TurnOn and TurnOff (respectively) to its ControlDevice linked objects.

PressurePlateActivate is triggered when the object reaches the fully depressed state. PressurePlateInactive is triggered when it stops at the default position after having been moved.

TrigPPlateImmed
gen.osm 1/G/2

Responds to PressurePlateActivating and PressurePlateDeactivating. Sends TurnOn and TurnOff (respectively) to its ControlDevice linked objects.

PressurePlateActivating is triggered when the object begins moving away from the default position. PressurePlateDeactivating is triggered when it begins moving towards the default position.

TrigQVar
gen.osm G/2

Based on QVarTrapTrigBase. Does not inherit anything from StdTrap. Registers to receive QuestChange messages for the quest variable specified in Trap\Quest Var. Initially checks the value of the quest variable, and again when it receives QuestChange. If the condition in Trap\Quest Var becomes true, it sends TurnOn. When it is no longer true, TurnOff is sent.

See QVar Script Options for a detailed description of the conditions.

TrigRoomCreature
gen.osm 1/G/2

A room script. When the player, or a Creature enters the previously unpopulated room (messages PlayerRoomEnter and CreatureRoomEnter), sends TurnOn along its ControlDevice links. When all the creatures have left the room (messages PlayerRoomExit and CreatureRoomExit), the script sends TurnOff. The inhabitants of the room are tracked with Population links to the objects. Non-player objects receive the M-NotifyRegion meta-property, and it is removed when they leave. When an Obituary message is received, the Population link to the dying object is removed, and the script will send TurnOff if necessary. Dead or knocked-out creatures don't trigger the script.

TrigRoomDelivery
gen.osm 2

A derivative of TrigRoomObject. Sends TurnOn along ControlDevice links when the object enters a room while being contained by an Avatar. Sends TurnOff if the object leaves the room or is dropped. Entering the room while not in the inventory does nothing. Picking up an object in the room will send TurnOn. The rooms to trigger on are specified with Route links from the object to the room objects, or a parent of the room objects.

TrigRoomDeposit
gen.osm 2

When an object is removed from a container (message Contained), such as the player's inventory, while in a specific room, or if it enters the room (message ObjRoomTransit) while not contained by another object, it will send TurnOn to objects linked from it with ControlDevice. If it leaves the room, or becomes contained by another object, it will send TurnOff. The room objects it will trigger in are specified with Route links from the object to the rooms, or to a room object the room inherits from.

TrigRoomObject
gen.osm 2

Sends TurnOn to ControlDevice linked objects when this object enters a specific room (message ObjRoomTransit). Sends TurnOff when leaving the room. The room to trigger on is specified with Route links from the object. Any room object that inherits from one of the linked rooms will trigger the script. Moving between two different rooms that both have a Route link from the object will do nothing. Even non-physical objects receive ObjRoomTransit messages, so objects in inventory will also trigger.

TrigRoomPlayer
gen.osm 1/G/2

A room script. Sends TurnOn when the player enters a room (PlayerRoomEnter), sends TurnOff when he leaves (PlayerRoomExit). (Along ControlDevice links, of course.)

TrigRoomPlayerTrans
gen.osm 1/G/2

A room script. When the player leaves a source room and enters a destination room, will send TurnOn along ControlDevice links. When leaving the destination and entering the source, TurnOff will be sent. A Route link from the source room object to the destination room object. This script can be present on either the source or the destination (but not both, or it will trigger twice).

TrigRoomPopChange
gen.osm 2

A derivative of TrigRoomCreature. Sends TurnOn whenever the player or a Creature enters or leaves the room. Does not send TurnOff.

TrigSchemaDone
gen.osm 1/G/2

Responds to SchemaDone. Will send TurnOn over ControlDevice links.

TrigSlain
gen.osm 1/G/2

Sends TurnOn to ControlDevice linked objects when the object receives Slain.

TrigUnlock
gen.osm 1/G/2

Sends TurnOn and TurnOff to ControlDevice linked objects when the object gets NowUnlocked and NowLocked, respectively.

TrigWorldFocus
gen.osm 1/G/2

Responds to WorldSelect and WorldDeSelect messages by sending TurnOn and TurnOff to ControlDevice linked objects, respectively.

This corresponds to the FocusScript flag in Engine Features\FrobInfo property. Not the Deselect flag.

TrigWorldFrob
gen.osm 1/G/2

Responds to FrobWorldEnd by sending TurnOn along its ControlDevice links.

TurretAlert
gen.osm 2

A derivative of TrapRequirement. When turned on, the AI\AI Core\Alertness cap is set to high alert (level 3). and the AI is woken up if it was asleep. A ScriptParams link is created to the object that sent the TurnOn message. When turned off, the ScriptParams links to the object that sent TurnOff are removed. If there are no more ScriptParams links from the object, then AI\AI Core\Alertness cap is set to no alert (level 0). When turned off, a Timer named Sleep will be set for 2 seconds. If the AI's alertness is still capped at 0 when the timer expires, then the AI is put to sleep. The AI will be put to sleep initially.

TweqOnOff
gen.osm 1/G/2

Activates or deactivates all the tweqs on the object. Responds to TurnOn (DoActivate), TurnOff (DoHalt), GoForward (DoForward), and GoReverse (DoReverse). The message is relayed to all ControlDevice linked objects. Derives from StdController.

VictoryCheck
convict.osm 1/G/2

This script manages the various objective types and when they are complete. It inherits general objective management from VictoryChecker. On BeginScript, checks the config variable NoKillGoalCheat of Thief 2 and if set, will make all non-reversed slay objectives invalid. On Container, changes the state of any take-an-object objectives where the (de)contained object is the objective target, or inherits from the target. If the object has the Dark Gamesys\Loot property and is being picked up, determines if the object being contained will satisfy any loot objectives. It checks the loot against goal_loot_n, goal_gold_n, goal_gems_n, goal_goods_n, and goal_specials_n or goal_special_n; they must all be satisfied for the objective to complete. Goal_specials_n, or goal_special_n in Thief 1, is a bitmap where all the bits must be set on the object ((lootbits & goal_specials) == goal_specials). If goal_special_n is non-zero in Thief G/2, it is interpreted as the number of a bit in the Dark Gamesys\Loot Special field that must be set. The other requirements are simple values that the object loot must be greater than or equal to. On J'Accuse, it sets a slay objective with the target of the object that sent the message. On ObjRoomTransit, any go-to-room objectives with the target of the room being left or the room being entered is changed. Thief 1 listens for Welcome and Farewell instead, and will toggle go-to-room objectives with the source of the message as the target.

This script evaluates the first 32 objectives, regardless of whether VictoryChecker would consider them valid. A loot objective is only checked when an object with Dark Gamesys\Loot is contained. Just modifying the property of a contained object won't work. The objective targets are not verified, so it's possible to enter an invalid object ID which would never be satisfied. Most of the mission-specific scripts in Thief 1/G include a copy of this, and it is often customized to the particular goals.

VictoryChecker
convict.osm 1/G/2

This provides the base functionality for objectives. It will end the game when all the objectives are completed, an objective fails, or the player dies. It manages the objective options goal_final, goal_optional, goal_reverse, goal_irreversible, and goal_bonus. Thief 2 uses the quest variable goal_satisfied_n to flag when a final objective has been completed. When a final goal has been marked as complete (not just satisfied), it is set to irreversible. When one of the valid objectives change, it determines whether the mission should end. The message CheckVictory will immediately determine whether to end the mission. Thief 2 will reevaluate which objectives are valid when it receives a ReSubscribe message. Thief 1 will only check the first 32 objectives. In Thief G/2, there is no practical limit on the number of objectives; it scans the goal_state_n quest variables beginning with 0 and ends when the variable doesn't exist. Any objectives greater than that are ignored. Objectives for other difficulty levels are treated as valid, but invisible. On BeginScript, the script checks the difficulty quest variable and will add an appropriate M-GarrettDiffSettings meta-property to the object if one doesn't already exist. If the config variable HitPointBonus is set in Thief 2, it will add that value to the properties HitPoints and MAX_HP. It adds the property AirSupply in case it doesn't already exist. There is a delay of 4.5 seconds from when the script triggers the end of a mission and when the mission actually ends. If the player was Slain, the delay will be spent in a fade-out. A mission that ends unsuccessfully for some reason other than death causes the string FailedObj from PlayHint.str to be displayed. When an objective is made visible, the schema new_obj is played and the string NewGoal from PlayHint.str is displayed. In Thief 2, a Popup message with the data NewGoal is sent to the object. When an objective is completed and the config option goal_notify is set, plays the schema new_obj and displays the string DoneGoal from PlayHint.str. Thief 2 sends a Popup message with the data DoneGoal.

VictoryChecker does not determine when an objective is complete. A more specific script, such as VictoryCheck should be used to do the actual checking. Some of the mission-specific script modules in Thief2 include a copy of this script, but it is usually redundant.

Victrola
gen.osm G/2

On FrobWorldEnd, plays the schema linked from the object with SoundDescription, sends TurnOn to the ControlDevice linked objects, and activates Tweq\Joints. On SchemaDone, halts the joint tweq.

VisitDecal
gen.osm 2

On TurnOn, sets any number of automap locations as having been visited. The locations are specified using ScriptParams links from the object to itself. The data of each link is the map page number, a colon, then the map room number. (e.g. "1:2")

VOSounds
gen.osm 1/G/2

A derivative of DescribeSounds. Plays the schema as a voice-over.

WatchMe
gen.osm 1/G

When the script starts, creates AIWatchObj links to this object from all objects that descend from Human.

Waypoint
gen.osm 1/G/2

One of the root scripts. Listens for WaypointReached.

WelcomeRoom
gen.osm 1

A room script. On PlayerRoomEnter, the message Welcome is sent to the player, and Farewell on PlayerRoomExit.

This script is required for go-to-room objectives in Thief 1.

WindowShade
gen.osm 1/G

A variation of AnimLight. On TurnOn, nearby textures are changed to the value of Script\TerrReplaceOn. TurnOff will change them to Script\TerrReplaceOff. On Slain, the textures are changed to Script\TerrReplaceDestroy and will not be changed for any future TurnOn or TurnOff messages.

The AnimLight features of the script will continue to respond after being Slain. Using Toggle will change the light state without affecting the textures. The textures should initially be set appropriately for the default light mode. While the WindowShade archetype exists in Thief 2, this script does not. It can be emulated by combining the AnimLight and TrapTexture scripts.

WorkerRobot
gen.osm 2

On Alertness of level 3, the script removes the meta-property M-WorkBot-Searching and adds M-WorkBot-CameraOut. When the level returns to 0, the meta-property M-WorkBot-CameraOut is removed. On DoSearch, the meta-property M-WorkBot-Searching is added, the signal TurnAround is sent to the AI, and a Timer named DoneSearching is set for 17 seconds. When the Timer expires, the M-WorkBot-Searching meta-property is removed. If the message DoneATurnAround is received while the object has the meta-property M-WorkBot-Searching, then TurnAround is signalled again. The script will reply to the message DoISearch? with 1 if neither of the meta-properties M-WorkBot-Searching or M-WorkBot-CameraOut are on the object; otherwise it replies with 0.

ZombieRegen
gen.osm 1/G/2

Controls the "possum" characteristic of zombies. On Damage, the Game\Damage Model\Max Hit Points for the object will be reduced depending on the type of damage received. If the damage is from a HolyStim or FireStim, or the culprit of the damage is a type of Hammerite (Thief 1/G) or Mechanist (Thief 2), then the max hit points is reduced by the amount of damage taken. If the damage type is LightBright, it is only reduced by half the damage. Otherwise, it is not reduced. When Slain, if Game\Damage Model\Max Hit Points is less than or equal to zero, the Game\Damage Model\Slay Result will be set to Normal and the meta-property M-ZombieParts is added. If the object is a descendant of HammerZombie, then M-HamZombieParts is added instead. If the maximum hit points is positive when killed, then the zombie is resurrected (state set to normal and hit points to maximum) and the signal Possum is sent to itself. If the type of damage that killed the zombie was a WaterStim (i.e. it drowned), then it dies normally. If the Player collides with the zombie, then it is woken up. It will also wake up when it receives a Resurrect message. It wakes up by removing the M-ZombiePossum meta-property and removing any AIWatchObj links from the object to itself. The script also responds to the message Possum? with "0" if the M-ZombiePossum meta-property is on the object, and "1" if it isn't.

A zombie in the "possum" state has the meta-property M-ZombiePossum (which sets the correct creature pose), and an AIWatchObj link to itself. The correct settings for the link are in the AI\Utility\Watch: Watch link defaults of the meta-property. If you add the meta-property before creating the link, then it should initialize with those values.

Thief 1/G mission-specific scripts.

Thief 2 mission-specific scripts.