~ Directive
Automation and pre-processing tasks
Directives are tasks that can execute either during runtime or before a Script starts. They are intended for automation and do pre-processing tasks.
A Directive statement starts with a ~ (Tilde), immediately followed by a space and the directive name.
Start
Defines a different starting point for this script.
By default, Quillscript scripts start at the beginning of the text file. With this directive, you can set a custom starting point.
If you have the Keep Script History setting enabled in Quillscript Settings, you can add an index to multiple usages of the Start Directive. The Interpreter will start the script at index 1 the first time this script is played, at index 2 on the second play, and so on.
Define
Replaces all occurrences of a pre-defined string during parsing time.
It is also possible to add parameters to the Define directive separated from the definition name with a : (colon). Any occurrence of those parameters will be replaced by their equivalent in the directive usage.
Or multiple parameters separated by ; (semi-colon)
Replace
Replaces all occurrences of a pre-defined parameter, before the script starts.
Include
Inserts the data of a given Quillscript Script asset, at this point, either by id or by path.
To include a Script by id, use the script id starting with a @.
To include a Script by path, use the script path, simple or complete.
Be aware not to cyclically include one script into another creating an infinite loop.
Import
Inserts the data of a given Quillscript Script asset, at the start of this script, only once, either by id or by path.
To import a Script by id, use the script id starting with a @.
To include a Script by path, use the script path, simple or complete.
Be aware not to cyclically include one script into another creating an infinite loop.
Inject
Inserts the content of a given label from an external script, at this point, either by id or by path.
To inject a label content by id, use the script id starting with a @.
To include a label content by path, use the script path, simple or complete.
Be aware not to cyclically include one script or label into another creating an infinite loop.
Checkpoint
This directive halts the execution of the script until a specified condition is met. The Interpreter remains in a waiting state and does not proceed to the next line of code until the condition evaluates to true. The condition is an expression that can be evaluated.
It accepts a number parameter to set the delay in seconds between condition checks, this help to improve performance, it check every 0.1 seconds otherwise.
It is also possible to concatenate Command statements to execute before each conditions check.
Last updated