Difference between revisions of "Category:Commands"
imported>Gblues (Added basic syntax of a script; moved comparison and logical operators into if topic) |
imported>Gblues m (Corrected scriptname link.) |
||
Line 8: | Line 8: | ||
</pre> | </pre> | ||
The [[ScriptName]] command is fairly self-explanatory: it sets the name of the script. It is required, and the name must be unique. | The [[scriptname|ScriptName]] command is fairly self-explanatory: it sets the name of the script. It is required, and the name must be unique. | ||
The [[begin]] directive defines the action that triggers the script. If the conditions of the [[begin]] statement are met, all commands between [[begin]] and [[end]] are executed. Every [[begin]] statement must have a corresponding [[end]] statement! | The [[begin]] directive defines the action that triggers the script. If the conditions of the [[begin]] statement are met, all commands between [[begin]] and [[end]] are executed. Every [[begin]] statement must have a corresponding [[end]] statement! |
Revision as of 01:19, 15 April 2006
Oblivion's scripting language is customized for the game, but shares much of the structure of a formalized programming language. A basic script has three elements: a script name, a begin statement, and an end statement. Here's an example:
ScriptName MyScript begin OnAdd Player ; do stuff end
The ScriptName command is fairly self-explanatory: it sets the name of the script. It is required, and the name must be unique.
The begin directive defines the action that triggers the script. If the conditions of the begin statement are met, all commands between begin and end are executed. Every begin statement must have a corresponding end statement!
You can also abort execution of your script using the return command. This is useful inside an if statement where you don't want to continue execution any further.
You may add comments to your code by starting the line with a semicolon. A comment is ignored by the game, but allows you to leave yourself notes on what a particular script is doing.
See also:
- Declaring Variables
- the if statement
- set
- List_of_command_appearances_in_scripts
Subcategories
This category has the following 3 subcategories, out of 3 total.
Pages in category "Commands"
The following 11 pages are in this category, out of 11 total.