Skip to content

TwilitRealm/mod-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dusklight Mod Template

A standalone template for Dusklight mods.

See the Dusklight modding documentation for the full mod API: services, hooking game functions, asset overlays, and more.

Quick start

  1. Click "Use this template" to create a new repository for your mod.
  2. Edit mod.json: set your mod's id (reverse-DNS style, e.g. com.example.my_mod), name, author, and description.
  3. Rename the target in CMakeLists.txt (add_mod(my_mod ...)) (this names the .dusk file).
  4. Write your mod in src/mod.cpp.
  5. Build locally:
    cmake -B build
    cmake --build build

The result is build/mods/<name>.dusk. Copy it into the game's mods folder to try it:

  • Windows: %APPDATA%\TwilitRealm\Dusklight\mods
  • Linux: ~/.local/share/TwilitRealm/Dusklight/mods
  • macOS: ~/Library/Application Support/TwilitRealm/Dusklight/mods

During development, rebuild, copy and click Reload in the in-game mod manager to pick up changes.

Important

A mod built locally will only be valid for your own platform, and shouldn't be distributed. The repository will build a cross-platform bundle for distribution. See below.

Updating to a new Dusklight version

Change the DUSKLIGHT_VERSION line in CMakeLists.txt to the new release tag (or commit hash) and reconfigure. The pinned version is fetched into dusklight/ automatically. Use the dusklight/ checkout to browse game code, headers and mod services.

Important

The Dusklight checkout is for reference only. Mods use services and hooks to interact with game code.

GitHub Actions

The included GitHub Actions workflow builds the mod for the following platforms:

  • Windows (AMD64 & ARM64)
  • macOS (Apple Silicon & Intel)
  • iOS (Apple Silicon)
  • Linux (x86_64 & aarch64)
  • Android (aarch64)

It then merges the per-platform builds into a single .dusk supporting all platforms. (Artifact mod-combined)

Pushing a tag to the repository creates a GitHub release with the combined bundle.

For Dusklight developers

Point the build at an existing checkout instead of fetching one:

cmake -B build -DDUSKLIGHT_DIR=~/path/to/dusklight

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors