Skip to content

Beginners Guide to Modding

Khanx edited this page Feb 17, 2023 · 14 revisions

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 (.NET Framework) and the Framework of .NET Framework 4.8 (It can be lesser)

Create.project.mp4

Step 3: Add the required References

Right click on References and select Add Reference...

Add Reference

In the new windows 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

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"
			]
	}
]