FANDOM


Step 1: Install Visual Studio Edit

Download [Visual Studio Here!](https://www.visualstudio.com/downloads/) You will want Visual Studio Community 2017. It's free. Once downloaded install it. Mods require knowledge of C#!

Step 2: Create a Project (commit suicide) Edit

Open Visual Studio. Go to File -> New -> Project.

Mods for Colony Survival are .Net 3.5 DLL's. In the new project screen you want to select the following: !

Mod tut image 1

Step 3: Add the required References Edit

you will need to Right click on your project, select Add -> References. !

Mod tut 2

You can find the required DLL's Here: !

Tutorial Image 3

Once you have the DLL's selected you should see them under the References tree in your project. !

Tutorial Image -4

Step 4: Making the game Find your mod Edit

In order for the game to see your mod you need 2 things 1 is the modinfo.json, in there you tell the game what DLL to load in. ```JSON

     {
       "assemblies": [
         {
           "path": "MyModFoobar.dll",
           "name": "MyModFoobar",
           "enabled": true,

"compatibleversions": [

             {
               "Major": 0,
               "Minor": 3,
               "Build": 1
             }
             ]
         }
       ]
     }

``` The other is in your DLL, any method that has a Modloader.ModCallback, the class must have the [ModLoader.ModManager] attribute ```c#

   [ModLoader.ModManager]
   public static class GameLoader
   {
       public static string ICON_FOLDER_PANDA_REL = @"gamedata\mods\Pandaros\settlers\icons";
       public static string LOCALIZATION_FOLDER_PANDA = @"gamedata\mods\Pandaros\settlers\localization";
       public static string MOD_FOLDER = @"gamedata\mods\Pandaros\settlers";
       public const string NAMESPACE = "Pandaros.Settlers";
       [ModLoader.ModCallback(ModLoader.EModCallbackType.OnAssemblyLoaded, NAMESPACE + ".OnAssemblyLoaded")]
       public static void OnAssemblyLoaded(string path)
       {
           MOD_FOLDER = Path.GetDirectoryName(path);
           PandaLogger.Log("Found mod in {0}", MOD_FOLDER);
           LOCALIZATION_FOLDER_PANDA = Path.Combine(MOD_FOLDER, "localization");
           ICON_FOLDER_PANDA_REL = Path.Combine(MOD_FOLDER, "icons");
       }

``` The ModLoader.ModCallback has 2 arguments. 1. The Enum [ModLoader.EModCallbackType](https://github.com/pipliz/ColonySurvival/wiki/Mod-API-Callbacks) - This tells the game when to call this method. See The "Colony Survival\gamedata\mods" Help.txt for more information about the callbacks and their parameters. 2. The indexed name of the callback. This should include your namespace so you do not interfere with any other mods.