Directives
Preprocessing directives are unique keywords that alter the compiler's behavior. They start with a dollar sign $
and enclosed within curly braces{}
.
$INCLUDE
Allows to insert the content of an external text file in the current file. If the compiler finds this directive it opens the file at the location provided as the parameter and proceeds from the code written in the included file. When it reaches the end of the included file it returns back to the previous file.
Syntax:
If the file path is relative, the compiler scans directories in the following order to find the file:
directory of the file with the directive
data
folder for the current edit modeSanny Builder root directory
the game directory
If none of these directories contains a requested file the compiler throws an exception.
You may use this directive unlimited number of times. The included files may contain this directive too.
$INCLUDE_ONCE
Similar to {$INCLUDE}
, with the only difference being that if the code from a file has already been included, it will not be included again, and the directive is silently ignored.
$EXTERNAL
Syntax:
$CLEO
An analogue of the $E
one, but the compiler automatically copies an output file to the game\CLEO
directory. The file also gets an extension provided as the directive parameter.
Syntax:
extension
is an optional parameter specifying the file extension of the output file. It starts with the period character .
. If no extension is present, the compiler uses the default value .cs
So this directive is the perfect solution to make a CLEO script.
$NOSOURCE
Prohibits the compiler from including a source code of the script.
Syntax:
$OPCODE
Registers a custom opcode via the script.
Syntax:
or
or
When used without any parameter, this directive reloads the original opcodes definitions file and reverts all changes made.
$USE
You can enable multiple extensions by separating them with commas.
$VERSION
This directive is deprecated since v3.1.0
Syntax:
y
- parameters order0
- original: 0, 1, 2, etc1
- custom order, some parameters reordered
zzzz
- opcodes version
By default the compiler uses the version current_edit_mode.1.0000
.
$VERSION_RESTORE
This directive is deprecated since v3.1.0
Restores the version to the value prior to using $VERSION
.
Syntax:
Last updated