docs/Modders/Unique-parameters.md
This page contains an overview of all different parameters used in uniques and what values can be filled into them. Each of the different parameter types is described below, including all possible values for them. These are split into two categories:
Text that looks like this. This last one must be used exactly the sameNote that all of these are case-sensitive!
All filters except for populationFilter and resourceFilter accept multiple values in the format: {A} {B} {C} etc, meaning "the object must match ALL of these filters"
Example:
[{Military} {Water}] units,[{Wounded} {Armor}] units, etc.
No space or other text is allowed between the [ and the first {, nor between the last } and the ending ]. The space in } {, however, is mandatory.
All filters accept non-[filter] as a possible value
Example:
[non-[Wounded]] units
These can be combined by nesting, with the exception that an "ALL" filter cannot contain another "ALL" filter, even with a NON-filter in between.
Example:
[{non-[Wounded]} {Armor}] unitsmeans unit is type Armor and at full health. Example:[non-[{Wounded} {Armor}]] unitsmeans unit is neither wounded nor an Armor one.
[{non-[{Wounded} {Armor}]} {Embarked}] units WILL FAIL because the game will treat both "} {" at the same time and see non-[{Wounded and Armor}], both invalid.
Display of complex filters in Civilopedia may become unreadable. If so, consider hiding that unique and provide a better wording using the Comment [] unique separately.
Allows filtering for specific civs.
Allowed values:
Human playerAI playerFriendlyHostileOpen BordersKnown - Civilizations that are aware of the relevant Civ. Known includes self.Allows filtering for specific nations. Used by ModOptions.nationsToRemove.
Allowed values:
All, allCity-States, City-StateMajorUnit filters can be divided up into two parts: baseUnitFilters and mapUnitFilters.
The former is tested against the unit as it appears in the json.
This means it doesn't have an owning civ or tile it stands on, just its base properties.
The latter is tested against the unit as it appears on the map, including its nation, tile, health and all other properties.
Allowed values:
Land, Water, Airland units, water units, air unitsnon-air for non-air non-missile unitsMilitary, military unitsCivilian, civilian unitsAll, allMeleeRangedNuclear WeaponGreat PersonEmbarkedModern Era{filter1} {filter2} and can match any number of filters. For example: [{Modern era} {Land}] unitsThis indicates a unit as placed on the map. Compare with baseUnitFilter.
Allowed values:
WoundedEmbarkedCity-StateBarbarians, BarbarianNon-City[{Wounded} {Water}] units.You can check this in-game using the console with the unit checkfilter <filter> command
Allows to only activate a unique for certain buildings.
Allowed values:
All, allBuildings, BuildingWonder, WondersNational Wonder, NationalWorld Wonder, World -- All wonders that are not national wondersspaceship part)Culture, Gold, etc. if the building is stat-related for that stat. Stat-related buildings are defined as one of the following:
{filter1} {filter2} up to any number of filters. For example [{Ancient era} {Food}] buildings.cityFilters allow us to choose the range of cities affected by this unique:
in this cityin all cities, All, all - Generally applies to all cities owned by the relevant civin your cities, Yourin all coastal cities, Coastalin capital, Capitalin all non-occupied cities, Non-occupied - all cities that are not puppets and don't have extra unhappiness from being recently conqueredin all cities with a world wonderin all cities connected to capitalin all cities with a garrison, Garrisonedin non-enemy foreign cities - In all cities owned by civs other than you that you are not at war within enemy cities, Enemyin foreign cities, Foreignin annexed cities, Annexedin puppeted cities, Puppetedin resisting cities, Resistingin cities being razed, Razingin holy cities, Holyin City-State citiesin cities following this religion - Should only be used in pantheon/follower uniques for religionsin cities following our religionin all cities in which the majority religion is a major religionin all cities in which the majority religion is an enhanced religionYou can check this in-game using the console with the city checkfilter <filter> command
For filtering a specific era.
Allowed values:
Modern era)any eraStarting Era - The era in which the game beganpre-[era] - Any era that appears prior to the given era (e.g.: pre-[Modern era])post-[era] - Any era that appears after the given era (e.g.: post-[Ancient era])For filtering a specific improvement.
Allowed values:
spaceship improvement)ImprovementAll, allGreat Improvement, GreatAll Road - for Roads & RailroadsA filter determining a part of the population of a city.
Allowed values:
PopulationSpecialistsUnemployedFollowers of the Majority Religion or Followers of this Religion, both of which only apply when this religion is the majority religion in that cityFor filtering specific relgions
anymajorenhancedyourforiegnenemyAllowed values:
All, all[policyBranchName] branchAllowed values:
City, All, or civFilter, for city combatantsSince mapUnitFilter contains civFilter, that means civFilter can be applied to combatantFilter for both units and cities.
Used for dividing the world into regions in each of which a single player is placed at the start of the game.
Allowed values are Hybrid and the name of any terrain that has one of the following two uniques:
A Region is formed with at least [amount]% [simpleTerrain] tiles, with priority [amount]A Region is formed with at least [amount]% [simpleTerrain] tiles and [simpleTerrain] tiles, with priority [amount]Used by NaturalWonderGenerator to place natural wonders
Allowed values:
LandWaterElevatedThis indicates a text comprised of specific stats and is slightly more complex.
Each stats is comprised of several stat changes, each in the form of +{amount} {stat},
where 'stat' is one of the seven major stats
(eg Production, Food, Gold, Science, Culture, Happiness and Faith).
For example: +1 Science.
These can be strung together with ", " between them, for example: +2 Production, +3 Food.
Allowed values:
anyAll, allStrategic, Luxury, BonusFood)This indicates a text that corresponds to a custom Stockpile Resource.
These are global civilization resources that act similar to the main Civ-wide resources like Gold and Faith.
You can generate them and consume them. And actions that would consume them are blocked if you
don't have enough left in stock.
To use, you need to first define a TileResources with the "Stockpiled" Unique. Then you can reference them in other Uniques.
Something that can be added to a civ
Allowed values:
Stored Food (for cities)Golden Age pointsAt the moment only implemented for ModOptions.techsToRemove.
Allowed values:
All, allThis indicates the terrain on a single tile.
Allowed values:
All, allTerrainWater, LandCoastal (at least one direct neighbor is a coast)River (as in all 'river on tile' contexts, it means 'adjacent to a river on at least one side')Open terrain, Rough terrain (note all terrain not having the rough unique is counted as open)Friendly Land, Friendly - land belonging to you, or other civs with open borders to youForeign Land - any land that isn't friendly landEnemy Land, Enemy - any land belonging to a civ you are at war withyour - land belonging to youUnowned - land that is not owned by any civWater resource, Strategic resource, Luxury resource, Bonus resource, resourceNatural Wonder (as opposed to above which means testing for a specific Natural Wonder by name, this tests for any of them)FeaturelessFresh Waternon-fresh waterImpassiblePlease note all of these are case-sensitive.
Note: Resource filters depend on whether a viewing civ is known in the context where the filter runs. Water and specific tests require a viewing civ, and if the resource needs a tech to be visible, that tech to be researched by the viewing civ. The other resource category tests can succeed without a known viewing civ only for resources not requiring any tech. So - test your mod!
So for instance, the unique "[stats] from [tileFilter] tiles [cityFilter]" can match several cases:
Allowed values:
Improvement or improved for tiles with any improvementsunimproved for tiles with no improvementpillaged for pillaged tilesworked for tiles worked by a cityYou can check this in-game using the console with the tile checkfilter <filter> command
Used to indicate for what use the terrain should be viewed when dividing the world into regions, in each of which a single player is placed at the start of the game.
Allowed values:
UndesirableFoodDesirableProductionIndicates something that can be counted, used both for comparisons and for multiplying uniques
Allowed values:
Only available <when number of [123] is more than [0]>turns - Number of turns played
Only available <when number of [turns] is more than [0]>year - The current year
Only available <when number of [year] is more than [0]>Cities - The number of cities the relevant Civilization owns
Only available <when number of [Cities] is more than [0]>Units - The number of units the relevant Civilization owns
Only available <when number of [Units] is more than [0]>Production, Food, Gold, Science, Culture, Happiness or Faith)
Only available <when number of [Science] is more than [0]>Only available <when number of [[Culture] Per Turn] is more than [0]>Completed Policy branches
Only available <when number of [Completed Policy branches] is more than [0]>[cityFilter] Cities
Only available <when number of [[in all cities] Cities] is more than [0]>[mapUnitFilter] Units
Only available <when number of [[Wounded] Units] is more than [0]>Carried [mapUnitFilter] units - The number of units being carried by this unit
Only available <when number of [Carried [Air] units] is more than [0]>[buildingFilter] Buildings
Only available <when number of [[Culture] Buildings] is more than [0]>[buildingFilter] Buildings by [civFilter] Civilizations
Only available <when number of [[Culture] Buildings by [City-States] Civilizations] is more than [0]>[cityFilter] Cities of [civFilter] Civilizations
Only available <when number of [[in all cities] Cities of [City-States] Civilizations] is more than [0]>Adopted [policyFilter] Policies
Only available <when number of [Adopted [Oligarchy] Policies] is more than [0]>Adopted [policyFilter] Policies by [civFilter] Civilizations
Only available <when number of [Adopted [Oligarchy] Policies by [City-States] Civilizations] is more than [0]>Researched [techFilter] Technologies
Only available <when number of [Researched [Agriculture] Technologies] is more than [0]>Remaining [civFilter] Civilizations
Only available <when number of [Remaining [City-States] Civilizations] is more than [0]>Owned [tileFilter] Tiles
Only available <when number of [Owned [Farm] Tiles] is more than [0]>[tileFilter] Tiles
Only available <when number of [[Desert] Tiles] is more than [0]>Only available <when number of [Iron] is more than [0]>[resourceFilter] resource of [civFilter] Civilizations
Only available <when number of [[Strategic] resource of [City-States] Civilizations] is more than [0]>Era number - Number of the era the current player is in
Only available <when number of [Era number] is more than [0]>Speed modifier for [stat] - A game speed modifier for a specific Stat, as percentage
Only available <when number of [Speed modifier for [Culture]] is more than [0]>modifier field.goldGiftModifier or barbarianModifier are not accessible with this Countable.Only available <when number of [[Iron] + 2] is more than [0]>Cities is a countable, and [Melee] units is a countable, you can have something like: ([[Melee] units] + 1) / [Cities] (the whitespace is optional but helps readability)(Melee units + 1) / Citiesmax(expression,expression,...)min(expression,expression,...)