GML has functional and event-driven programming paradigms, so it’s perfect for rapid development. But this paradigm can make it difficult to organize and maintain large projects. ScaffScript solves this problem by providing a simple and effective module system for GML.
GML
Usually, a good GML library is split into multiple scripts.
function mylib_something () {
function mylib_another_thing () {
The library also usually expose global enum/macro for configuration.
#macro MYLIB_VERSION " 1.0.0 "
The thing is, exported functions, enums, and macros is always exposed to the global scope if you write it in this way.
And then, you can create the main function(s) by calling the sub functions.
function mylib_another_main () {
ScaffScript
In ScaffScript , you can define the module exports in a single file.
export function mylib_something () {
export function mylib_another_thing () {
You can export various things from a ScaffScript module:
export enum MYLIB_CONFIG {
export const MYLIB_VERSION = " 1.0.0 " ;
After defining the module exports, you can create an integration point to use the module.
intg { main } to " ./scripts/scrMylibMain "
import { mylib_something, mylib_another_thing } from " ./mylib "
// inline required exports
@ content mylib_another_thing
// and then define the main functions
function mylib_another_main () {
Features
TypeScript-like module system with export, import, and include.
Class syntax with separatable implementation that compiles to GML struct constructors.
Content directives for dynamic code insertion.
Special values like @now, @version, and @file.
Code generation blocks for organizing content.
Direct GameMaker integration , automatically updates your GameMaker project.
Language Philosophy
Minimal . ScaffScript doesn’t reinvent GML. It’s a superset that adds just enough to solve real problems.
Pragmatic . Designed for creating libraries and maintaining large projects without the verbose global-scope pollution.
GML-friendly . Keep all of GML’s power and paradigms, just write it more cleanly.
Workflow
Write .ss files with TypeScript-flavored syntax.
Use export to define modules, import and include statements to consume them.
Write integration blocks (#[...]) and use intg statements to map them to GameMaker scripts/objects.
Run the CLI to compile to .gml.
Optional: Inject the compiled .gml files directly into your project.
Everything resolves at compile-time, no runtime overhead.
Ecosystem
Create-Scaff starter templates for npm, pnpm, bun, and GameMaker projects.
Integrated compiler and CLI tool (scaff) for code generation and GameMaker project integration.
Alpha VS Code extension for syntax highlighting. Other features may be added in the future.
Roadmap
Will only be updated if this project is considered as successful by the community.
That’s it, what are you waiting for?