-
Notifications
You must be signed in to change notification settings - Fork 0
modifiers Requirement Types
Requirements are conditions that control when modifiers activate. They check game state and return true or false.
Requirements are combined into RequirementSets which define how the conditions combine:
| RequirementSet Type | Logic |
|---|---|
REQUIREMENTSET_TEST_ALL |
All requirements must pass (AND) |
REQUIREMENTSET_TEST_ANY |
Any requirement can pass (OR) |
Any requirement can be inverted with Inverse="true":
<Requirement type="REQUIREMENT_PLAYER_IS_HUMAN" Inverse="true"/>
<!-- Returns true when player is AI -->Modifiers have two requirement contexts:
| Context | Checks Against | Use For |
|---|---|---|
OwnerRequirements |
The modifier's owner | Activation conditions (player has tech, trait, etc.) |
SubjectRequirements |
Each subject in collection | Filtering subjects (specific cities, units, plots) |
Checks if city has a specific building.
| Argument | Type | Description |
|---|---|---|
BuildingType |
TEXT | Building type to check for |
<Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
<Argument name="BuildingType">BUILDING_GRANARY</Argument>
</Requirement>Checks if city has a build queue (is a full city, not a town).
<Requirement type="REQUIREMENT_CITY_HAS_BUILD_QUEUE"/>
<!-- Use Inverse="true" to check for towns -->Checks if settlement is a city (not town).
<Requirement type="REQUIREMENT_CITY_IS_CITY"/>Checks if city follows a specific religion.
| Argument | Type | Description |
|---|---|---|
ReligionType |
TEXT | Religion type to check |
<Requirement type="REQUIREMENT_CITY_FOLLOWS_RELIGION">
<Argument name="ReligionType">RELIGION_BUDDHISM</Argument>
</Requirement>Checks biome tiles at city founding location.
| Argument | Type | Description |
|---|---|---|
BiomeType |
TEXT | Biome type |
Amount |
INTEGER | Minimum tiles |
Checks plot terrain type.
| Argument | Type | Description |
|---|---|---|
TerrainType |
TEXT | Terrain type |
Terrain Types:
-
TERRAIN_GRASS,TERRAIN_PLAINS,TERRAIN_DESERT -
TERRAIN_TUNDRA,TERRAIN_SNOW,TERRAIN_COAST -
TERRAIN_OCEAN,TERRAIN_HILL,TERRAIN_MOUNTAIN
<Requirement type="REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES">
<Argument name="TerrainType">TERRAIN_HILL</Argument>
</Requirement>Checks plot biome.
| Argument | Type | Description |
|---|---|---|
BiomeType |
TEXT | Biome type |
Biome Types:
-
BIOME_GRASSLANDS,BIOME_PLAINS,BIOME_DESERT -
BIOME_TUNDRA,BIOME_TROPICAL,BIOME_MARINE
<Requirement type="REQUIREMENT_PLOT_BIOME_TYPE_MATCHES">
<Argument name="BiomeType">BIOME_DESERT</Argument>
</Requirement>Checks for a specific feature on the plot.
| Argument | Type | Description |
|---|---|---|
FeatureType |
TEXT | Feature type |
Common Features:
-
FEATURE_FOREST,FEATURE_JUNGLE,FEATURE_MARSH -
FEATURE_OASIS,FEATURE_FLOODPLAINS,FEATURE_REEF -
FEATURE_NAVIGABLE_RIVER,FEATURE_MOUNTAIN_PASSABLE
Checks district class on the plot.
| Argument | Type | Description |
|---|---|---|
DistrictClass |
TEXT | District class(es) |
District Classes:
-
CITYCENTER,URBAN,RURAL,WONDER
<Requirement type="REQUIREMENT_PLOT_DISTRICT_CLASS">
<Argument name="DistrictClass">RURAL, URBAN, CITYCENTER</Argument>
</Requirement>Checks if plot has a specific constructible (building/improvement).
| Argument | Type | Description |
|---|---|---|
ConstructibleType |
TEXT | Constructible type |
<Requirement type="REQUIREMENT_PLOT_HAS_CONSTRUCTIBLE">
<Argument name="ConstructibleType">IMPROVEMENT_FARM</Argument>
</Requirement>Checks if plot is adjacent to a constructible of a specific type.
| Argument | Type | Description |
|---|---|---|
ConstructibleType |
TEXT | Constructible type |
<Requirement type="REQUIREMENT_PLOT_ADJACENT_CONSTRUCTIBLE_TYPE_MATCHES">
<Argument name="ConstructibleType">BUILDING_LIBRARY</Argument>
</Requirement>Checks if plot is on a river.
| Argument | Type | Description |
|---|---|---|
Navigable |
BOOLEAN | Require navigable river |
Checks if plot is a lake.
Checks if plot is adjacent to coast.
Checks if plot is adjacent to a lake.
Checks if plot is adjacent to a river.
| Argument | Type | Description |
|---|---|---|
Navigable |
BOOLEAN | Require navigable river |
<Requirement type="REQUIREMENT_PLOT_ADJACENT_TO_RIVER">
<Argument name="Navigable">true</Argument>
</Requirement>Checks if plot has a visible (revealed) resource.
Checks if plot is in player's homelands (near starting location).
Checks if plot is adjacent to owner's territory.
Checks if unit has a specific tag.
| Argument | Type | Description |
|---|---|---|
Tag |
TEXT | Unit class tag |
Common Unit Tags:
-
UNIT_CLASS_COMBAT,UNIT_CLASS_NON_COMBAT -
UNIT_CLASS_MELEE,UNIT_CLASS_RANGED,UNIT_CLASS_SIEGE -
UNIT_CLASS_INFANTRY,UNIT_CLASS_CAVALRY,UNIT_CLASS_MOUNTED -
UNIT_CLASS_NAVAL,UNIT_CLASS_AIRCRAFT -
UNIT_CLASS_HEAVY,UNIT_CLASS_LIGHT,UNIT_CLASS_COMMAND
<Requirement type="REQUIREMENT_UNIT_TAG_MATCHES">
<Argument name="Tag">UNIT_CLASS_INFANTRY</Argument>
</Requirement>Checks if opponent unit in combat has a specific tag.
| Argument | Type | Description |
|---|---|---|
Tag |
TEXT | Unit class tag |
<Requirement type="REQUIREMENT_OPPONENT_UNIT_TAG_MATCHES">
<Argument name="Tag">UNIT_CLASS_MELEE</Argument>
</Requirement>Checks unit domain.
| Argument | Type | Description |
|---|---|---|
UnitDomain |
TEXT | Domain type |
Domain Types:
-
DOMAIN_LAND,DOMAIN_SEA,DOMAIN_AIR
<Requirement type="REQUIREMENT_UNIT_DOMAIN_MATCHES">
<Argument name="UnitDomain">DOMAIN_SEA</Argument>
</Requirement>Checks for a specific unit type.
| Argument | Type | Description |
|---|---|---|
UnitType |
TEXT | Specific unit type |
<Requirement type="REQUIREMENT_UNIT_TYPE_MATCHES">
<Argument name="UnitType">UNIT_MISSIONARY</Argument>
</Requirement>Checks unit class.
| Argument | Type | Description |
|---|---|---|
UnitClass |
TEXT | Unit class |
Checks if player is human (not AI).
<Requirement type="REQUIREMENT_PLAYER_IS_HUMAN"/>
<!-- Use Inverse="true" to check for AI -->Checks if player is a major civilization.
Checks if player is a minor civilization (city-state).
Checks if player is the attacker in combat.
Checks if player is a specific civilization.
| Argument | Type | Description |
|---|---|---|
CivilizationType |
TEXT | Civilization type |
<Requirement type="REQUIREMENT_PLAYER_CIVILIZATION_TYPE_MATCHES">
<Argument name="CivilizationType">CIVILIZATION_ROME</Argument>
</Requirement>Checks if player has a specific leader.
| Argument | Type | Description |
|---|---|---|
LeaderType |
TEXT | Leader type |
<Requirement type="REQUIREMENT_PLAYER_LEADER_TYPE_MATCHES">
<Argument name="LeaderType">LEADER_AUGUSTUS</Argument>
</Requirement>Checks if player has a specific trait (from civ or leader).
| Argument | Type | Description |
|---|---|---|
TraitType |
TEXT | Trait type |
<Requirement type="REQUIREMENT_PLAYER_HAS_CIVILIZATION_OR_LEADER_TRAIT">
<Argument name="TraitType">TRAIT_ROME_ABILITY</Argument>
</Requirement>Checks if player has researched a tech/civic.
| Argument | Type | Description |
|---|---|---|
ProgressionTreeNodeType |
TEXT | Tech/civic node |
MinDepth |
INTEGER | Required completion depth |
<Requirement type="REQUIREMENT_PLAYER_HAS_COMPLETED_PROGRESSION_TREE_NODE">
<Argument name="ProgressionTreeNodeType">NODE_TECH_AQ_MASONRY</Argument>
<Argument name="MinDepth">1</Argument>
</Requirement>Checks if player has a specific unlock.
| Argument | Type | Description |
|---|---|---|
UnlockType |
TEXT | Unlock type |
Checks if player has built at least X of a building type.
| Argument | Type | Description |
|---|---|---|
BuildingType |
TEXT | Building type |
Amount |
INTEGER | Minimum count |
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_BUILDINGS">
<Argument name="BuildingType">BUILDING_TEMPLE</Argument>
<Argument name="Amount">4</Argument>
</Requirement>Checks if player has at least X units of a type.
| Argument | Type | Description |
|---|---|---|
UnitTag |
TEXT | Unit tag to count |
Amount |
INTEGER | Minimum count |
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_UNIT_TYPE">
<Argument name="UnitTag">UNIT_CLASS_SIEGE</Argument>
<Argument name="Amount">3</Argument>
</Requirement>Checks if player has founded at least X cities.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum cities |
Checks cities with a specific building.
| Argument | Type | Description |
|---|---|---|
ConstructibleType |
TEXT | Building type |
Amount |
INTEGER | Minimum cities |
Checks settlements at specific location types.
| Argument | Type | Description |
|---|---|---|
LocationType |
TEXT | Location type (COAST, ISLAND, MOUNTAIN, etc.) |
Amount |
INTEGER | Minimum count |
Checks settlements in specific biomes.
| Argument | Type | Description |
|---|---|---|
BiomeType |
TEXT | Biome type |
Amount |
INTEGER | Minimum count |
Checks if player has built at least X wonders.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum wonders |
Checks resources in a single city.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum resources |
Checks total improved resources of a type.
| Argument | Type | Description |
|---|---|---|
ResourceType |
TEXT | Resource type |
Amount |
INTEGER | Minimum count |
Checks conquered cities.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum conquered |
IsCapital |
BOOLEAN | Count only capitals |
Checks razed cities.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum razed |
Checks reconquered (liberated) cities.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum reconquered |
Checks trade route diversity.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum trade partners |
Checks trade routes count.
| Argument | Type | Description |
|---|---|---|
Amount |
INTEGER | Minimum routes |
TradeRouteType |
TEXT | Route type (NAVAL, LAND) |
Checks victory points.
| Argument | Type | Description |
|---|---|---|
VictoryPointType |
TEXT | VP category |
Amount |
INTEGER | Minimum points |
Checks if player is eligible for city-state bonuses (has appropriate relationship level).
Checks if player founded their religion.
Checks if player's religion has a specific belief.
| Argument | Type | Description |
|---|---|---|
BeliefType |
TEXT | Belief type |
Checks current game age.
| Argument | Type | Description |
|---|---|---|
AgeType |
TEXT | Age type |
Age Types:
-
AGE_ANTIQUITY,AGE_EXPLORATION,AGE_MODERN
<Requirement type="REQUIREMENT_GAME_AGE_TYPE_MATCH">
<Argument name="AgeType">AGE_ANTIQUITY</Argument>
</Requirement>Checks if player is in a dark age.
Checks if another requirement set is met. Useful for reusing requirement logic.
| Argument | Type | Description |
|---|---|---|
RequirementSetId |
TEXT | RequirementSet to check |
<Requirement type="REQUIREMENT_REQUIREMENTSET_IS_MET">
<Argument name="RequirementSetId">REQSET_UNIT_CLASS_INFANTRY</Argument>
</Requirement>A very flexible requirement type used primarily with Narrative Events. It checks for "gossip" events that have occurred in the game.
| Argument | Type | Description |
|---|---|---|
GossipTypes |
TEXT | Comma-separated gossip types |
| Additional arguments | TEXT | Parameters for specific gossips |
Common Gossip Types:
-
GOSSIP_FOUNDED_CITY- Player founded a city -
GOSSIP_CONSTRUCTED_BUILDING- Built a building -
GOSSIP_RESEARCHED_TECH- Completed a technology -
GOSSIP_DISCOVERED_WONDER- Built a wonder -
GOSSIP_TRAINED_UNIT- Trained a unit -
GOSSIP_WON_BATTLE- Won a combat -
GOSSIP_FOUNDED_RELIGION- Founded a religion
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_GOSSIPS">
<Argument name="GossipTypes">GOSSIP_FOUNDED_CITY</Argument>
<Argument name="Amount">3</Argument>
</Requirement>With Location Parameter:
<Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_GOSSIPS">
<Argument name="GossipTypes">GOSSIP_CONSTRUCTED_BUILDING</Argument>
<Argument name="ConstructibleType">BUILDING_MARKET</Argument>
</Requirement>This requirement is often easier to set up than complex RequirementSets for Narrative Events.
The game includes many pre-built RequirementSets you can reference:
| RequirementSetId | Description |
|---|---|
Met |
Always passes (for LINKED events) |
REQSET_URBAN_PLOTS |
Urban or city center plots |
REQSET_RURAL_PLOTS |
Rural plots |
REQSET_ONLY_CITIES |
Full cities only |
REQSET_ONLY_TOWNS |
Towns only |
REQSET_BIOME_TUNDRA |
Tundra biome plots |
REQSET_BIOME_DESERT |
Desert biome plots |
REQSET_UNIT_CLASS_INFANTRY |
Infantry units |
REQSET_UNIT_CLASS_MOUNTED |
Mounted units |
REQSET_UNIT_CLASS_NAVAL |
Naval units |
REQSET_PLAYER_IS_AI |
AI players |
REQSET_PLAYER_IS_MAJOR |
Major civilizations |
Traditional database format for requirements:
<Database>
<!-- Define the requirement set -->
<RequirementSets>
<Row RequirementSetId="MY_REQUIREMENTS" RequirementSetType="REQUIREMENTSET_TEST_ALL"/>
</RequirementSets>
<!-- Define individual requirements -->
<Requirements>
<Row RequirementId="REQ_HAS_GRANARY" RequirementType="REQUIREMENT_CITY_HAS_BUILDING"/>
<Row RequirementId="REQ_HAS_LIBRARY" RequirementType="REQUIREMENT_CITY_HAS_BUILDING"/>
</Requirements>
<!-- Add arguments -->
<RequirementArguments>
<Row RequirementId="REQ_HAS_GRANARY" Name="BuildingType" Value="BUILDING_GRANARY"/>
<Row RequirementId="REQ_HAS_LIBRARY" Name="BuildingType" Value="BUILDING_LIBRARY"/>
</RequirementArguments>
<!-- Link requirements to set -->
<RequirementSetRequirements>
<Row RequirementSetId="MY_REQUIREMENTS" RequirementId="REQ_HAS_GRANARY"/>
<Row RequirementSetId="MY_REQUIREMENTS" RequirementId="REQ_HAS_LIBRARY"/>
</RequirementSetRequirements>
</Database>Simplified format in GameEffects XML:
<GameEffects xmlns="GameEffects">
<!-- Standalone RequirementSet -->
<RequirementSet id="REQSET_MY_CONDITIONS" type="REQUIREMENTSET_TEST_ALL">
<Requirement type="REQUIREMENT_PLAYER_HAS_COMPLETED_PROGRESSION_TREE_NODE">
<Argument name="ProgressionTreeNodeType">NODE_TECH_AQ_MASONRY</Argument>
</Requirement>
</RequirementSet>
<!-- Requirements inside a Modifier -->
<Modifier id="MY_MODIFIER" collection="COLLECTION_PLAYER_CITIES" effect="EFFECT_CITY_ADJUST_YIELD">
<OwnerRequirements type="REQUIREMENTSET_TEST_ALL">
<Requirement type="REQUIREMENT_PLAYER_IS_HUMAN"/>
</OwnerRequirements>
<SubjectRequirements type="REQUIREMENTSET_TEST_ANY">
<Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
<Argument name="BuildingType">BUILDING_GRANARY</Argument>
</Requirement>
<Requirement type="REQUIREMENT_CITY_HAS_BUILDING">
<Argument name="BuildingType">BUILDING_WAREHOUSE</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="YieldType">YIELD_FOOD</Argument>
<Argument name="Amount">2</Argument>
</Modifier>
</GameEffects>