Creating your first mod

This tutorial expects that you know some basic lua concepts (functions, variables, etc) and have a good understanding of file structures.

To begin, create a new folder. Name it whatever you want to call your mod. All your mod files will go in here, we’ll refer to it as the root folder from here on.

Ideally, you will have at least 4 files in here.

FileDescription
modmain.luaContain executable code. Will run when your mod is activated
modinfo.luaContain information on your mod, such as version number and name, as well as mod configuration options
modicon.texMod icon texture file, contains image data
modicon.xmlMod icon xml file contains xml data determining names and dimensions of textures

Let’s create them.

First, make your modinfo.lua. See this page and fill in the required fields accordingly.

Now we need a modicon. Follow the instructions on this page to create your modicon.tex file. Make sure it’s named correctly and placed in your mod’s root folder. Then create your modicon.xml and copy this code to it.

For advanced users, read more on these xml files work.

You now have a basic structure for your mod.

 

Todo: lead to more specific tutorials