-
Notifications
You must be signed in to change notification settings - Fork 0
Your first Mod
- Introduction
- Understanding Godot Engine & GDScript
- Working with GDScript Mod Loader
- Enabling Mods in the Local Project
- Creating a New Mod
- Testing the Mod
- Next Step
In this guide, we're going to explore the process of setting up a project for modding. Specifically, we're adding a "Drillbert Sleep Indicator" to the game's user interface after decompiling and importing Dome Keeper into the Godot Engine. For a glimpse of the finished mod, you can find it here.
Before diving into mod creation, familiarize yourself with GDScript and Godot if you're new to both. Here are a few resources to kickstart your learning:
- Godot's official documentation
- GDQuest
- Godot Recipes by KidsCanCode
Dome Keeper utilizes the GDScript Mod Loader for mod loading, management, and interaction. Its documentation provides in-depth guidance on the required file structure, available API methods, and more. Be sure to familiarize yourself with the following documentation pages:
To allow Dome Keeper to load mods when testing the game locally, you need to enable a specific setting. Navigate to the res://addons/mod_loader/options/profiles/current.tres
file in Godot's File System and double-click it.
Enable Mods
checkbox is checked in the Inspector (usually in the top right).
Let's dive into creating a new mod. Start by generating a set of necessary files and directories as per the GDScript Mod Loader docs.
The correct file and folder structure for a mod appears as follows:
res://
└───mods-unpacked
└───Author-ModName
├───mod_main.gd
└───manifest.json
We advise creating the folders within Godot. For the main mod folder name (Author-ModName), choose something short and unique. With these two files and the folder name, the Mod Loader will identify your mod.
The manifest.json
file stores crucial information about the mod. Here's an example of what this file might look like:
{
"name": "DrillbertSleepIndicator",
"namespace": "Raffa",
"version_number": "1.0.0",
"description": "Adds a Drillbert Sleep warning indicator to the game's UI.",
"website_url": "https://",
"dependencies": [],
"extra": {
"godot": {
"incompatibilities": [],
"authors": ["Raffaele Picca"],
"compatible_mod_loader_version": ["3.0.0"],
"compatible_game_version": ["2.6"],
"config_defaults": {}
}
}
}
This file represents the primary code for the mod, written in GDScript
. For more guidance on GDScript, visit the Godot Engine docs.
The example below is a starter code setup. It's easily expandable and specific to Dome Keeper:
extends Node
const MYMODNAME_LOG = "Raffa-DrillbertSleepIndicator"
func _init():
ModLoaderLog.info("Init", MYMODNAME_LOG)
func _ready():
ModLoaderLog.info("Done", MYMODNAME_LOG)
add_to_group("mod_init")
func modInit():
pass
After setting up the directory and the two files, you can now test your new mod in the game! Start the project and click on modding in the main menu. If all is correctly set up, your new mod should appear in the list:
✨ Once you have successfully tested your mod, proceed to the Game Investigation section for further development.