Civilization V Customisation Wikia

JFD's and Pouakai's Mercenaries/Code

< JFD's and Pouakai's Mercenaries

639pages on
this wiki
Add New Page
Comments0 Share

Each leader is accorded a new flavour: Mercenaries. This determines the likelihood that an AI will consider to take out a Mercenary Contract. To add support to this new flavour, please see my Master Support File. If a leader does not have support for this flavour, they will default to a value of 5.

This mod has been designed to be extremly modular; it is very simple to add a new Contract. In what follows, we are going to detail how to make a new Contract. Because Pouakai believes XML is easier, we shall do so in that format.

Adding a New Contract

A new Contract is added not disimilarly to a new Social Policy:














Here, we can see a few familiar tags: Description determines the name of the Contract, Adjective determines the denonym by which its units are known, and Civilopedia is a short blurb about the Contract's givers. Others are intuitive: PromotionType determines the unique promotion that a Contract's units come with[1], Rating determines the quality of that Contract, Turns determine its length, and the PrereqEra and ObsoleteEra tags determine when that Contract becomes available and when it does not[2]. Finally, YieldCost is used to specify whether the Contract should be purchased with Gold (Gold ) or Faith (FaithIcon ).

There are also a few additional tags which are not needed, but which you may wish to make use of: IsSlavery determines whether the Contract's units are slaves (and will become unavailable with Sovereignty's 'Emancipation Reform'), PrereqReligion specifies that the player must have founded a specific religion (or must have a specific State Religion with Piety) before they can take this Contract, and PrereqCivilization specifies that the player must be a specific civilization.

Once the body of your Contract is created, there are two more steps. The first is in assigning what units that Contract should be allowed to offer. This can be specified by a particular unit type, a particular unit class, or a particular combat type. Although you may only choose from one of these, there is no limit to the number of unit types, classes, or combat types that a Contract can pick from.









Here, we are detailing that the Amsaig Contract may choose any unit from the Archer (a.k.a. Ranged) combat type, whilst only picking units from the Melee combat type that belong to a civilization from the Northern culture group. However, if a unit like this cannot be found, it will instead choose a default melee unit. If you instead wish the Contract to become unavailable if this happens, you must set the UseOnlyCultureType tag to true. This tag is available for both the unit classes and the unit combats table.

Finally, to complete your Contract you must create the promotion specified in the JFD_Contracts table above. There is, however, one thing that you must do in this process, and that is to assign that promotion to a specific dialect:





With Cultural Diversity's unit dialogue component, this will override the standard dialogue used by this Contract's units for a unique one. In this case, if we were playing as the Americans, our Amsaig Mercenaries, instead of speaking American English, would speak Celtic.

Note: If you wish to add a new Contract but do not want your mod to depend upon Mercenaries, you will need to copy the tables found under the CONTRACTS heading in Core/Mercenaries_Master.sql.

Modding Costs, Maintenance, and Turns

Finally, there is one other thing that you can modify, and that is the cost, maintenance, and duration of Contracts. In Mercenaries, the Jiayuguan Fort Wonder already increases the length of a Contract's duration, but you may also want to modify the costs and maintenance with one of the following tables:

Building_JFD_ContractModifiers (

BuildingType        text REFERENCES Buildings(Type) default null,

CostModifier        integer                         default 0,

MaintenanceModifier integer                         default 0,

TurnsModifier       integer                         default 0);
Policy_JFD_ContractModifiers (

PolicyType          text REFERENCES Policies(Type) default null,

CostModifier        integer                         default 0,

MaintenanceModifier integer                         default 0,

TurnsModifier       integer                         default 0);
Trait_JFD_ContractModifiers (

TraitType           text REFERENCES Traits(Type)    default null,

CostModifier        integer                         default 0,

MaintenanceModifier integer                         default 0,

TurnsModifier       integer                         default 0);

Simply choose which is most appropriate for your needs, add the CREATE TABLE code above to your mod, and fill in the table itself as per the preceding tutorial.


  1. this promotion is absolutely necessary. If a Contract does not have this filled, it will be ignored.
  2. you may leave ObsoleteEra as null if the Contract does not become obsolete.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.