SMAPI/README.md

44 lines
2.0 KiB
Markdown
Raw Normal View History

2016-10-20 02:46:23 +08:00
**Stardew.ModBuildConfig** is an open-source NuGet package which automates the build configuration
for crossplatform [Stardew Valley](http://stardewvalley.net/) mods that use SMAPI.
2016-10-20 07:26:33 +08:00
The configuration...
2016-10-20 02:46:23 +08:00
2016-10-20 07:26:33 +08:00
1. detects the operating system (Linux, Mac, or Windows) and the Stardew Valley install path;
2. injects the correct references to Stardew Valley, SMAPI, and XNA/MonoGame;
3. (on Windows) configures Visual Studio so you can launch the game for debugging;
4. and adds a `GamePath` variable which can be used to automate mod installation during testing
if desired.
2016-10-20 02:46:23 +08:00
## Installation
2016-10-20 07:26:33 +08:00
### Creating a new mod
1. Create an empty library project.
2016-10-21 13:41:26 +08:00
2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig).
2016-10-20 07:26:33 +08:00
3. [Write your code](http://canimod.com/guides/creating-a-smapi-mod).
4. Compile on any platform.
2016-10-20 02:46:23 +08:00
### Migrating an existing mod
2016-10-20 07:26:33 +08:00
1. Remove any references to `Microsoft.Xna.*`, Stardew Valley, `StardewModdingAPI`, and xTile.
2016-10-21 13:41:26 +08:00
2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig).
2016-10-20 07:26:33 +08:00
3. Compile on any platform.
2016-10-20 02:46:23 +08:00
## Configuration
2016-10-20 07:26:33 +08:00
### Custom game path
If you customised where Stardew Valley is installed, you can add your path to the list to try.
2016-10-20 02:46:23 +08:00
2016-10-20 07:26:33 +08:00
1. Get the full path to the directory containing the Stardew Valley executable.
2. Add this section to your `.csproj` file (anywhere before the added `<Import` line):
```
<PropertyGroup>
<GamePath>C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley</GamePath>
</PropertyGroup>
```
2016-10-20 02:46:23 +08:00
### Compatibility with mod builders
The configuration is designed for compatibility with third-party mod compilers. [Silverplum](https://github.com/rumangerst/SilVerPLuM)
is officially supported, and you can inject the `GAMEPATH` environment variable to override the
detected game path.
2016-10-20 02:46:23 +08:00
## See also
2016-10-21 13:41:26 +08:00
* [NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig)
2016-10-20 02:46:23 +08:00
* <s>Discussion thread</s>