Scripts#
What is a script?#
Scripts are the foundation of ZScript. You cannot do anything in ZScript without
scripts. Every script has a void run()
function, the entry point for the script.
Each script type runs its scripts based on different things occurring in the engine -
for example, an npc script
runs when an npc
(an enemy) is alive.
Annotations#
Scripts are capable of being targetted with a number of annotations.
For String
values, the number in parentheses is the maximum length, in characters.
Annotation Name |
Value |
Purpose |
---|---|---|
|
String (256) |
Indicate who authored the script. |
|
String (256) |
Sets labels in the Combo / Item editors. |
|
String (65535) |
Sets help text in the Combo / Item editors. |
|
String (256) |
Sets labels in the Combo / Item editors. |
|
String (65535) |
Sets help text in the Combo / Item editors. |
|
String (256) |
Sets labels in the Combo editor. |
|
String (65535) |
Sets help text in the Combo editor. |
|
String (256) |
Sets labels in the Combo editor. |
|
String (65535) |
Sets help text in the Combo editor. |
|
String (256) |
Sets labels for the |
|
String (65535) |
Sets help text for the |
|
“D”, “H”, “LD”, “LH”, “B”, “-1” |
Sets the input field type of the textbox for
inputting the int , float , untyped -> “D”long -> “LD”bool -> “B”rgb -> “LH”else -> “-1”
|
|
|
Only valid on This means that this script will run once, for 1 frame, when the player begins a ‘New Game’. The ‘int’ parameter determines the order that these will run in, starting with the lower numbers and counting up. A global script named |