Skip to content
Alchyr edited this page May 14, 2026 · 37 revisions

These steps will get you started with a project built on top of BaseLib, a community-developed library that helps smooth the modding process.

  1. Install a C# IDE. Rider or Visual Studio are common options. Rider is recommended, as Godot requires a .sln file and Visual Studio is moving away from those, making it more difficult to generate a project that uses one. This tutorial will primarily explain things in the context of Rider.

  2. Download Dependencies

  • Download latest Megadot, or Godot of the same version as the most recent Megadot release.
  • Install .NET SDK
  • Download latest release of BaseLib and put it in your Slay the Spire 2 mods folder. (If you're not sure where that is, consult this page.) You can download the .zip or download the .dll, .pck, and .json individually.
  1. In your IDE, open the terminal (in Rider: first create a new solution as a placeholder, then press Alt+F12) and run the command dotnet new install Alchyr.Sts2.Templates to install the template from NuGet (.NET's built-in package manager). If the option to open the terminal isn't there, create a new solution to get it to show up. You can also run this from any command line (as long as you've set up dotnet to be available).
  • Alternatively, you can download this project from Github and add it as it as a template in Rider by starting from step 7 here.
  1. Go to File -> New Solution to create a solution using one of the 3 included templates:
  • Slay the Spire 2 Character - a template for creating a new character
  • Slay the Spire 2 Content - a template for adding new content (cards, relics, potions, etc.)
  • Slay the Spire 2 Mod - a mostly blank template
image

The project name should not contain any spaces. The format must be .sln. Enable Put solution and project in same directory. Expand "Advanced Settings" (in Rider) to adjust author and some other options. Also, it's usually a good idea to create a Git repository but it's up to you.

  1. Open the Directory.Build.props file. You don't need to change anything here, but if you want to set up publishing with Godot (explained in more detail further down the page) or if Slay the Spire 2's path is not found automatically, this is the file to adjust. Try pressing the Build button (Hammer on the top bar, or through Build menu on bottom left).
image

If Slay the Spire 2 is not found, you will get an error similar to this Error : Slay the Spire 2 data not found at path '?/steamapps/common/Slay the Spire 2/data_sts2_windows_x86_64'. If so, you will need to set the path manually in the Directory.Build.props file.

If using the character template and you get an error related to localization, the project is set up correctly.

  1. You can change the mod's display name in the mod's manifest .json. The file will have the same name as the project. Do not modify the id; this determines the names of the files the game will attempt to load. The other values can be modified for the mod you are making; see the mod manifest documentation for details.

  2. If you are using the character template, you will need to generate the localization for the character. Open the character class in YourModCode/Character/YourMod.cs. It should have two errors like this; one for "character" localization and one for "ancient" localization.

image

For each one, push alt+enter and choose "Generate localization", then move the generated text to the appropriate file (localization/eng/characters.json and localization/eng/ancients.json).

image

Localization can be generated similarly for cards, relics, ancients, and other content. You can find the full list of supported types here.

If you are not using any BaseLib classes, you can simply remove the package reference from the csproj file.

You can find a WIP character mod using BaseLib here, which may be a useful reference.

Publish/Build:

Warning

You must publish for any non-code changes (localization, images, scenes) to show up.

To set up publishing, right click the project in the left sidebar and choose Publish. In Rider, choose Local folder. Publish options can be left as default. Publishing will compile your mod's .dll, generate a .pck with your mod's assets, and copy the mod's files (.dll, .pck, and .json) to Slay the Spire 2's mods folder. If Godot's path is not set correctly in Directory.Build.props attempting to publish will give you an error.

Publishing is somewhat slow due to the process of generating the .pck through Godot. If you modify only code files, you can Build instead by clicking the hammer button on the top bar. This will only compile the .dll containing your code and copy it to the mods folder.

Issues with publishing may occur if dotnet on system is not setup properly; can be worked around with DOTNET_ROOT=~/.dotnet (valid path to wherever dotnet is) at start of GodotPublish command.

Running the game

After building or publishing, you should be able to run the game and see your mod in the mod list (under Settings -> Mod Settings).

Next steps

After you've gotten things set up, you should read over Modding Basics and Decompiling, which cover some of the things you'll need to know to start writing a mod.

Troubleshooting

If you get an error that looks like this after trying to build or publish:

[MSB4236] The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. C:\Program 
Files\dotnet\sdk\10.0.203\Sdks\Microsoft.Net.Sdk\targets\Microsoft.Net.Sdk.ImportWorkloads.props at (14:38)

Go into File > Settings > search for toolset and change MSBuild version to one mentioning rider

change-msbuild

Clone this wiki locally