User Tools

Site Tools


Traps and Triggers

Many of the scripts are types of “traps”. The terms “relay”, “router”, “filter”, and “trigger” are also sometimes used. The purpose of a trap is to respond to or generate TurnOn and TurnOff messages. Some traps both respond to and generate messages. And sometimes one or the other message will be ignored.

Traps are usually linked together using ControlDevice links. System Shock 2 uses SwitchLink links instead, but this manual will only refer to ControlDevice. You’ll just have to mentally translate for SS2.

Trap Control Flags

The behavior of a trap can be altered with the Script→Trap Control Flags property. System Shock 2 has a slightly different Script→Trap Control Flags property, but it serves the same purpose.

Thief SS2 Meaning
Invert Invert Reverses the normal meanings of TurnOn and TurnOff.
Once Once Locks the trap after it has been activated.
NoOn Exit Ignore TurnOn messages.
NoOff Enter Ignore TurnOff messages.

Thief 1 doesn’t have Script→Trap Control Flags, so a design note parameter is used instead. The parameter name is tcf and it is specified as a string of two-character codes. The parameters can be combined together with no spaces between them.

Code Flag
!+ NoOn
!- NoOff
<> Invert
01 Once

Locks and Timing

When a trap is locked, it will ignore all messages. An object can be locked by setting the Engine Features→Locked property. Alternatively, a Lock link from the object to another object that has the Engine Features→Locked property. When using a link, the trap should not have the property on it. The Once trap control flag automatically locks the trap after it is used. This will follow the Lock link if necessary.

A trap that has been turned on will automatically turn off if the Script→Timing (Thief) or Script→Delay Time (SS2) is set. The time is in milliseconds for Thief and seconds (with fractional part) for SS2. The timer is not used when a trap is turned off.

In Thief games, it is possible to link to the Player object. Create the link to the starting-point marker and when the game starts, those links will be moved to the Player object. This even applies to some non-trap scripts.

public_scripts/traps.txt · Last modified: 2010/11/23 00:07 (external edit)