A cross-platform scripting language and compiler back-end for GameMaker
projects. Use Catspeak to implement, fast and sandboxed modding support
by compiling and executing arbitrary user code from files or text prompt.
The spiritual successor to the long dead execute_string function...
// parse Catspeak code
var ir = Catspeak.parseString(@'
let catspeak = "Catspeak"
return "hello! from within " + catspeak
');
// compile Catspeak code into a callable GML function
var getMessage = Catspeak.compile(ir);
// call the Catspeak code just like you would any other GML function!
show_message(getMessage());
...without any of the vulnerabilities from unrestricted access to your game
code:
var ir = Catspeak.parseString(@'
game_end(); -- heheheh, my mod will make your game close >:3
');
// calling `badMod` will throw an error instead of calling the `game_end` function
try {
var badMod = Catspeak.compile(ir);
badMod();
} catch (e) {
show_message("a mod did something bad!");
}