Beginners Guide to Modding - pipliz/ColonySurvival GitHub Wiki
Before starting to create mods it is recommended to have previous experience in programming.
Step 1: Install Visual Studio
Download Visual Studio Here! You will want Visual Studio Community 2019 / 2022. It's free.
When installing select the option of Desktop Development in .NET (or similar, if you have questions, ask on the discord)
Step 2: Create a Project
Create a new project with the template of Class Library:
and the Target Framework of .NET Standard 2.1:
Step 3: Add the required References
Right click on References and select Add Reference...
In the new window select Browse... (bottom right)
Navigate to the game folder in which the dll of the game are located:
...\Steam\steamapps\common\Colony Survival\colonyserver_Data\Managed
Add the following DLL:
- Assembly-CSharp.dll
- UnityEngine.dll
Note: Depending on what your mod makes you need more dll files, VS will tell you when you need to add more.
Step 4: Type your code
Type your code (other tutorial) and compile
The result of this step is a .dll file
Step 5: Add your DLL to your mod
In order to your mod to detect your dll file you need to modify the modInfo.json of your mod and indicate the location of your dll with the dllpath key.
For Example:
[
{
"name": "TunnelDigger",
"version": "0.1.0.5",
"description" : "New type of digger.",
"enableddefault" : true,
"dllpath": "TunnelDigger.dll",
"compatibleversions":
[
"0.9.0"
]
}
]