Building the S1API Project
This guide explains how to set up your development environment and build the S1API project.
Prerequisites
Before you begin, make sure you have the following installed:
- Visual Studio 2019 or later with the following workloads:
- .NET desktop development
- Game development with Unity
- .NET Standard 2.1 SDK
- .NET 6.0 SDK
- Git for version control
- MelonLoader installed for your Schedule One game installation
Setting Up the Development Environment
Clone the Repository
bashgit clone https://github.com/KaBooMa/S1API.git cd S1API
Configure Build Properties
The project uses build property files to specify paths to dependencies. Example files are included in the repository:
github.build.props
- Used for GitHub CI/CD buildsexample.build.props
- A template with examples of proper paths
For local development, create a
local.build.props
file in the root directory by copying one of the example files and adjusting the paths to match your system. The file should contain paths to your game assemblies and MelonLoader installation.Key properties to configure include:
AutomateLocalDeployment
- Set totrue
to automatically deploy builds to your game installationMelonLoaderAssembliesPath
- Path to MelonLoader assembliesBepInExAssembliesPath
- Path to BepInEx core files (if using BepInEx)MonoAssembliesPath
- Path to game's managed assemblies for Mono buildsIl2CppAssembliesPath
- Path to game's Il2Cpp assembliesLocalMonoDeploymentPath
- Path to your Mono version of the gameLocalIl2CppDeploymentPath
- Path to your Il2Cpp version of the game
Refer to the example files in the repository for the complete set of properties and proper formatting.
Open the Solution
Open the
S1API.sln
file in Visual Studio.
Building the Project
S1API needs to be built for both Mono and Il2Cpp environments:
Building for Mono
- In Visual Studio, set the solution configuration to
Mono
- Build the solution (F6 or Ctrl+Shift+B)
- The output will be located in the
bin/Mono/netstandard2.1/S1API.dll
directory
Building for Il2Cpp
- In Visual Studio, set the solution configuration to
Il2Cpp
- Build the solution (F6 or Ctrl+Shift+B)
- The output will be located in the
bin/Il2Cpp/netstandard2.1/S1API.dll
directory
Automated Deployment
If you've configured AutomateLocalDeployment
to true
in your local.build.props
, the build process will automatically copy the compiled DLLs to your game's plugins folder:
- When building the
Mono
configuration, both Mono and Il2Cpp versions will be copied to your Mono game installation - When building the
Il2Cpp
configuration, both versions will be copied to your Il2Cpp game installation
Running Tests
If the project includes tests:
- Open the Test Explorer in Visual Studio (Test > Test Explorer)
- Click "Run All Tests" to run the unit tests
Troubleshooting
Common Issues
- Missing References: Make sure your
local.build.props
file has the correct paths to game assemblies - Build Errors: Check that you have the correct .NET Standard version installed
- Deployment Errors: Verify your game paths in the
local.build.props
file
Getting Help
If you encounter issues while building the project, feel free to:
- Check the GitHub issues to see if it's a known problem
- Ask for help in the Schedule 1 Modding Discord server
- Create a new issue with details about your problem