Skip to content

Instantly share code, notes, and snippets.

@copygirl
Last active June 7, 2018 22:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save copygirl/5804bdbb579b246d6c4fb66ad9389b47 to your computer and use it in GitHub Desktop.
Save copygirl/5804bdbb579b246d6c4fb66ad9389b47 to your computer and use it in GitHub Desktop.

Vintage Story 1.5.3

Mod updating guide

With version 1.5.3, there will be a few changes made to how mods are loaded, aiming at improving modding for the future, especially inter-mod dependencies. As a result, mods might be incompatible with previous versions.

TL;DR: Update example with CarryCapacity.

modinfo.json changes

  • Added modid property, which is optional. If not specified, will use the name as mod ID, except lowercased and stripped of special characters. So My Cool Mod! becomes mycoolmod.
  • version now expects a proper SemVer version string and will complain with a warning if it finds you were naughty. This is important as it will help dependency checking.
  • author string has been replaced with authors string array.
  • contributors string array has been added which works the same as authors.
  • gameversions was replaced by dependencies, which allows you to specify multiple "<modid>": "<version>" entries, allowing for multiple dependencies. Similar with version, this expects a single, minimum SemVer version string. You can use an empty string to mean "any version".
{
    "type": "code",
    "name": "CarryCapacity",
    "modid": "carrycapacity",
    "version": "0.3.0",

    "description" : "Adds the capability to carry various things",
    "website": "https://github.com/copygirl/CarryCapacity",
    "authors": [ "copygirl" ],

    "dependencies": {
        "game": "1.5.3"
    }
}

ModBase is now ModSystem

There has been some confusion regarding what clarifies as a "Mod". Previously, ModBase contained some methods that made it seem like it was the main entry for a mod, when in reality you could have multiple ModBase instances per mod. The official survival and creative content mods made use of this.

As such, ModBase has been replaced with ModSystem. A code mod may ship with just one, or multiple of these "systems". If you want, use these to separate different logical parts of your mod that could function on their own.

  • GetModInfo, GetModID and GetModDependencies were removed.

  • ModInfoAttribute and ModDependencyAttribute have been added. They're attributes that can be applied to the mod's assembly. The dependency attribute can be applied multiple times. Just add something similar to the following to one of your source files.

    Using these attributes is optional, and if a modinfo.json is found alongside the mod, that will be used instead. It's mostly meant for single-file .cs and .dll code mods.

[assembly: ModInfo( "CarryCapacity", "carrycapacity",
    Description = "Adds the capability to carry various things",
    Website     = "https://github.com/copygirl/CarryCapacity",
    Authors     = new []{ "copygirl" })]
[assembly: ModDependency( "game", "1.5.3" )]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment