01. Environment Setup¶
STS2 modding combines a managed assembly, a Godot resource pack, and a loader built into the game. The correct toolchain is therefore determined by the installed release rather than by a standalone mod SDK.
Verified Toolchain¶
The baseline used throughout this handbook is:
- STS2
v0.103.3, commit460a0ece - .NET target framework
net9.0 - bundled Microsoft.NETCore.App
9.0.7 - Godot PCK version
4.5.1 - the
sts2.dll,0Harmony.dll, andGodotSharp.dllfiles shipped with the same game install
sts2.runtimeconfig.json is the direct source for the target framework and runtime version. release_info.json is the direct source for the game release. Do not infer either value from an old project file.
Required Files¶
For the default Steam installation, verify:
<STS2>/
release_info.json
SlayTheSpire2.pck
data_sts2_windows_x86_64/
sts2.dll
sts2.runtimeconfig.json
0Harmony.dll
GodotSharp.dll
The game installation acts as the SDK:
sts2.dlldefines models, commands, hooks, nodes, and loader types0Harmony.dllsupplies the patching runtime already used by the gameGodotSharp.dllsupplies the exact Godot C# API loaded by the executableSlayTheSpire2.pcksupplies resource names, localization tables, scenes, and imported asset conventions
Mixing assemblies from another STS2 version can compile successfully and still fail when a method, field, or generated Godot binding has changed.
Create The Project¶
Keep machine-specific paths outside committed project logic when possible. A practical project accepts GameDir or Sts2DataDir as an MSBuild property and provides the common Steam path only as a local fallback.
Tools¶
Required:
- .NET 9 SDK
- a C# editor
- a .NET decompiler such as ILSpy
Required only for content packs:
- a Godot 4.5.1 .NET editor or a compatible PCK packer
Useful local tools may be shipped under <STS2>/tools, including godotpcktool.exe. They are development conveniences, not runtime dependencies of a mod.
Preflight Check¶
Before writing code:
- read the current version from
release_info.json - read the TFM from
sts2.runtimeconfig.json - confirm all three referenced DLLs come from the same data directory
- inspect the PCK header and confirm its Godot version
- launch the unmodified game once and locate its current logs
Record these values in release notes or a maintenance issue. Version evidence makes later breakage reproducible.
Common Setup Failures¶
- targeting the latest installed .NET SDK instead of the game's TFM
- using NuGet Harmony or GodotSharp assemblies that differ from the shipped copies
- decompiling an old backup of
sts2.dll - packing assets with an incompatible Godot version
- assuming a successful DLL build proves the PCK and manifest are valid
The next chapter maps these files to the loader stages that consume them.