Getting into modding

Bots, overlays, trackers and new content all start as mods. The two games use different engines, so pick the game first; each column below runs from first step to first published mod.

Slay the Spire

Java, ModTheSpire and BaseMod

The game is written in Java. ModTheSpire loads mods and patches game methods at load time, and BaseMod adds the API most content mods use.

  1. Subscribe to ModTheSpire, BaseMod and StSLib on the Steam Workshop.
  2. Learn enough Java to read and write classes. The BasicMod tutorial says it won't teach Java.
  3. Set up BasicMod and follow its wiki. Older guides point at the Default Mod, which its own README marks as out of date.
  4. Read the game's decompiled code to find what to patch. ModTheSpire's SpirePatch lets you insert code before, after or inside game methods.
  5. Ask in #modding-technical on the Slay the Spire Discord; the BasicMod README points there for more options.
  6. Publish to the Steam Workshop.

Resources

  • ModTheSpire wikiLoader setup and SpirePatch, the system every mod uses to change game code.
  • BaseMod wikiHooks and helpers for adding cards, relics, characters and events.
  • BasicModEmpty starter mod with a step-by-step tutorial wiki. The recommended starting point.
  • ProTemplateCharacter mod template with extra quality-of-life features, for people who know the basics.
  • StSLibShared keywords and mechanics many content mods depend on.
  • Steam WorkshopWhere Slay the Spire mods are published and installed.
Slay the Spire 2

C#, Godot and official mod support

The sequel runs on Godot with its game logic in C#. It supports mods officially, and Mega Crit publishes an uploader for the Steam Workshop. The game is in Early Access, so code and mod APIs still change between patches.

  1. Install the .NET SDK and an editor that handles C# solutions.
  2. Work through the STS2 modding tutorials for setup and the basics.
  3. Create a project from ModTemplate-StS2. Its setup notes require "Put solution and project in same directory" for Godot.
  4. Decompile the game's assembly with ILSpy to see how cards, relics and powers are built.
  5. Look up IDs and values in Spire Codex instead of digging through files.
  6. Publish with Mega Crit's sts2-mod-uploader.

Resources

  • STS2 modding tutorialsSetup, BaseLib and RitsuLib, adding content and visuals. Work in progress.
  • ModTemplate-StS2Templates for an empty mod, a content mod and a character mod.
  • BaseLibLibrary that standardizes how mods add content.
  • RitsuLibShared framework library for mods.
  • ILSpyC# decompiler for reading the game's code.
  • Spire CodexCard, relic, monster and event data for every game version, with an API.
  • sts2-mod-uploaderMega Crit's official tool for publishing to the Steam Workshop.
  • Steam WorkshopWhere Slay the Spire 2 mods are published and installed.