-
Notifications
You must be signed in to change notification settings - Fork 3
How to develop mods
- Visual studio Community
- .NET Framework >= 4.6.1
- Download mod loader version that you want
Open Visual studio Community
and create a new project of type "Bclass library(.NET Framework)"
Now configure the project with the name of your mod and the version of .net you want
In the project folder create a folder called "Dependencies" and inside put a .gitignore
file with the following content
*
!.gitignore
This is to avoid uploading the dlls to the repository. Followed by that place within "Dependencies" at least the files Assembly-CSharp.dll
, Modloader.dll
, UnityEngine.dll
,0Harmony.dll
and UnityEngine.CoreModule.dll
.
Now add the references of these files in the Visual studio Community
Now in your main class make it extend SFSMod
and implement its methods, and you should be left with something like this:
using ModLoader;
using System;
using UnityEngine;
namespace ModTest
{
public class Class1 : SFSMod
{
public Class1() : base(
"testid", // Mod id
"Test mod", // Mod Name
"auhtor", // Mod Author
"v1.1.x", // Mod loader version
"v1.0.0" // Mod version
)
{
}
public override void load()
{
Debug.Log("Test Mod");
// do stuff here
}
public override void unload()
{
throw new NotImplementedException();
}
}
}
Finally compile your project to generate a dll file and place it in the MODS folder following the same steps as if you were going to install one more mod.
Note: just copy the dll file of your mod and not the dependencies
- Modloader Installation
- Mods Installation
- How to develop mods
- Code Documentation