I'm happy to post an example of a gameplay mod that renames the Egyptian Medjay UU to Uber-Medjay and gives them 100 strength.
The mod also shows an example of basic localization use as the mod shows a different name if your game is set to German
To install the mod, it should be sufficient to extract the archive into the Mods subfolder of your Civ7 folder. The actual activation happens by setting things in the Mods.sqlite database but that seems to be automatic when the game detects a new valid mod.
Disclaimer: I am using the Linux build, which should behave the same as the Windows build but who knows.
(Per Gedemon, the Windows Mods folder is at "{user}\AppData\Local\Firaxis Games\Sid Meier's Civilization VII\")
Civ 7 uses the module feature for defining parts of gameplay. Each age is a module, the launch DLCs are modules, and mods are also modules. Correspondingly, the most important part of the mod is the .modinfo definition file
Note that the mod id is set to solver-example at the start, which is important and should be unique.
The mod is going to update an Antiquity unit, but that's only possible when the game is actually in Antiquity. If you're in Age 2 or 3, Medjay aren't even present in the game data, so it'd be an error to update them. As such, the mod defines two criteria for its actions: antiquity-age-current to check if we're in Antiquity, and always to run always.
In the always case, we update the gameplay database with data/units.xml. If we're in Antiquity, we additionally update the text from text/en_us/UnitText.xml. [I think it would work fine to update the non-existent Medjay in other ages as well, but it's not a clean practice].
The strength update for the Medjay is simple:
Equivalent to an SQL query, UPDATE Unit_Stats SET Combat=100 WHERE UnitType='UNIT_MEDJAY'
The Text update is, interestingly, not the same kind of update, rather you replace a whole row:
There it is - a totally useless mod that can serve as a simple template for mods that alter existing gameplay properties.
The mod also shows an example of basic localization use as the mod shows a different name if your game is set to German
To install the mod, it should be sufficient to extract the archive into the Mods subfolder of your Civ7 folder. The actual activation happens by setting things in the Mods.sqlite database but that seems to be automatic when the game detects a new valid mod.
Disclaimer: I am using the Linux build, which should behave the same as the Windows build but who knows.
(Per Gedemon, the Windows Mods folder is at "{user}\AppData\Local\Firaxis Games\Sid Meier's Civilization VII\")
Civ 7 uses the module feature for defining parts of gameplay. Each age is a module, the launch DLCs are modules, and mods are also modules. Correspondingly, the most important part of the mod is the .modinfo definition file
XML:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="solver-example" version="1"
xmlns="ModInfo">
<Properties>
<Name>LOC_MODULE_SOLVER_EXAMPLE</Name>
<Description>This is a sample mod.</Description>
<Authors>Solver</Authors>
<ShowInBrowser>1</ShowInBrowser>
<Package>SolverMods</Package>
</Properties>
<Dependencies>
<Mod id="age-antiquity" title="LOC_MODULE_AGE_ANTIQUITY_NAME"/>
</Dependencies>
<ActionCriteria>
<Criteria id="always">
<AlwaysMet/>
</Criteria>
<Criteria id="antiquity-age-current">
<AgeInUse>AGE_ANTIQUITY</AgeInUse>
</Criteria>
</ActionCriteria>
<ActionGroups>
<ActionGroup id="solver-mod-actions" scope="game" criteria="always">
<Actions>
<UpdateDatabase>
<Item>data/units.xml</Item>
</UpdateDatabase>
</Actions>
</ActionGroup>
<ActionGroup id="solver-mod-text" scope="game" criteria="antiquity-age-current">
<Actions>
<UpdateText>
<Item>text/en_us/UnitText.xml</Item>
</UpdateText>
</Actions>
</ActionGroup>
</ActionGroups>
<LocalizedText>
<File>text/en_us/SolverText.xml</File>
<File>l10n/SolverText.xml</File>
</LocalizedText>
</Mod>
Note that the mod id is set to solver-example at the start, which is important and should be unique.
The mod is going to update an Antiquity unit, but that's only possible when the game is actually in Antiquity. If you're in Age 2 or 3, Medjay aren't even present in the game data, so it'd be an error to update them. As such, the mod defines two criteria for its actions: antiquity-age-current to check if we're in Antiquity, and always to run always.
In the always case, we update the gameplay database with data/units.xml. If we're in Antiquity, we additionally update the text from text/en_us/UnitText.xml. [I think it would work fine to update the non-existent Medjay in other ages as well, but it's not a clean practice].
The strength update for the Medjay is simple:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Database>
<Unit_Stats>
<Update>
<Where UnitType="UNIT_MEDJAY"/>
<Set Combat="100"/>
</Update>
</Unit_Stats>
</Database>
Equivalent to an SQL query, UPDATE Unit_Stats SET Combat=100 WHERE UnitType='UNIT_MEDJAY'
The Text update is, interestingly, not the same kind of update, rather you replace a whole row:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Database>
<EnglishText>
<Replace Tag="LOC_UNIT_MEDJAY_NAME">
<Text>Uber-Medjay</Text>
</Replace>
</EnglishText>
</Database>
There it is - a totally useless mod that can serve as a simple template for mods that alter existing gameplay properties.
Attachments
Last edited: