Mod generation tool for Civilization 7.
- [x] Mod info
- [x] Import custom files
- [x] Localization
- [x] English
- [x] Units
- [x] Civilizations
- [x] Civilization unlocks
- [x] Leader unlocks
- [x] Constructibles
- [x] Base building
- [x] Improvement
- [x] Unique quarter
- [x] City names
- [x] Civics
- [x] Traditions
- [x] Game Effects
- [ ] Great People nodes(+builder?)
- [ ] AI nodes(+builder?)
- [ ] Localization/Internalization
- [ ] Unit abilities nodes(+builder?)
- [ ] Wonder nodes(+builder?)
- [ ] ???
Download repo ZIP file or clone:
clone https://github.com/izica/civ7-modding-tools
build.ts contains all the necessary code to get started, so you can begin by modifying it to fit your needs. Also you can copy an example from the examples folder into build.ts.
Then, run the following commands:
npm install
npm run build
npm install civ7-modding-tools
import { Mod } from 'civ7-modding-tools';
// or you can import from 'civ7-modding-tools/src' for full typescript source
let mod = new Mod({
id: 'test-mod',
version: '1',
});
/* ... */
mod.build('./dist');
To build mod you need to run your script with node.js
or tsx
;
tsx build.ts
const mod = new Mod({
id: 'mod-test',
version: '1',
});
const unit = new UnitBuilder({
actionGroupBundle: ACTION_GROUP_BUNDLE.AGE_ANTIQUITY,
typeTags: [UNIT_CLASS.RECON, UNIT_CLASS.RECON_ABILITIES],
unit: {
unitType: 'UNIT_CUSTOM_SCOUT',
baseMoves: 2,
baseSightRange: 10,
},
unitCost: { cost: 20 },
unitStat: { combat: 0 },
unitReplace: { replacesUnitType: UNIT.SCOUT },
visualRemap: { to: UNIT.ARMY_COMMANDER },
localizations: [
{ name: 'Custom scout', description: 'test description' }
],
});
mod.add([unit]).build('./dist');
const mod = new Mod({
id: 'mod-test',
version: '1',
});
const unit = new UnitNode({
unitType: 'UNIT_CUSTOM_SCOUT',
baseMoves: 2,
baseSightRange: 10,
})
const database = new DatabaseNode({
types: [
new TypeNode({ type: unit.unitType, kind: KIND.UNIT })
],
units: [unit]
});
const unitFile = new XmlFile({
path: `/units/${unit.unitType}.xml`,
name: 'unit.xml',
content: database.toXmlElement(),
actionGroups: [ACTION_GROUP.AGE_ANTIQUITY_CURRENT],
actionGroupActions: [ACTION_GROUP_ACTION.UPDATE_DATABASE]
});
mod.addFiles([unitFile]).build('./dist');