Modding:Mod Packaging: Difference between revisions
From Vintage Story Wiki
m (Milo moved page Game Content Mod to Mod Packaging: There is no reason to have three almost identical pages, this one will become the m,aster, the others repurposed.) |
(Added a bit of info about how a mod is packed, and the different mod types,) |
||
Line 1: | Line 1: | ||
== Zip Files == | |||
To make your mod easy to install and use, it should be packed into a [https://en.wikipedia.org/wiki/Zip_(file_format)|zip file]. Any assets (images, .json files, etc) go in a "assets" directory in the root of the zip, any C# DLLs go directly into the zip file root as well. | |||
== Info file == | == Info file == | ||
Every zip-file mod requires a <code>modinfo.json</code> inside the root directory of the archive. Otherwise the entire mod will be ignored. This info file specifies what kind of | Every zip-file mod requires a <code>modinfo.json</code> inside the root directory of the archive. Otherwise the entire mod will be ignored. This info file specifies what kind of mod it is, its name, author, etc. | ||
An example of a theme pack info file (<code>modinfo.json</code>): | An example of a theme pack info file (<code>modinfo.json</code>): | ||
Line 22: | Line 26: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Defines this mod as being a '''ContentMod'''. Therefore it cannot any scripts or mod classes (it might contain some, but | Besides <code>"type": "content"</code>, there is also <code>"type": "theme"</code> and <code>"type": "code"</code>. | ||
* <code>"type": "content"</code>: Defines this mod as being a '''ContentMod'''. Therefore it cannot any scripts or mod classes (it might contain some, but they will be ignored). | |||
* <code>"type": "theme"</code>: Defines this mod as being a '''ThemePack'''. Therefore it cannot override gameplay affecting assets categories (such as blocktypes, itemtypes and so on) and no scripts or mod classes will be loaded. | |||
* <code>"type": "code"</code>: Defines this mod as being a '''CodeMod'''. This is the same as a ContentMod, except it can also load C# code to do things that are not possible with JSON. | |||
<syntaxhighlight lang=json> | <syntaxhighlight lang=json> |