Open source · MIT · WebAssembly
Custom game modes for Deadlock, in a language you already know.
Write a mod in TypeScript, Luau, Python or Go, and the game server runs it in a WebAssembly sandbox. While you work, modlock dev reloads the mod each time you save.
Each language's library has the same events and calls, so you can pick the
language you know. This mod replies when a player types /hello in chat:
import { command } from 'modlock'
command('hello', (player) => {
player.chat('Hello from TypeScript!')
})local modlock = require("@modlock")
modlock.command("hello", function(player)
player:chat("Hello from Luau!")
end)import modlock
@modlock.command("hello")
def hello(player: modlock.Player, args: str) -> None:
player.chat("Hello from Python!")package main
import "github.com/paralin/modlock/mod"
func init() {
mod.Command("hello", func(p mod.Player, args string) {
_ = p.Chat("Hello from Go!")
})
}
func main() {}Early development
You can write, run and publish mods in TypeScript, JavaScript, Luau, Python and Go today, but the library may still change between releases.
Where to go
Install
Get the modlock command.
Your first mod
Make a project, run it in the game and change it while it runs.
Tutorial
Build a small brawl with a countdown, a score, a HUD and a sign.
Guides
One page for each thing a mod does: players, timers, damage, the world.
Mechanics
Recipes for whole mechanics: a countdown, kill scoring, a hill, a race.
Reference
Every command, every manifest field and how to publish.
Why WebAssembly
Safe to share
Each mod runs in a Wasmtime sandbox, where it can reach only its own files and never the network. When a mod crashes or hangs, the server stops that mod and the match goes on.
Any language
You can write a mod in any language that compiles to WebAssembly.
Built once
The server looks up each field and input a mod uses by name, so a mod built before a game update still works after it.
Fast
The server calls each mod inside the game's own frame, and Wasmtime runs its WebAssembly as machine code.
Community
Questions, ideas or a mod to show off? Join the Discord. Modlock is open source under the MIT license, on GitHub.