Using Scripts in Thief

Definition of a Script

 

In the Dark Engine, a “script” is code that extends game logic. Scripts are stored in Object Script Module files (file extension .OSM), which are DLLs that connect to the engine at runtime. Scripts are associated directly with objects. At runtime, the game connects to the scripts and notifies them of important events. The scripts respond to these events by changing game state, storing or retrieving information, or sending similar notifications of their own. The array of notifications is vast and expandable; the modularity of scripts is significant, as notifications are “sent” to objects; and the array of functions available to scripts is nearly equal to the array of functions available to client game code. (Client code is code that calls into other game systems rather than implements a game system of its own).

 

Script GUI

 

Before adding a script from a file to an object, you must load the file. Use a command for this purpose.
script_load script
will associate the file script.osm with your mission permanently. Anyone who runs your mission will require this file, but all the scripts in the file will be available to you. To add a script to an object, open the Object Editor. Find or add the Scripts property. In the window that ensues, you will see a list of scripts and a checkbox “Don’t Inherit”. Unless you select this box, your scripts will cumulate with all scripts from the parent archetypes. I am uncertain whether the heirs (children) of an object that has “Don’t Inherit” on will accumulate scripts only up to that object, or if they will accumulate all the scripts beside that object. I wager the former. In one of the four fields, input the name of the script exactly as it appears in the documentation or list of scripts. As soon as you close the object editor, the script becomes part of the object’s list of scripts, but it will¬†only¬†work if you have loaded the proper OSM file!

 

 

Caveats

 

All systems have caveats. Some would argue that even nature has problems, technicalities, and inconsistencies. Undoubtedly, scripts outstripping nature are beyond me or any mortal human being. Therefore, you must follow instructions to the letter when adding and using scripts. Since we haven’t documented at least a fraction of the Looking Glass scripts, you should ensure that any official script does, indeed, perform as you wish in your window of circumstances.

 

Bug Reports

 

Send bug reports to gaylesaver@yahoo.com . You can also ask questions about scripts and send them to the same email address. Good luck and I hope that my work aids the quality of your creativity.


About this entry