Skip to content

Your first mod

GeoPlayerRu edited this page Apr 13, 2021 · 2 revisions

Your first steps

So, you want to create your first mod. What you have to do?
First of all, it'd be better if you will have opened our wiki and Unity Manual
Then you can create folder with your mod and go to "manually" section
Now, you can start creating mod.

How to create mod manually?

So you've already created a folder where your mod will be stored, right? Now you need 3 main files:

  • Metafile
  • C# scripts
  • Image

Metafile is for compiler. It stores name of author, version and so on.
More about ModData.

C# Scripts in metafile are that scripts, that game compiles.

Image is for thumbnail. Other images can be loaded through code.

So, lets start.
First of all, we need to use libraries.

using UnityEngine;

Then, we need to define a class...

public class YourMod : MonoBehaviour
{

}

...and define Main() function.

public static void Main()
{
}

In total, we have this:

using UnityEngine;

public class TemplateMod : MonoBehaviour
{
    public static void Main()
    {
    }
}

How to do that?

How to create connection point?

It's pretty simple. Just use AddConnection from Utility

How to use connection point?

It is as you wish, everything is in your hands! But, there is example:

output = Utility.AddConnection(//что-нибудь)
output.OnValueChanged += () =>
{
//код
}

Use of connection points you can in Connection System.

How to use Update() and etc.?

Create script, and use AddComponent<YourScript>();

Clone this wiki locally