2️⃣Writing code

Writing code is the main thing in creating a mod

First, you need to create a main class, its name can be different, but I recommend calling it "Mod" or "Mod name - for example, TestMod":

After creating the main class, you need to download the mod development dependency, you can download it here.

After downloading, unzipping, and moving to a place convenient for you, I recommend creating a folder "Outpath First Journey" in documents and moving the dependencies folder there

Once you have completed all the previous steps, you can go to the project, now you need to add the dependencies you need, now we will add the most important dependencies:

  • Brief installation instructions Outpath-Modding.dll

  • All others namely "Assembly-CSharp.dll, Assembly-CSharp-firstpass.dll, UnityEngine.dll" need to be added by yourself. If you don't know how to do this, see the second method to add "Outpath- Modding.dll"

Now you need to create a class for the configs. For simplicity, I recommend calling it "Config":

Once created, open it and write the following code:

using Outpath_Modding.API.Config;

namespace TestMod
{
    public class Config : IConfig
    {
        public bool Enable { get; set; } = true;
    }
}

Now we return to the main class and write this code there:

using Outpath_Modding.API.Mod;
using System;

namespace TestMod
{
    public class TestMod : Mod<Config> // Instead of "Config" should be the name of the config class, I have "Config"
    {
        public override string Author { get; set; } = "Me";
        public override string Name { get; set; } = "Test Mod";
        public override Version Version { get; set; } = new Version(0, 0, 1);

        public static TestMod Instance;

        public override void OnLoaded()
        {
            Instance = this;
            base.OnLoaded();
        }
    }
}

Congratulations, your mod template is ready, now you can start looking at APIs, event handling, and more!

Last updated