Hey modders!
In the last update, the format of the loadouts file was changed to require an “ordinal” field, which broke several mods. I’m really sorry about that! However, since compatibility got broken anyway, in the next release (roughly targeted at next Thursday) we’re switching loadouts to an explicitly backward-incompatible format which allows finer customization. The changes are:
- The
loadouts
block is an object rather than an array, and each loadout must be specified under a unique ID (any string is fine, but using your mod name as part of it reduces the likelihood of mod conflicts). This allows mods to override parts of a loadout. - Each loadout can specify an
ordinal
field to determine where in the list it appears. The defaults use ordinals 1-3, and if the ordinal is not specified, it’s assumed to be 0 (i.e. the loadout will appear before the existing ones). - The
content
field in each loadout is also an object rather than an array, and its entries also support theordinal
field with the same meaning. - Kingdoms can specify a custom loadout file to use by specifying a
loadouts
field in their population JSON pointing at a custom loadouts JSON path or URI.
As an example, here’s the loadouts file from the Miner Profession mod converted to the new format:
{
"loadouts": {
"miner_prof:miner": {
"alias": "miner_prof:data:loadouts:load_metal",
"display_name": "i18n(miner_prof:loadouts.load_metal.display_name)",
"description": "i18n(miner_prof:loadouts.load_metal.description)",
"tooltip": "i18n(miner_prof:loadouts.load_metal.tooltip)",
"splash": "file(images/load_metal/splash.png)",
"seal": "file(images/load_metal/seal.png)",
"ordinal": 10,
"content": {
"hammer": {
"ordinal": 1,
"display_name": "i18n(stonehearth:jobs.blacksmith.blacksmith_description.display_name)",
"type": "entity",
"uri": "stonehearth:blacksmith:talisman",
"icon": "file(images/items/blacksmith_hammer.png)",
"amount": 1
},
"pick": {
"ordinal": 2,
"display_name": "i18n(miner_prof:info.name)",
"type": "entity",
"uri": "miner_prof:miner:talisman",
"icon": "file(images/items/iron_pick.png)",
"amount": 1
},
"copper": {
"ordinal": 3,
"display_name": "i18n(miner_prof:loadouts.load_metal.ore)",
"type": "entity",
"uri": "stonehearth:resources:copper:ore",
"icon": "file(images/items/copper_ore.png)",
"amount": 12
},
"tin": {
"ordinal": 4,
"display_name": "i18n(miner_prof:loadouts.load_metal.ore2)",
"type": "entity",
"uri": "stonehearth:resources:tin:ore",
"icon": "file(images/items/tin_ore.png)",
"amount": 12
},
"iron": {
"ordinal": 5,
"display_name": "i18n(miner_prof:loadouts.load_metal.ore3)",
"type": "entity",
"uri": "stonehearth:resources:iron:ore",
"icon": "file(images/items/iron_ore.png)",
"amount": 6
}
}
}
}
}
If you know mods that are affected by this change, please direct their authors to this thread. The ones that I know of are @tim1, @Moai, and @Froggy.