Kingdom Come Deliverance modder
npm install kcd-modderThe plugins are small js files with the modifications to the XML files. This modder applies those modifications and creates the mods.
When multiple plugins use the same file, this modder automatically puts all those plugins in the same mod.
bash
npm install kcd-modder
`Usage
`js
const modKingdomCome = require('kcd-modder')const gameDir = 'C:\\Program Files\\Steam\\SteamApps\\common\\KingdomComeDeliverance'
const plugins = [
modKingdomCome.plugins['more-hares'],
{
name: 'alternate-food-spoil',
files: [
{
file: 'Libs/Tables/item/food.xml',
pakFile: null,
modifyFile: async (doc, { findDeep, setAttr }) => {
const rows = findDeep(doc.documentElement, { name: 'row', attr: { decay_time_hours: '' } })
if (!rows.length) throw new Error(
[alternate-food-spoil][Libs/Tables/item/food.xml] Error: rows with attribute decay_time_hours not found) for (const row of rows) {
setAttr(row, 'decay_time_hours', '0')
}
}
}
]
}
]
modKingdomCome(gameDir, plugins).catch(error => console.error('KCD Modder Error', error))
``