1.3.0 • Published 4 months ago
civ7-modding-tools v1.3.0
izica`s civ7 modding tools
Mod generation tool for Civilization 7.
Currently state
Done
- Mod info
- Import custom files
- Localization
- English
- Units
- Civilizations
- Civilization unlocks
- Leader unlocks
- Constructibles
- Base building
- Improvement
- Unique quarter
- City names
- Civics
- Traditions
- Game Effects
Working on
- Great People nodes(+builder?)
Todo
- AI nodes(+builder?)
- Localization/Internalization
- Unit abilities nodes(+builder?)
- Wonder nodes(+builder?)
- ???
Getting started
Install from repository
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
Install from npm
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
Previews
Use builders for easier and faster mod creation
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');
Full strongly typed
Full control of generation
Possibility of fully manual creation
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');