Full ZScript files are referred to as "translation units." This
terminology comes from the C standard, and refers simply to the
entirety of a ZScript source file. ZScript files are searched for in
zscript with any extension, including none. The standard
.txt are common as well.
The base translation unit
zscript may start with a version
directive, then followed by any number of top-level definitions and
#include directives. Included translation units may not have version
All keywords and identifiers in ZScript are case insensitive.
A version directive may be placed at the very beginning of a ZScript file. The version directive describes the ZScript version to use. By default ZScript is version 2.3, the original ZScript specification. This old version is not supported by this documentation and it is highly encouraged to always use the latest version of ZScript. The minimum version supported by this documentation is 3.0.
A ZScript file can have one of several things at the top level of the file, following a version directive.
Include directives include other files to be processed by the ZScript compiler, allowing you to organize and separate code into different files.
Note that included files will conflict with other mods. If two mods
have a file named
zscript/MyCoolClasses.zsc and both include it,
expecting to get different files, the engine will fail to load with a
To avoid this, it is suggested to place your ZScript code under a uniquely named sub-folder.