# Writing code

**First, you need to create a main class, its name can be different, but I recommend calling it "***<mark style="color:red;">**Mod**</mark>***" or "***<mark style="color:red;">**Mod name - for example, TestMod**</mark>***":**

<figure><img src="https://1025667649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsgo4Ej2H8mVgMylotdJQ%2Fuploads%2FFkp2nc3cm3yeMAyLvdra%2Fimage_2023-07-19_101045755.png?alt=media&#x26;token=863116c1-e57f-4766-b7b6-978ec006c99f" alt=""><figcaption></figcaption></figure>

**After creating the main class, you need to download the mod development dependency, you can download it** [<mark style="color:orange;">**here**</mark>](https://github.com/Outpath-Modding-Team/Outpath-Dependencies/releases)**.**

**After downloading, unzipping, and moving to a place convenient for you, I recommend creating a folder "***<mark style="color:red;">**Outpath First Journey**</mark>***" in documents and moving the dependencies folder there**

<figure><img src="https://1025667649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsgo4Ej2H8mVgMylotdJQ%2Fuploads%2Fv3AJlnqyqmNSgaZK52tW%2Fimage_2023-07-19_103622002.png?alt=media&#x26;token=94ce7040-90f2-4841-8a1a-e478eab8e884" alt=""><figcaption></figcaption></figure>

**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 [<mark style="color:red;">Outpath-Modding.dll</mark>](https://outpath-modding.gitbook.io/outpath-modding/for-developers/how-to-create-a-mod/writing-code/outpath-modding.dll)
* All others namely "*<mark style="color:red;">Assembly-CSharp.dll</mark>, <mark style="color:red;">Assembly-CSharp-firstpass.dll</mark>, <mark style="color:red;">UnityEngine.dll</mark>*" need to be added by yourself. If you don't know how to do this, see the second method to add ["*<mark style="color:red;">Outpath- Modding.dll</mark>*"](https://outpath-modding.gitbook.io/outpath-modding/for-developers/how-to-create-a-mod/writing-code/outpath-modding.dll)

**Now you need to create a class for the configs. For simplicity, I recommend calling it "***<mark style="color:red;">**Config**</mark>***":**

<figure><img src="https://1025667649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsgo4Ej2H8mVgMylotdJQ%2Fuploads%2FxXgIVxLxftRrqPdlU2h1%2Fimage_2023-07-19_101553542.png?alt=media&#x26;token=41914efb-1697-4132-ba93-3299f2a56798" alt=""><figcaption></figcaption></figure>

**Once created, open it and write the following code:**

```csharp
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:**

```csharp
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!**
