Modding:Mod Configuration: Difference between revisions

Jump to navigation Jump to search
More content
(Further changes)
(More content)
Line 3: Line 3:
There are a number of configuration files that can be associated with a mod. They are all placed in the root folder of the mod and are all optional.
There are a number of configuration files that can be associated with a mod. They are all placed in the root folder of the mod and are all optional.


=<code>manifest.json</code>=
By convention, all JSON keys will be referred to using the casing used in the game's code. However, the configuration file keys are case-insensitive.
 
=manifest.json=
[[File:ModManagerMock.png|thumb|right|Mod Manager mock]]  
[[File:ModManagerMock.png|thumb|right|Mod Manager mock]]  
The <code>manifest.json</code> is primarily used for display in the game's Mod Manager.
The <code>manifest.json</code> file is primarily used for display in the game's Mod Manager.


==Structure==
==Structure==
Line 14: Line 16:
! Properties
! Properties
|-
|-
| '''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 your ID to alphanumeric characters, as different operating systems will refuse certain characters for their file names. ||
| 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. ||
* Defaults to <code>config.json</code>'s <code>ID</code> field.
* Falls back to <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>. ||
| 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>. ||
* Defaults to <code>config.json</code>'s <code>LoadOrder</code> field.
* Falls back to <code>config.json</code>'s <code>LoadOrder</code> field.
|-
|-
| '''title'''
| '''Title'''
| Title of the mod, displayed in the mod manager. ||
| Title of the mod, displayed in the mod manager. ||
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
* Defaults to <code>workshop.json</code>'s <code>Title</code> field.
* Falls back to <code>workshop.json</code>'s <code>Title</code> field.
|-
|-
| '''description'''
| '''Description'''
| Short description of the mod, displayed in the mod manager. ||
| Short description of the mod, displayed in the mod manager. ||
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
|-
|-
| '''tags'''
| '''Tags'''
| Comma-delimited list of tags, only for display in the mod manager and has no effect on tags used in the workshop. ||
| Comma-delimited list of tags, only for display in the mod manager and has no effect on tags used in the workshop. ||
* Defaults to <code>workshop.json</code>'s <code>Tags</code> field.
* Falls back to <code>workshop.json</code>'s <code>Tags</code> field.
|-
|-
| '''version'''
| '''Version'''
| Mod's version, displayed in the mod manager. ||
| Mod's version, displayed in the mod manager. ||
|-
|-
| '''author'''
| '''Authors'''
| Creator(s) of the mod. ||
| Creator(s) of the mod. ||
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
* Accepts [[Modding:Text Color Codes & Object Rendering|color shaders]].
|-
|-
| '''previewImage'''
| '''PreviewImage'''
| Relative path to an image used as an icon for the mod in the manager, recommended size 512x512.<br/>The largest Caves of Qud displays on default scale is 128x128, but if also used as the steam workshop preview image, that can display at up to 435x435 on the "Most Popular Items" front page.||
| Relative path to an image used as an icon for the mod in the manager, recommended size 512x512.<br/>The largest Caves of Qud displays on default scale is 128x128, but if also used as the steam workshop preview image, that can display at up to 435x435 on the "Most Popular Items" front page.||
* Defaults to <code>workshop.json</code>'s <code>ImagePath</code> field.
* Falls back to <code>workshop.json</code>'s <code>ImagePath</code> entry.
|}
|}


 
==Example manifest.json==
==Example <code>manifest.json</code>==
An example <code>manifest.json</code>, taken from the [[Modding:Tutorial_-_Snapjaw_Mages|snapjaw mages]] tutorial and modified to demonstrate more of the file's options.
An example <code>manifest.json</code>, taken from the [[Modding:Tutorial_-_Snapjaw_Mages|snapjaw mages]] tutorial.
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
     "id": "Pyovya_SnapjawMage",
     "id": "Pyovya_SnapjawMage",
     "title": "Snapjaw Mages!",
    "loadOrder": 1,
     "description": "Adds the new Snapjaw Mage creature to Caves of Qud.",
     "title": "{{R|Snapjaw}} {{C|Mages}}!",
     "description": "Adds the new {{Y|snapjaw}} {{R|fire}} {{Y|mage}} and {{Y|snapjaw}} {{C|ice}} {{Y|mage}} creatures to Caves of Qud.",
     "version": "0.1.0",
     "version": "0.1.0",
     "author": "Pyovya",
     "author": "{{M|Pyovya}}",
     "tags": "Creature",
     "tags": "Creature",
     "PreviewImage": "preview.png"
     "previewImage": "preview.png"
}
}
</syntaxhighlight>
</syntaxhighlight>


=<code>workshop.json</code>=
=workshop.json=
The <code>workshop.json</code> file configures a mod's upload to the [https://steamcommunity.com/app/333640/workshop/ Caves of Qud Steam Workshop]. It is usually manipulated through the game's Workshop Uploader.


==Structure==
{| class="wikitable"
|-
! Field
! style="width: 65%" | Description
! Properties
|-
| '''WorkshopId'''
| The mod's unique ID on the workshop. ||
|-
| '''Title'''
| Title of the mod, displayed on the workshop. ||
|-
| '''Description'''
| Description of the mod, displayed on the workshop. ||
* Accepts [https://steamcommunity.com/sharedfiles/filedetails/?id=2807121939 formatting tags].
|-
| '''Tags'''
| Comma-delimited list of tags, displayed on the workshop. ||
* [https://steamcommunity.com/app/333640/workshop/ Pre-defined tags] can be filtered on.
|-
| '''Visibility'''
| Stringed integer, detailing the mod's visibility on the workshop.
* <code>"0"</code>: The mod is private (visible only to the mod's creator).
* <code>"1"</code>: The mod is visible to friends only.
* <code>"2"</code>: The mod is public.
||
|-
| '''ImagePath'''
| Relative path to an image used as an icon for the mod in the workshop, recommended size 512x512.
||
|}
==Example workshop.json==
An example <code>workshop.json</code> for the [[Modding:Tutorial_-_Snapjaw_Mages|snapjaw mages]] tutorial mod.
<syntaxhighlight lang="json">
{
  "WorkshopId": 708258860,
  "Title": "Snapjaw Mages",
  "Description": "[h1]Snapjaw Mages[/h1]\n\nThis mod adds the new [b]Snapjaw Mage[/b] creature to Caves of Qud.",
  "Tags": "Creatures",
  "Visibility": "2",
  "ImagePath": "Preview.png"
}
</syntaxhighlight>
=modconfig.json=
The <code>modconfig.json</code> file configures a mod's properties for all textures located within the mod's folder.
==Structure==
{| class="wikitable"
|-
! Field
! style="width: 65%" | Description
! Properties
|-
| '''ShaderMode'''
| An integer representing the mod's textures' shader mode.
* <code>0</code>: The [[Modding:Tiles#Tile_Format|default]] texture shader.
* <code>1</code>: The [[Modding:Tiles#True_Color_tiles|true color]] texture shader.
||
|-
| '''TextureWidth'''
| The width of the mod's textures, in pixels.
||
|-
| '''TextureHeight'''
| The height of the mod's textures, in pixels.
||
|}
==Example modconfig.json==
An example <code>modconfig.json</code>.
<syntaxhighlight lang="json">
{
  "shaderMode": 0,
  "textureWidth": 16,
  "textureHeight": 24
}
</syntaxhighlight>


=config.json=
The <code>config.json</code> file was obsoleted in version [[Version_history/2020#201.44|2.0.201.44]] and was subsumed by the <code>manifest.json</code> file.


[[Category:Modding]]
[[Category:Modding Resources]]
{{Modding Navbox}}
{{Modding Navbox}}

Navigation menu