ChoiceScript requires a number of terms to help understand and communicate certain ideas. Most of these are general coding terms, but some are unique to ChoiceScript, or have meanings that are slightly different because of their role in ChoiceScript. While it is not strictly necessary to immediately grasp the full meaning of all of these terms (as that will come with time) it is recommended that you read through these at least once now in order to absorb as much as you can.
- Boolean variable: A Boolean variable is a simple 'binary switch' which may be set to either true or false (not set to "true" or "false", which would make it a string variable).
- Commands: These are set words, prefixed with the asterisk symbol ( * ) like *this, used by authors to provide specific instructions to ChoiceScript. Common commands include *choice, *goto, *label & *set.
- Data Type: Each ChoiceScript variable uses one of three different Data Types (Boolean, Numeric or String), each of which stores a different kind of information, otherwise known as game data.
- Hierarchy: The term is used to describe the actual layout of a program - or in our case, scripting. When the hierarchy has been laid out correctly, the program / script will work as intended; if not, it will error and cause a game-stopping crash. Hierarchy is governed using simple indentation.
- Indentation: The addition of spaces (or tabs) at the start of a line and which, line by line, builds up to form the scripting hierarchy. Indentation is used and referred to in levels.
- Indentation Level: One indentation level is any grouping of spaces or tabs used to make one indentation. The term level is used to keep it from being confused with the actual number of spaces or tabs, since that is a matter of personal preference. See the guide on indentation for more information.
- Numeric variable: A numeric variable is simply one with a data type set to an actual number.
- Scripting: A term for simple programming, in essence, using a set number of *commands and a specific scripting hierarchy
- Stat: A stat is a specific kind of variable that the player is intended to be aware of, usually by displaying it on the stats screen. A stat has no functional difference from any other variable.
- String variable: An alphanumeric String variable is one with a data type set to any group of letters and / or numbers, and which is made distinct from other data types using quote marks "like this".
- Variable: A variable is the means by which ChoiceScript stores game information, otherwise known as game data, whether for a short-term, temporary purpose or a long-term, permanent one (an important distinction). Each variable contains one of three different possible data types. A variable's name is the reference by which we make use of this stored data within our story scripting, and so must be unique.
- Var: Var is used within this Wiki as a placeholder variable, to make neutral and unconfusing examples. For example: If you're told to *set variable + 5 you might not realize that variable is supposed to be replaced with the actual variable name. Likewise, if you're told to *set [variable] + 5 you might get that you're supposed to replace the variable name, but might not catch that the brackets are supposed to be deleted also. If, however, you're told to *set var + 5 you now know that var is to be replaced with whatever variable name you want to change, as you are now aware that var is just a placeholder. Note that when there is a large number of variables used in Wiki examples, var will be written as var# (var1, var2, var3 etc).
Next Tutorial Article: Development Tools