A Godot modloader for those who want to do it themselves.
Loadot is a Godot 4.x modloader based on Godot ModLoader and inspired by BepInEx.
- Download the latest release zip from the releases page.
- Extract the contents of the zip into the same folder as the executable of the game you want to mod.
- Start the game!
To install a mod, download the mod's .zip or .pck file and drop it into the loadot/mods/
folder!
An exported Loadot mod file should either be a .zip or a .pck file, which is treated as a Godot resource pack and loaded on startup by Loadot.
Once loaded, an exported mod should have a loadot/mods/MOD_NAME/
folder, containing a file named main.gd
. This file will be loaded on startup by Loadot, and will be where all patches are registered for the game.
You can also arbitrarily overwrite any resource by including it in the mod file, but it is recommended to use patches if you are making minor changes to avoid copyright infringement.
- Use GDRE Tools to decompile the game.
- Clone this repository into the game's decompilation folder (do not replace
project.godot
if prompted) - Add the following under the
[autoload]
section ofproject.godot
:
[autoload]
Loadot="*res://loadot/core/globals.gd"
LoadotLoader="*res://loadot/core/loader.gd"
- Open the decompilation folder in the Godot version detected by GDRE Tools
- Create your mod!
With a mod development environment setup, you can start creating a mod by making a folder inside loadot/mods/
with the name of your mod. Then, add a file named main.gd
inside with an _init()
function. Code in here will be run when the mod loads.
Code Example
func _init():
print("This is my mod!")
You can also use Loadot's builtin classes to get easier access to debugging tools like loggers.
Code Example
var logger = Loadot.Logger.new("MyMod")
func _init():
logger.info("This is my mod!")
To load patches in your mod, you can use Loadot's registry in order to change the functionality of an existing class.
Code Example
res://game_class.gd
(An example script from a game that you're trying to mod.)
func start_game():
self.health = 100
self.stamina = 100
self.setup_enemies()
res://loadot/mods/mymod/game_class_patch.gd
(Your patch for the above example script.)
extends "res://game_class.gd"
func start_game():
super()
self.health = 20000
The super()
call above runs the original function from game_class
, so you can choose to run code before or after the original function, or skip it alltogether by removing the super()
call!
res://loadot/mods/mymod/main.gd
(The main script for your mod.)
var logger = Loadot.Logger.new("MyMod")
func _init():
Loadot.Registry.register_patch("res://loadot/mods/mymod/game_class_patch.gd")
logger.debug("Loaded game class patch!")
To export your mod, you have three options:
- Exporting a custom .zip from Godot
- Creating a custom .zip
Method 1: Exporting a .pck or .zip from Godot
Both of these methods are very similar, and involve using builtin functionality from Godot in order to export your mod as a resource pack.
- Make sure you have an export template installed that allows exporting as a PCK/ZIP (the simplest one seems to be Linux).
- Go to Export > Resources > Export Mode and choose "Export selected resources (and dependencies)".
- Uncheck everything except for the resources that you want included in your mod (usually just the
loadot/mods/MOD_NAME
folder). - Export PCK/ZIP (you do not need to have debug enabled) to a file!
While you can stop here, there is an additional step for the first method to make sure that you are not distributing copyrighted content.
- Make sure you export as a .zip, and open the zip after exporting. Delete any files from the zip that were automatically included by Godot during export.
That's it! Place the exported .pck/.zip file into loadot/mods
in order to load it, or sent it to other people to distribute it!
Method 2: Creating a custom .zip
This method does not work with importing some assets. Use the other method of mod exporting if there are issues with loading resources during gameplay.
To create a custom zip file with your mod, you have to place your mod in a loadot/mods/
folder, and make sure that loadot/core
does not exist, deleting it if it does.
Then, zip the loadot folder and name it whatever you want. This can then be placed into loadot/mods
to load it, or sent to other people to distribute it!
Compared to Godot Modloader
Godot Modloader is a mod loader for game creators and modders alike, allowing authors to easily add mod support into their games. Loadot is entirely focused on "self setup", where official mod support is not provided for a game. While Godot Modloader supports self setup (link), it requires more setup on the user's part, and the loader itself is more focused on the experience for game developers.
Compared to Godot Universal Mod Manager (GUMM)
GUMM is a combination mod manager and mod loader that allows users to store, setup, and create mods for games. Loadot tries to be as simple as possible to integrate with external mod managers like r2modman, as well as being easier to maintain, and keep compatibility with more versions of Godot.
Contributions are welcome to the project! Open a pull request and your changes should be reviewed shortly!
You can also contribute by using Loadot! Finding issues and reporting them in the issues helps the project become better for everyone!