A template for a PolyMod script mod.
Main.cs– the mod's code. PolyMod calls the staticLoad(ManualLogSource)method when it loads the mod.Mod/– everything else that goes in the mod:manifest.json, sprites, language files and so on. Set theid,name,versionandauthorsinMod/manifest.json. Theidcan only have lowercase letters and underscores, and theversionmust be plain numbers such as1.0.0(no-presuffix).
Copy local.props.example to local.props (git ignores it) and set:
| Setting | What it does |
|---|---|
ModsDir |
The game's Mods folder. After each build, the .dll and the contents of Mod/ are copied to <ModsDir>/<ModName>; the old copy there is deleted first. Empty: no copy. |
LaunchGame |
steam or epic starts the game after the copy. Empty: no start. |
ModName |
Name of the mod's folder in ModsDir. Empty: the project name. |
Then run dotnet build (or build in your IDE). Without local.props, the build only compiles.
Close the game before you build: a running game does not reload the mod.
GitHub Actions builds every push and pull request and uploads the .polymod file as an artifact.
Run the workflow by hand (Actions → CI/CD → Run workflow) to make a GitHub release named after the version in Mod/manifest.json.