These scripts can be found in the free-to-use module tnhScript.osm
. Fan-mission authors may include the script module in their mission as long as they fully comply with the Dromed EULA.
This fan-mission contains sample uses of most of the scripts.
Dromed provides standard properties and links for scripts to use. The ControlDevice link is most often used to assocated a trigger (the source of the links) with a trap (the destination). Scripts which have a delayed effect usually check the Script→Timing property for the time value.
Custom scripts often require settings not provided by the standard properties. The Editor→Design Note property is used for additional configuration options.
When a special type of link is required, the association is made with a ScriptParams link and the data of the link tells what the special meaning is.
Many of the scripts share common features. These are implemented in three generic scripts.
GenericTrap | A switch-like script which responds to TurnOn and TurnOff messages. |
GenericScale | A knob-like script which works with a numerical argument. |
GenericControl | A script which can take a string argument. |
GenericTrigger | A script that is more likely to send triggers, than receive them. |
All of the generic scripts should put a meaningful value in the message return argument, or at least set it to non-zero if I couldn’t think of anything “meaningful.” This is so the scripts can be used directly in a pseudo-script. Returning zero causes the pseudo-script to abort, which usually is too drastic.
ScriptController | ScriptController Send a ScriptControl message to other objects. The first message data argument is the control string, as usual. The second argument can name t… |
CommandControl | CommandControl Executes an internal Dromed command. Multiple commands may be executed by separating them with ;. You can get a list of commands by typing in D… |
TrapFrobber | TrapFrobber Translate a TurnOn message into FrobWorldEnd. Most useful for converting a book, plaque, or scroll into a trap. It is not necessary for the objec… |
TrigFrobber | TrigFrobber Translate a FrobWorldEnd into TurnOn. The reverse of TrapFrobber, basically. The trap control flags are ignored, so you can use them for a more us… |
TrapMoveRelative | TrapMoveRelative Move and apply velocity to an object relative to its current position. Works similarly to a teleport trap. Instead of a reference object, you… |
TrapCampaignQVar | TrapCampaignQVar Set the value for a quest variable that is stored in the campaign database. The quest variable will always be saved to the campaign database,… |
TrapKillEvents | TrapKillEvents This can disable user input. All user input, which means even the escape key doesn’t work. So the script will always time out even if you don’t … |
TrapCamAttach | TrapCamAttach Attach the camera to this object. Returns to normal viewing when turned off. When the camera is attached to an object that isn’t the player, it … |
TrapFreezePlayer | TrapFreezePlayer Prevent the player from moving. Basically, the extreme opposite of a speed potion. The TurnOn and TurnOff responses are more like a trap than… |
TrapThreshold | TrapThreshold Will send TurnOn after having received a certain number of prior TurnOn messages. That is, every nth TurnOn will be relayed. The counter that tra… |
TrapRandomTimer | TrapRandomTimer Relay TurnOn and TurnOff along ControlDevice links after a random delay. The time will be at least min_time and no more than max_time. Respec… |
TrapRelayRepeat | TrapRelayRepeat Relay TurnOn a repeated number of times with a delay between firings. By default, the relay will repeat indefinitely. The parameter repeat wil… |
TrapRenderFlash | TrapRenderFlash Display a render flash and optionally play a sound. Make a RenderFlash link from the object (or its archetype) to the archetype of a flash SFX.… |
TrapDisarmPlayer | TrapDisarmPlayer Remove offensive items from the player’s inventory. Items are returned to the player when the trap is turned off. Removes object of type Wea… |
ObjFrobInert | ObjFrobInert Keeps linked objects frob-inerted until the object is Slain. Most useful for door-like objects such as a window, but it doesn’t need the door prop… |
DoorFrobInert | DoorFrobInert Add and remove the FrobInert metaproperty based on the door state of this object. If the door is breakable, then the metaproperty is permanently… |
GrabFrobInert | GrabFrobInert Removes the FrobInert metaproperty when the object is picked up. The effect can also be achieved by adjusting the Inventory\Pick Bias property. … |
TweqFrobInert | TweqFrobInert Add and remove the FrobInert metaproperty based on the state of a joint tweq. When the primary joint is in Reverse, then the objects are frobbab… |
TrapFrobInert | TrapFrobInert TurnOn makes the objects frobbable, TurnOff the opposite. Has all the expected behaviors of a trap. Inherits ObjFrobInert Messages TurnOn, Tur… |
UnlinkOnContained | UnlinkOnContained When the object is contained, delete all links from another object. The source(s) of the links is determined from a ScriptParams link with d… |
TimedGrenade | TimedGrenade A timed grenade is armed when it is thrown (but not dropped) from the player’s inventory. The grenade arms itself by playing a schema and activati… |
ZeroGravRoom | ZeroGravRoom A room script. It sets the player’s gravity to zero when entered, and to normal gravity when exited. This is a copy of a script used in System Sho… |
TrapFadeOut | TrapFadeOut Gradually fade-out to black. The argument is the duration of the fade, in seconds. The screen will remain black until a TurnOff message is sent to … |
LockHelper | LockHelper Script that sends TurnOn based on various interactions with a locked object. The triggers are sent along ScriptParams links that have the data set t… |
TrapSiblingRelay | TrapSiblingRelay Aids when multiple objects can be used to control a trap. Create a group of relays with this script on them. Using ScriptParams links with th… |
TrigContact | TrigContact Sends TurnOn and TurnOff when another object makes or breaks contact with this one. Link from this object to another using ScriptParams with the da… |
TrapText | TrapText Displays book text when turned on or frobbed. If there is no Book\Text then Editor\Design Note is displayed. Putting book text in Editor\Design Note … |
FocusPlaque | FocusPlaque Display the book text on-screen when the object is hilighted. Will remove the text when unfocused, unless the trap control flag NoOff is set. Messa… |
ContainerPhysics | ContainerPhysics Transfers the velocity of a container to the items it contains when the container is slain. The objects are randomly distributed within the di… |
RandomPatrolPath | RandomPatrolPath This script allows you to create multiple patrol paths for a single AI. Create the different patrol paths as normal, but manually link the AI … |
RandomStartingPoint | RandomStartingPoint Moves the starting point to a randomly-selected location before the Player object is created. A single starting point is created as normal.… |
TrigDoorOpening | TrigDoorOpening Sends messages when a door opens or closes. The messages sent can be handled by the script TweqOnOff to control a tweqable object. The Invert t… |
InvCarryOver | InvCarryOver The first of a pair of scripts that allow you to have persistant containers. To make an object carry over, create a ScriptParams link with data Ca… |
InvLoadUp | InvLoadUp Creates objects based on quest variables that were set in a previous mission. It looks for quest variables that begin with inv_. If the parameter inv… |
GenericPotion | GenericPotion Works with the standard script TimedPotion. On StartPotion, add a metaproperty to the recipient. Recipient is usually the frobber, or specified… |
InventoryMetaprop | InventoryMetaprop Adds a metaproperty to the Player while the object is in his inventory. Messages Contained Parameters inv_effect (object) Metaproperty t… |
TrapContainer | TrapContainer Moves the items that are contained by this object to a ControlDevice linked object. Turning off the trap will move contained items out of the lin… |
TrapDispenser | TrapDispenser Creates a new object and places it into a container. Link to the destination, which may be the starting point, with ControlDevice. Inherits Gene… |
TrigPurchase | TrigPurchase Put this script on an item in the pre-mission store and it will trigger whether or not it was purchased. Specifically, it will test if the object … |
SimpleGun | SimpleGun This is a demo script and (probably) may not be around for long. You frob an object and it shoots a projectile. Simplistic and boring and not at all… |
TurnAtWaypoints | TurnAtWaypoints Will turn a moving terrain object so it has the same orientation of the waypoint it just reached. This looks best when the objects are turned s… |
VisibleRelay | VisibleRelay Relays TurnOn and TurnOff conditional on whether an object is currently on-screen. With the trap control flag Invert, it relays when the object is… |
ResetTweqState | ResetTweqState Works with all tweq types except Lock or Delete. When the tweq halts, the appropriate properties for the object will be reset to default values.… |
RecallDevice | RecallDevice When turned on, all ControlDevice linked objects are teleported to the location of the Player object. This is meant to be used to move a teleport… |
TrigProxFrob | TrigProxFrob When frobbed, TurnOn will be sent if the frobber is currently within a certain area. A proximity object, identified by a Route link, will be check… |
PoliteVOTrap | PoliteVOTrap Plays a voice-over schema only if there are no AIInvest links to the Player object. Why? Because it doesn’t make sense for Garrett to be cutting … |
TrigSchemaDoneSpec | TrigSchemaDoneSpec Triggers on SchemaDone with a specific schema name Inherits GenericTrigger Messages SchemaDone Parameters schema (object) |
AIGoMissing | AIGoMissing When slain or knocked-out, a marker is created at the idling origin of the AI. The archetype MissingPerson is used and should be created with an ap… |
MissingMarker | MissingMarker Delayed response when an object goes missing. Makes the object suspicious after a timer. Messages GoMissing, NotMissing Parameters missing_del… |
UndeadRadar | UndeadRadar React to an UndeadStim stimulus by adjusting the Renderer\Dynamic Light proportional to the intensity of the stim. The Script\Timing property contr… |
TrigBreadcrumb | TrigBreadcrumb A bounding-box trigger in which a passing AI can “sense” the Player. Place these in hallway junctions then link each trap to each of the nearby… |
FollowBreadcrumb | FollowBreadcrumb Responds to the message Breadcrumb. The AI will be directed to go to the object the message specifies. If the AI is at high alert, then nothin… |
RainSFX | RainSFX Turn off particles when weather effects are disabled. Messages Sim, DarkGameModeChange |
TrackAttach | TrackAttach Adjusts the position of an attached object to follow the moving base object. Requires the DarkHooks helper module. Messages DHNotify Links Phys… |
ElevatorCar | ElevatorCar When the lift is about to move, activate the joint tweq in reverse and wait for it to complete. On TweqComplete, activate the lift. On WaypointReac… |
TrigElevator | TrigElevator Triggers when moving terrain starts and stops. Messages Starting, Stopping |
TrapPhysical | TrapPhysical Control an object’s presence in the world. Inherits GenericTrap Properties Renderer\Has Refs |
TrigProximity | TrigProximity Trigger for activating devices when the Player is nearby. Inherits GenericTrigger Messages TurnOn, TurnOff Parameters proximity (number) R… |
ScaleTweqJoints | ScaleTweqJoints Manipulates a joint tweq of an object. The tweq range in Tweq\Joints is multiplied by the scale value to set the joint position. Inherits Gene… |
KnockOnDoor | KnockOnDoor Signal an AI when you frob a door that is closed and locked. The AI has an Owns link to the door it will respond to. Messages FrobWorldEnd Links … |
OnScreenText | OnScreenText Display text from a book file on-screen. Supports multiple pages, color, and auto-scroll. All of the page options are written in the book file. Th… |
InteractFrobHack | InteractFrobHack Like the script CorpseFrobHack but allows you to frob an active AI. To use it, you need the metaproperty FrobInteract. Set the Engine Feature… |
AIInteraction | AIInteraction Triggers an object in response to an Interact message. The object is chosen from any number of ScriptParams links that have the same data as was … |
PlayerInteraction | PlayerInteraction When the object is tool-frobbed, an Interact message is sent to the destination of the frob. The Inventory\Object Name of the object is sent … |
AwarenessFilter | AwarenessFilter When placed on another object, an AI can send a CanISeeYou or CanIHearYou message to test for awareness of the object from the AI. When placed … |
TrapSignalAwareness | TrapSignalAwareness When turned on, a signal is sent to all AI that have an AIAwareness link to some other object. Objects to check for are specified with Con… |
PrivateRoom | PrivateRoom Allows an AI that is normally non-hostile to become alarmed if it sees the Player in a room. When the Player enters the room, a metaproperty (M-Pla… |
HighlySuspicious | HighlySuspicious A replacement for SuspiciousReactions. Responds to a Suspicious message (which is usually sent from a pseudo-script) based on parameters read … |
VendorRelay | VendorRelay Will relay TurnOn, at a price. Loot cost can be given as the total value, or as three numbers for gold, gems, and goods. Inherits GenericTrigger … |
LootExchange | LootExchange On TurnOn, converts an amount of the Player’s loot from gems/goods into gold. The exchange rate is a real number and can be given as a fraction. … |
PurchaseItem | PurchaseItem Trap for managing a single item that can be bought from an in-game store. Uses ScriptParams links to coordinate with the item being purchased, the… |
ShoppingCart | ShoppingCart The main part of an in-game store. Purchased tems are added to the object’s inventory before being paid for. If there is a Cart link, then that ob… |
LootStats | LootStats Tracks loot that is acquired/spent during a mission. Allows loot carry-over like LastMissionLoot. You should only use one of the scripts at a time. … |
AIFactory | AIFactory Creates a random AI. Link to a number of archetypes. Properties and links from this object will be copied to the AI. Messages Sim Links ScriptPara… |
NewCrystal | NewCrystal Substitute this object for another when contained by the player. Acts like the standard Crystal script, but lets you specify what the arrow (or what… |
NewKey | NewKey The StdKey script of Thief has a bug that prevents schemas with the tags LockState and Event StateChange from playing correctly. Specifically, the scrip… |
NewGasLight | NewGasLight An enhanced replacement for GasLight or Extinguishable. With this script, frobbing a light turns it off, as well as on. You can also add an emitte… |
NewSecurityDoor | NewSecurityDoor This version of the SecurityDoor script will ignore state changes when there is an AIDoor link to the door. It also recognizes double-doors lin… |