Skip to content
Kiki edited this page Dec 24, 2024 · 14 revisions

Welcome!

scriptor is a powerful scripting language designed to run seamlessly in your game. You can create, compile and execute scripts at runtime.

The syntax is close to gml, with a touch of good old BASIC and a little spice of command shell scripting.

Note

Please note: Scriptor is not MIT Licensed and not Freeware.
A raptor Pro License is required.

Key Features

  • scriptor is fast. Most scripts run in a few microseconds, you won't notice much performance impact (depends on the complexity of your script though).
  • Access global and local variables or define private variables within your script.
  • Call any function, whether it's a local method, a global function, or even a built-in gml function.
  • All major control structures of a language are available:
    • Loops: for, while, do...until
    • Conditions: if
    • Sequences: Even call chains are supported, i.e. self.struct1.struct2.method(...)
    • Arrays: Arrays are supported, all the most important gml-array functions are available (array_push/pop/shift, array_first/last, array_insert/remove...)
    • Structs: Create any struct, in your script, the owner of the script or even global
  • Includes #macro functionality with recursive resolution, just like in gml.
  • Use #include to create global Scriptor modules and include them wherever needed. The engine supports recursive includes. so you may include things, that include other things.
  • raptor integration. Scriptor comes with several raptor modules to make the most important raptor macros available in your script, like the GAMECONTROLLER or ROOMCONTROLLER, GAME_SPEED, even the Logger, etc.

How does it look like?

1. Prepare your script

These steps are typically performed during the game's startup (e.g., loading screen). Each script is bound to an _owner object (which can be a game object or a struct). This _owner is accessible in your script through self.

var scr = new Scriptor(_owner, @"
    
    // Your script code goes here
    
");

if (!scr.compile())
    throw("Some error messsage");

2. Run it

Once your script is compiled, you can run it at any time:

scr.run();

Of course, you may modify, or even dynamically create any script code at runtime, and re-compile the script whenever you need to.

scriptor is optimized for run-performance. Compiling a script may take some time, depending on your script, even a whole millisecond or two, so consider compiling only during loading screens. Running the script is very fast then!