Editing Script Commands

Script commands are fundamental to the way Quest works. Printing messages, playing sounds, displaying text blocks, killing the player, moving objects and much more are all done through the use of script commands. Script commands can be triggered in many circumstances, which is why many editing windows have buttons for editing script. The window that comes up whenever you click the "Edit" or "Edit script" button is the same, and this section describes how to use it.

There are three types of script - normal script, conditional script and select case. Conditional script is only run if one or more conditions, such as the player having a certain object, is met, and which select case script is run depends on the value of a particular variable or property.

Normal Script

Available commands are grouped into categories. Double-click a category (or single-click the "+" next to it), to show which commands are available in that category. When you select a command, you can enter its various parameters and read information about it in the box next to the command list.

For many parameters you may see some combination of buttons. These allow you to easily add things to the parameter:

Conditional Script

Click "Add Conditional" from the toolbar to access the Conditional Script Editor.

From here, you can specify the conditions that need to be fulfilled in the list next to "If". If these conditions are fulfilled, the script specified by "Then" is run. If the conditions are not fulfilled, the "Else" script will be run if there is one; otherwise nothing happens.

To add conditions, click "Add" to bring up the Condition Editor.

If this is the first condition in the list, the "And" and "Or" options are unavailable. Optionally, "Not" can be selected so that the "Then" script will be run if this particular condition is not true.

Select the condition from the list, and enter the relevant parameters in the "Condition Parameters" box.

When you specify script for "Then" and "Else", you will be presented with another Script Editor window from where you again specify normal script, or even more conditional script - this allows you to cater for many complex situations relatively easily.

Select Case

"Select case" allows you to choose between several scripts based on the value of a string or numeric variable, a function or an object property. Enter the value to check in the "Select Case" box, then click the Add button to add the various cases and scripts.

 

< Back