Running a mod on a server
A server runs one mod at a time, in all of its lobbies. When a player joins, the server tells their game which mod it runs; the game downloads it (from this site), checks it is exactly the same file, and loads it before the lobby shows. Next time it is already in the browser.
Only the web and phone versions can play on a modded server. The console and PC versions are turned away with a message, and modded servers are left off their server list.
On host.dr2.site
- Your server → Mod.
- Pick a mod from the list and press Use. The server restarts with it.
- Its settings (if it has any) are on the same page.
- A new version of the mod: Update appears on that page. No mod takes it off.
The server list of the web version marks modded servers with the mod's name.
On your own server
You need betterserver v1.7 or newer (the first with mods).
- Download the mod's .dmod (its page here) into a
modsfolder next to the server's program. - Next to the program, make
Mod.json:
{
"enabled": true,
"file": "mods/hot_potato-1.0.0.dmod",
"url": "https://modsc.dr2.site/dl/hot_potato/1.0.0.dmod",
"settings": {"fuse": 15}
}
| Field | |
|---|---|
enabled |
false turns the mod off without deleting anything |
file |
The package the server reads |
url |
Where players' games download the same package. Each mod's page shows it. Your own mod can be anywhere that allows downloads from other sites (CORS) |
settings |
The mod's settings (its page lists them); left out: the defaults |
- Start the server. Its console says
[mod] <name> <version>when the mod is loaded, or why not.
To try a mod you are making, point url at a file you serve yourself, for example
python -m http.server in the folder with the .dmod. The browser must be able to reach that address,
and the server must allow web clients (web_clients in Config.json).
Good to know
- Every lobby runs its own copy of the rules (
server.lua). - The mod's maps get the numbers after the game's (32 and up) in the vote and in commands.
- On host.dr2.site, the bots play mod maps too (they learn the ground from the map), unless the mod turns bots off.
- The anti-cheat allows what mods do (more HP, many rings, teleports), and doesn't check the zones of mod maps.
- If the package can't be read, the server runs without a mod and says why in its console.