A mod is usually a directory containing one or more code files, any asset files (like images or sounds), and a main.txt file that tells the game which files to load and how.
The user can then use /load moddirectory to execute chat commands from main.txt to load the mod.
In GameMaker terms,
Code files use a
.ntgmlfile extension if they are using "modern" NTGML, or a.gmlextension if they are using "legacy" NTGML."Modern" NTGML usually matches features of latest GML at the time of release.
"Legacy" NTGML is what NTT has originally used and largely resembles GML from GameMaker: Studio with some added conveniences.
Using "legacy" NTGML will also use backwards-compatible versions of certain functions so new mods should stick to "modern" NTGML.
Each loaded code file represents a program with its own scripts and global variables.
To combine multiple files into a single program, see #pragma include.
To have a program call scripts or access variables from another program, see #pragma using or cross-mod API.
- Instances and assets are shared between all mods.
The game will call mod scripts on various occasions, depending on mod type.
For example,
weapon_nameis called for weapon mods whenever the game needs to fetch the name of a weapon for display.- Assets are loaded through code (
sprite_add,sound_add, etc.) You can't create objects at runtime in GameMaker so instead there's a handful of "scriptable" objects like CustomObject, CustomEnemy, etc.
There are also functions to bind a script to run at a specific event/depth.