Modding:Mod Packaging

From Vintage Story Wiki
Revision as of 12:24, 4 March 2018 by Stroam (talk | contribs)

Zip Files

To make your mod easy to install and use, it should be packed into a zip file. Any assets (images, .json files, etc) go in a "assets" directory in the root of the zip, any C# DLLs (and optionally, PDB files) go directly into the zip file root as well.

Please note that if you have a code mod that has no assets (AKA, your mod is a single C# DLL), it is possible to ship the bare DLL without packing it into a zip. This is not really a good idea though, as when distributed this way it is hard to include a PDB file and downloading DLLs directly in Windows can lead to issues with your mod failing to load due to security policies applied to files downloaded from the internet.

Info file

Every zip-file mod requires a modinfo.json 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 (modinfo.json):

{
  "type": "content",
  "name": "My Example Content Mod",
  "description" : "This is an example mod, which does nothing",
  "author": "CreativeMD",
  "version": "1.0",
  "gameversions": [ "1.5.0.3+" ],
  "website": "http://example.com"
}

  "type": "content",

Besides "type": "content", there is also "type": "theme" and "type": "code".

  • "type": "content": Defines this mod as being a ContentMod. Therefore it cannot any scripts or mod classes (it might contain some, but they will be ignored).
  • "type": "theme": 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.
  • "type": "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.
  "gameversions": [ "1.5.0.3+" ],

Means it requires at least VintageStory v1.5.0.3 or a newer version.

Icon

The file modicon.png (if it exists) will be used and shown in the mod manager menu.

Example Mod.png

Distribution

Feel free to share your creation in our forums. We would love to see what you come up with.


Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.