-
Notifications
You must be signed in to change notification settings - Fork 0
Syntax Overview
The syntax of scriptor combines elements of gml, BASIC and command shell scripting.
Many design decisions were made with performance in mind, ensuring the parser remains lightweight and efficient, especially for scenarios requiring frequent runtime recompilation.
This led to these general syntax concepts.
- A scriptor script executes line by line, from top to bottom, like a command shell script.
- The syntax does not support functions, classes, or constructors.
- Flow control is provided through:
- Loops (
for,while,do...until - Conditional
ifstatements -
gotocommands
- Loops (
- Use the
exitcommand to terminate the script at any given point.
- Multi-line statements, builder patterns, and
{ code blocks }are not allowed - Each line must be self-contained and executable.
The then keyword, known from the BASIC language, has been included in the requirements of if-statements, to separate the condition block from the action block.
// This is an error
if self.hitpoints == 0 exit
// This is valid
if self.hitpoints == 0 then exitDue to the single-line rule above, if-then-else is implemented in the same way, you would do it in a command shell script: with goto and a jump over, like shown below.
The same pattern can be used to simulate a multi-line then part, by simply creating a jump label to the end of the block.
if some_var != 0 then goto nonzero
// do the part, when some_var == 0
goto go_ahead
nonzero:
// do the part, when some_var != 0
go_ahead:
// continue your scriptSince each statement is written on a single line, there is no need for semicolons to terminate commands.
Back to Repo ● Wiki Home
Copyright © coldrock.games
- Home
- Scriptor Contents
- Scriptor Configuration
- Notepad⁺⁺ Integration
- Create a Script
- $ Variables
- Call a GML Function
- Scriptor global functions
- #-Commands
- The Scriptor Broker
- Broker Events
- Self-Registering Scripts
- Registering Broker Events
- Scriptor Broker File Format
- Extending Scriptor
- var
- new
- goto
- gosub and return
- return (without gosub)
- call
- reset
- Loops
- Conditionals