Create a mod
Last updated
Last updated
There are two options: create from mod template or from empty folder.
If you know how to use git and have SSH Key configured on Github, just execute the command under GAMEPATH/Mods
Otherwise, download ModTemplate, and unzipped it under the folder GAMEPATH/Mods
.
Then your folder structure should be like this. Pay attention to directory.
There are several files neccessary to modify
mod.json
Modify value of "name" to mod name, "author" to author name. "GUID" to global unique ID of your mod(Determine the ID by yourself to avoid collision with other mods)
ModClass.cs
Modify "CHANGEME" to your mod's namespace, and avoid collision with other mods
Then initialize your mod in OnModLoad
in file ModClass.cs
. BasicMod
inherits from MonoBehaviour
, you can implement other methods of MonoBehaviour
like Update
.
Create a folder under GAMEPATH/Mods
, create such two files mod.json
and Main.cs
like below.
If you use IDE, you should create a .Net Framework4.8
project under GAMEPATH/Mods
and then create the two files mod.json
and Main.cs
below. You can create the project through IDE or write it manually refer to Configure your IDE manually
Add references to your project. Or you can find the .csproj
example in ExampleMod.csproj(DO NOT COPY ALL DIRECTLY. YOU SHOULD DISTINGUISH WHAT IS USABLE)
You have made a simplest mod now. Launch WorldBox now.
If there are no problems above, you can find this in console:
And you can also find your mod in "Mods" window provided by NML.