Before you start writing mods, you should ensure you have the following:
- A text editor. Notepad or Text Editor will be enough.
Tip
Using a text editor meant for writing code, like vscode or Kate(preinstalled on most linux distros) is a lot easier when writing and editing code. However, this isn't required.
Install PolyMod.
Inside your mods folder, create a folder, e.g. example. If you have an IDE, open that folder with your IDE. Else, open the folder with file manager(or finder, or dolphin etc.)
Create manifest.json and paste the following into it:
{
"id" : "my_first_mod",
"name": "My first mod",
"version": "1.0.0",
"authors": ["your-name"],
"dependencies": [
{
"id": "polytopia"
}
]
}Create patch.json and paste the following into it:
{
"unitData" : {
"warrior" : {
"attack" : 100
}
}
}
This will make the warrior have a large attack value. For more information about GLD patching, see (gld.md)
Start the game. Thats it! You should see your mod listed under the polymod hub.
Once you have finished your mod, you may want to bundle it into a single file for easier sharing. Here's how to do that:
- zip the folder of the mod
- rename the zipfile to
example.polymod