Skip to content
Miooowo edited this page Aug 5, 2026 · 1 revision

Setup

中文

Familiarity with C# and object-oriented programming is strongly recommended. If you are new to C#, learn the language first, then return here.

These steps create a project based on RitsuLib using the Miooowo.Sts2.Templates package.

1. Install a C# IDE

We recommend Rider. Other IDEs work if you are comfortable with C#.

Godot requires a classic .sln file, not .slnx.

2. Download dependencies

  • Install Slay the Spire 2 from Steam
  • Download MegaDot (Mega Crit’s Godot build), or Godot .NET that matches MegaDot (4.5.1)
  • Install .NET SDK 9+
  • Install STS2-RitsuLib into the game mods folder:
    • Prefer a stable asset from STS2-RitsuLib releases (not the Development build), or
    • Use Steam Workshop if RitsuLib is available there

Your mod’s NuGet reference (STS2.RitsuLib) is separate from the runtime mod folder install. You need both for a normal workflow.

3. Install the templates

dotnet new install Miooowo.Sts2.Templates

In Rider: create any placeholder solution first if you need a Terminal, then run the command there.

4. Create a solution

Rider

File → New Solution, then pick one of:

  • Slay the Spire 2 Character — new character
  • Slay the Spire 2 Content — cards / relics / potions / events, etc.
  • Empty Slay the Spire 2 Mod — minimal shell

When creating:

  • Enable Put solution and project in same directory
  • Project name: no spaces
  • Solution format: .sln
  • Expand Advanced Settings for --ModAuthor and other options

CLI

dotnet new miosts2charmod -n MyCharMod --ModAuthor "YourName" -o MyCharMod
# or: miosts2contentmod / miosts2mod

Always prefer -o so files land in a dedicated folder.

5. Create Directory.Build.props

The template does not ship this file. Create it next to your .csproj:

<Project>
  <PropertyGroup>
    <GodotPath>C:/path/to/MegaDot_mono_win64.exe</GodotPath>
    <!-- If build cannot find game data, set Sts2Path explicitly -->
    <!-- <Sts2Path>C:/Steam/steamapps/common/Slay the Spire 2</Sts2Path> -->
  </PropertyGroup>
</Project>

Do not quote the path. You can also use local.props for machine-local overrides (Sts2Path / Sts2DataDir).

Try Build. If you see something like:

Slay the Spire 2 data not found at path '...'

uncomment / set Sts2Path to your install directory.

For the Character template, a localization-related build error usually means the game path is fine but localization files are missing — the stock template should already include them.

6. Edit {ProjectName}.json

You can change name, author, description, and version.

  • Do not change id after you start distributing the mod (it drives load paths and localization IDs).
  • Keep the dependency entry STS2-RitsuLib.
  • min_game_version is set for 0.110.1 in the current templates (matches beta-oriented RitsuLib).

7. Localization (especially Character)

Keys for model content should look like:

{MODID}_{CATEGORY}_{ORIGINAL_ID}.title / .description

Example: MY_CHAR_MOD_CARD_STRIKE.title

The Character template already seeds eng and zhs under {ModFolder}/localization/. You can Publish and launch without writing localization first.

Optional template parameter: StrictLocalizationValidation=true (or set MainFile.StrictLocalizationValidation).

Analyzers: package Miooowo.STS2RitsuLib.ModAnalyzers is referenced for localization / asset path checks in the IDE and build.

8. Build vs Publish

Action What it does When
Build Compiles .dll, copies .dll / .json into the game mods folder C# code-only changes
Publish Build + Godot headless export of .pck Localization, images, scenes, or first-time asset deploy

In Rider: right-click the project → Publish → Local folder (defaults are fine).

Warning: Non-code changes will not appear in-game until you Publish and a .pck is produced.

GodotPath must be valid for Publish.

9. Run the game

Launch Slay the Spire 2 and enable your mod (and STS2-RitsuLib) in the mod list. For Character template, you should see the sample character after a successful Publish.

Next steps

Clone this wiki locally