Modding overview
A StarMap mod extends the KSA mod format. A basic mod consists of:
- A KSA manifest entry that enables the mod.
- A mod folder named for the mod ID, containing
mod.toml. - A .NET 10 class-library assembly named by
EntryAssembly. - A class marked with
[StarMapMod].
HelloStarMap/
|-- mod.toml
|-- HelloStarMap.dll
|-- HelloStarMap.deps.json
`-- any private dependency assemblies
Start with the first-mod walkthrough. Then read about lifecycle callbacks, services and mechanics, and mod dependencies. The service overview links to separate guides for constructor injection, mod-provided services, menu items, event mediation, and method patching.
Entry assembly and mod ID
The name in mod.toml is the KSA mod ID. It must match the mod's folder name and its ID in KSA's manifest. EntryAssembly is the assembly name without the .dll suffix. If the [StarMap] section is omitted, StarMap defaults the entry assembly name to the mod ID; explicitly setting it is recommended.
StarMap creates one instance of the marked entry class for the mod. Keep one [StarMapMod] class in the entry assembly so there is no ambiguity about which class StarMap selects.
Build target
StarMap and StarMap.API target .NET 10. Build mods as .NET 10 class libraries for x64, and use the StarMap.API NuGet package compatible with the loader version you intend to support.
For additional working examples, see the StarMap-ExampleMods repository. The versioned API documentation here describes the attribute-based entry points used by current StarMap releases.