Modding:Mod Configuration: Difference between revisions

Add manifest dependencies & directories from upcoming beta
m Rm beta disclaimer
 
(14 intermediate revisions by 2 users not shown)
Line 17: Line 17:
|-
|-
| '''ID'''
| '''ID'''
| Internal ID of the mod, primarily used for generating files such as <code>modcheck-[id].json</code> when the mod is approved.<br/>Try to restrict the ID to alphanumeric characters, as different operating systems will refuse certain characters for their file names. ||
| Primary identifier of the mod, this is used as the mod's key in the mod manager and to resolve it as a dependency of another mod.<br/>Try to restrict the ID to alphanumeric characters, as it is also used as a symbol for preprocessor directives when compiling. ||
* Falls back to [[#config.json|<code>config.json</code>'s]] <code>ID</code> field.
* Falls back to [[#config.json|<code>config.json</code>'s]] <code>ID</code> field.
|-
|-
| '''LoadOrder'''
| '''LoadOrder'''
| Whole number indicating the mod's load priority in ascending order: smaller values load before larger ones.<br/>E.g. a mod with a loadorder of <code>-1</code> loads before one with <code>1</code>.<br/><b>Obsolete in favor of <code>Dependencies</code> with version 1.1.0.</b> ||
| Whole number indicating the mod's load priority in ascending order: smaller values load before larger ones.<br/>E.g. a mod with a loadorder of <code>-1</code> loads before one with <code>1</code>.<br/><b>Obsolete in favor of <code>Dependencies</code> with build 210.</b> ||
* Falls back to [[#config.json|<code>config.json</code>'s]]'s <code>LoadOrder</code> field.
* Falls back to [[#config.json|<code>config.json</code>'s]]'s <code>LoadOrder</code> field.
|-
|-
Line 49: Line 49:
|-
|-
| '''Dependencies'''
| '''Dependencies'''
| ID-Version pair collection of mods that are required to load before this one.<br/><b>New in version 1.1.0.</b>||
| ID-Version pair collection of mods that are required to load before this one.<br/><b>New in build 210.</b>||
* Accepts [[Modding:Mod Configuration#Version Ranges|version ranges]].
* Accepts [[Modding:Mod Configuration#Version Ranges|version ranges]].
|-
|-
| '''Dependency'''
| '''Dependency'''
| Shorthand to declare a single mod dependency of any version, mutually exclusive with <code>Dependencies</code> field.<br/><b>New in version 1.1.0.</b>||
| Shorthand to declare a single mod dependency of any version, mutually exclusive with <code>Dependencies</code> field.<br/><b>New in build 210.</b>||
|-
| '''LoadBefore'''
| A single or array of mod IDs that this mod should attempt to load earlier than.<br/><b>New in build 210.</b>||
|-
| '''LoadAfter'''
| A single or array of mod IDs that this mod should attempt to load later than.<br/><b>New in build 210.</b>||
|-
|-
| '''Directories'''
| '''Directories'''
| Array of directory objects that can be loaded conditionally depending on game version or other mods in the load order.<br/>Refer to [[Modding:Mod Configuration#Directory Structure|directory structure]] for directory properties.<br/><b>New in version 1.1.0.</b>||
| Array of directory objects that can be loaded conditionally depending on game version or other mods in the load order.<br/>Refer to [[Modding:Mod Configuration#Directory Structure|directory structure]] for directory properties.<br/><b>New in build 210.</b>||
* Falls back to loading the entire mod if undefined.
* Falls back to loading the root directory if undefined.
|}
|}


==Directory Structure==
==Directory Structure==
{{Betamoddingcontent}}
Each entry in the <code>Directories</code> array will be evaluated and loaded if optional conditions such as version and dependency match.<br/>
Each entry in the <code>Directories</code> array will be evaluated and loaded if optional conditions such as version and dependency match.<br/>
These can be used to include separate content/scripts for different game versions, or optional addons to other mods.
If no conditions are specified the directory and its paths will always be loaded.<br/>
Directories can be used to include separate content/scripts for different game versions, or optional addons to other mods.<br/>
If none are explicitly defined the mod's root directory will be loaded.
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 71: Line 78:
|-
|-
| '''Paths'''
| '''Paths'''
| Array of paths to load, relative to the mod's root directory.<br/>Each path is deduplicated and only loaded once, even if a parent or sub directory is defined at any point.<br/>Be mindful of the fact that paths are <b>case-sensitive</b> on some operating systems. ||
| Array of paths to load, relative to the mod's root directory. Any leading or trailing separators are optional.<br/>Each path is deduplicated and only loaded once, even if a parent or sub directory is defined at any point.<br/>Be mindful of the fact that paths are <b>case-sensitive</b> on some operating systems. ||
* Prohibited from escaping the mod directory.
* Prohibited from escaping the mod directory.
* Recursive.
|-
|-
| '''Path'''
| '''Path'''
Line 93: Line 101:
| '''Dependency'''
| '''Dependency'''
| Shorthand to declare a single mod dependency of any version, mutually exclusive with <code>Dependencies</code> field.||
| Shorthand to declare a single mod dependency of any version, mutually exclusive with <code>Dependencies</code> field.||
|-
| '''Options'''
| A single or array of [[Modding:Options|options]] <code>Requires</code> strings that must be true.<br/>Note that the XML file containing the referenced options is required to have <code>Option</code> somewhere in its file name.<br/>This is a quirk caused by populating the option defaults prior to directory initialization. ||
|}
|}


==Version Ranges==
==Version Ranges==
{{Betamoddingcontent}}
To match a game or mod's version you'll define a range of acceptable values using a simple and familiar syntax.<br/>
To match a game or mod's version you'll define a range of acceptable values using a simple and familiar syntax.<br/>
Any number left undefined will behave as if substituted with <code>*</code>.
Any number left undefined will behave as if substituted with <code>*</code>.
Line 103: Line 113:
* <code>2.0.208 - 3.0.0</code>: Matches a version greater or equal to <code>2.0.208</code>, and less or equal to <code>3.0.0</code> (i.e. an inclusive closed interval).
* <code>2.0.208 - 3.0.0</code>: Matches a version greater or equal to <code>2.0.208</code>, and less or equal to <code>3.0.0</code> (i.e. an inclusive closed interval).
* <code>2.0.209.52 - *</code>: Matches a version greater or equal to <code>2.0.209.52</code>.
* <code>2.0.209.52 - *</code>: Matches a version greater or equal to <code>2.0.209.52</code>.
* <code><nowiki>>3.5</nowiki></code>: Matches a version greater than <code>3.5.0</code>.
* <code><nowiki>>3.5</nowiki></code>: Matches a version greater or equal to <code>3.6.0</code>.
* <code><nowiki>>=2 <5</nowiki></code>: Matches a version greater or equal to <code>2.0.0</code>, but less than <code>5.0.0</code>.
* <code><nowiki>>=2 <5</nowiki></code>: Matches a version greater or equal to <code>2.0.0</code>, but less than <code>5.0.0</code>.
* <code><nowiki>^0.5.2 || 7.2.1</nowiki></code>: Matches a version greater or equal to <code>0.5.2</code>, but less than <code>0.6.0</code>. <b>Or</b> a version equal to <code>7.2.1</code>.
* <code><nowiki>^0.5.2 || 7.2.1</nowiki></code>: Matches a version greater or equal to <code>0.5.2</code>, but less than <code>0.6.0</code>. <b>Or</b> a version equal to <code>7.2.1</code>.
Line 121: Line 131:
     "Tags": "Creature",
     "Tags": "Creature",
     "PreviewImage": "preview.png",
     "PreviewImage": "preview.png",
    "LoadBefore": "SightlessFray",
    "LoadAfter": [ "Tamago_PlatypusCommune", "ChromeGarlands" ],
     "Dependencies": {
     "Dependencies": {
         "Pyovya_SaltOrphan": "1.0.0 - *"
         "Pyovya_SaltOrphan": "1.0.0 - *"
     },
     },
     "Directories": [
     "Directories": [
        {
            "Paths": [ "/Common/", "/Assets/Textures/" ]
        },
         {
         {
             "Path": "/Old/",
             "Path": "/Old/",
Line 130: Line 145:
         },
         },
         {
         {
             "Paths": ["/NewCS/", "/NewXML/"],
             "Paths": [ "/NewCS/", "/NewXML/" ],
             "Build": ">=2.0.209.43"
             "Build": ">=2.0.209.43"
         },
         },
Line 136: Line 151:
             "Path": "/GooeyAddon/",
             "Path": "/GooeyAddon/",
             "Version": ">=1.0.0",
             "Version": ">=1.0.0",
            "Options": [ "OptionSnapjawMage_AddGooeyIck == Yes", "OptionSound != No" ],
             "Dependencies": {
             "Dependencies": {
                 "Momo_CyberneticGenders": "^2.*",
                 "Momo_CyberneticGenders": "^2.*",
Line 143: Line 159:
         {
         {
             "Path": "/SaltAddon/",
             "Path": "/SaltAddon/",
            "Option": "OptionSnapjawMage_AddRiotSalt == Yes",
             "Dependency": "Yarif_RiotCooking"
             "Dependency": "Yarif_RiotCooking"
         }
         }