Overview
GML (or Godot Mod Loader) mods are ZIP files that modifies the game via Script Extensions, Script Hooks and overwriting vanilla files. You can modify almost every file of the game by extending its scripts or overwriting its files, being able to add your own stuff to the game too, like scripts, scenes, shaders and resources. GML is special because it allows more than one mod to be used at a time and doesn't require you to patch your game's .pck file!
NOTE: Some mods can break others due to what and how they modify a resource or object, making some mods not totally functional with each other.
They contain a simple name structure: 'AuthorName'-'ModName', and inside these files there will always be a folder called mods-unpacked, this is essencial for the Mod Loader to find the mod.
It is highly recommended for you to check the official Godot Mod Loader wiki for more information. https://wiki.godotmodding.com/
Installing GML Mods
In order to install GML mods, do the following:
- Download the
ZIP filefor the mod you want to use. Do not unzip the file! - If the file doesn't have the name structure like in the image below, the mod might be inside the
ZIP fileyou downloaded. - Create a folder named
modsin the same file path as theSMB1R.exefile. - Place the
ZIP filefor the mod you wish to use into themodsfolder.
There are mods that may have additional steps. If the mod requires another GML mod, a resource pack or a custom character to work, follow the steps on how to install those.
If you followed these steps correctly, a file called mod-hooks.zip may have been created in the same file path as the SMB1R.exe file. If so, you have successfully installed a GML mod and is prepared to be used next time you open the game!
The mods are loaded in alphabetical order, except if a mod asks to load some mod before it.
Uninstalling GML Mods
It can happen that you don't want to use a mod or it doesn't work for a specific version of the game. If you want to preserve the mod file in some way, move the file outside the mods folder and delete the mod-hooks.zip. This will make the mod loader not find the mod and make the game run without it.
Creating GML mods
In order to start modding the game using GML, do the following:
-
Download the game's source code through the green
Codebutton, then, press theDownload ZIPbutton. Now, to open the project, follow the steps in the "Importing for editing" section of the README. -
Inside Godot, with the project opened, in the top part of the screen, you will see six tabs. The one you will use now is the
Mod Tooltab.
-
Press
Add Hooks to all Scripts, pressing it will make a window appear. -
In this window, press
Generate mod hooks, it will take a while but shouldn't give you any errors if you didn't messed with anything yet, when it finishes, pressRestart Nowwhen the window for it appears.
This will save you a lot of time when hooking scripts, as it will convert every script to hooked ones.
- After the project reloads, press
Create new Modand fill the information it asks you.
For the mod template, the
defaultone will contain most of the information you need to know about before start modding, if you are experienced enough, you can start using theminimaltemplate, this one will contain less things, but makes starting the job quicker.
- After making the mod, in the
res:directory inFileSystem, find a folder namedmods-unpacked, this is where your mod's folder is. Open itsmod_main.gdfile if it isn't already open. - Inside the file, replace the strings in the constants
MOD_DIR"andLOG_NAME:"AuthorName-ModName"by the mod's folder name, don't delete the:Mainpart if a string contains it.
NOTE: Always open this file before making anything for the mod. This makes sure all changes appears in the script and will be ran by the Mod Loader.
- If you are using the
defaulttemplate, you will need to delete the example lines inside themod_main.gdscript, because if you don't, the game will crash at start up. Follow the image:
From here, you are all set to start modding Super Mario Bros. Remastered! Keep in mind that testing in the Godot editor and on an exported copy of the game can bring different results depending on what it will change, watch out for any uncaught errors.
Manifest.json
This file is responsable to hold all information about your mod, it can also control mods priority, dependencies and incompatibility. For right now, this file is not used in-game, but the Mod Loader possibly uses this file for mods sorting.
To edit this file, open it with a text editor, or in Mod Tool > Manifest Editor.
If you are editing in the
Manifest Editor, don't forget to pressSave to manifest.json. You will lose unsaved changes if you connect another mod to the Mod Tool.
Script Extensions
Script Extensions are the easiest way to modify a script, it keeps all variables, constants and methods of the original script without having to import from it, being also able to add more to it.
NOTE: As for Godot 4.x (Godot version used for the game), Script Extensions can't extend scripts with
class_name, this includesAutoloads(Global, for example), only use this if you are 100% confident that it will not break anything.
- Open the
Context menuright-clicking a script file. - Find the option
ModTool: Create Script Extensionand click it. - Make sure the extension script path appears under the
install_script_extensionsmethod inside themod_main.gdfile.
For more information, please read the Godot Mod Loader wiki: https://wiki.godotmodding.com/guides/modding/script_extensions/
Script Hooks
Script Hooks are an alternative way to modify scripts, it doesn't keep anything from the original script, and it can not add
anything to the script itself, and as it is a generic object, everything inside it will be reused to every node that has the same script the hook extends, unless they are resetted at the start of the methods. It is not the best, but it's efficient and can be used in any script of the game.
Script Hooking works using a chain system in which goes after script extensions, because of that, you will rely on modding methods using the chain variable for everything involving the node or the SceneTree, it is always set first in all methods you're extending, using the ModLoaderHookChain class.
- Open the
Context menuright-clicking a script file. - Find the option
ModTool: Create Mod Hook Fileand click it.If you didn't used the
Add Hooks to all Scriptsbefore, first click theModTool: Convert script to hooked versionbefore proceding. - Make sure the original script path and the script
.hookspath appears under theinstall_script_hook_filesmethod inside themod_main.gdfile.
For more information, please read the Godot Mod Loader wiki: https://wiki.godotmodding.com/guides/modding/script_hooks/
Assets Overwrite
Assets Overwrite are a powerful tool. Basically, it creates a replacement for an asset of the game, being it a .json file or an image file. In normal circunstances, overwriting is not necessary, as you can create Resource Packs to replace existing graphics of the game, but if you see any unmodifiable files, don't be afraid of using it.
You can overwrite scenes and resources even if the Mod Tool says no, but it's not recommended if you want compatibility with other mods. You can't overwrite .txt files though.
- Open the
Context menuright-clicking a file that is not ascenenor aresource. - Find the option
ModTool: Create Asset Overwriteand click it. - If a file called
overwrites.gdwas created, check if the file path is correct. Inside thevanilla_file_pathsvariable.
For more information, please read the Godot Mod Loader wiki: https://wiki.godotmodding.com/guides/modding/overwriting_game_resources/