Building your Mod
This page describes how to make your own custom modification using Visual Studio.
Last updated
This page describes how to make your own custom modification using Visual Studio.
Last updated
You're looking to create a mod for Nitrocid KS! That's great! Make sure that you have Visual Studio installed. Follow the steps to create your first mod.
Press Create a new project
on Visual Studio homepage
Find Class Library
and double-click it
Write your mod name, like in our example, MyFirstMod
.
Make sure that .NET 8.0
is used. Press Create
.
Right-click on Dependencies
-> Manage NuGet Packages
, find KS
, and install it.
Once the package is installed, go to the Class1.cs
source file
Write next to the class file : IMod
and import the required namespace by using Nitrocid.Modifications;
. You should see errors indicating that you have to implement the methods.
After implementation, you should see:
Remove all calls to NotImplementedException
and set the minimum supported API version. Currently, we're at v3.0.25.437
.
Now, implement everything as you wish. Once you're done, follow the steps on how to create a strong name signing key and sign your mod. Then, click on the Build
menu and select Build Solution
.
Once the solution is built, open the file explorer to the solution directory by right-clicking on the solution and selecting Open Folder in File Explorer
.
Navigate to the output directory and copy the .dll
file to KSMods
under the %localappdata%/KS
folder.
Open Nitrocid KS to test your mod. Ensure that modman list
lists your mod.
You will have to turn on kernel modifications from the kernel settings. Navigate to General > Start kernel modifications on boot
and turn it on.
You can also make use of the KSTemplates
repository, which can be installed to Visual Studio using the dotnet new install path/to/KS.Templates.nupkg
command.