Wiki

trigger · building_count_trigger

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:none

Description

Checks if the current scope has the specified amount of the specified building. 
Usage: <Building> < <int>
Supported buildings: infrastructure, arms_factory, industrial_complex, air_base, supply_node, rail_way, naval_facility, naval_base, bunker, coastal_bunker, stronghold_network, dockyard, anti_air_building, synthetic_refinery, fuel_silo, radar_station, mega_gun_emplacement, rocket_site, naval_supply_hub, naval_headquarters, nuclear_reactor, nuclear_reactor_heavy_water, commercial_nuclear_reactor, nuclear_facility, air_facility, land_facility, dam, dam_mountain, cataract_dam_mountain, canal_kiel, canal_panama, energy_infrastructure, industrial_infrastructure, landmark_big_ben, landmark_colosseum, landmark_cristo_redentor, landmark_eiffel_tower, landmark_statue_of_liberty, landmark_kremlin, landmark_hofburg_palace, landmark_berlin_reichstag, landmark_berlin_volkshalle, landmark_taj_mahal, landmark_sadabad_complex, landmark_hagia_sophia, landmark_forbidden_city, landmark_nanjing_presidential_palace, landmark_nanjing_presidential_palace_prc, landmark_nanjing_presidential_palace_gen, landmark_great_wall_section, landmark_tokyo_imperial_palace, landmark_national_diet, landmark_hakko_ichiu, landmark_prague_castle, landmark_bojnice_castle.

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

Hands-On Usage

building_count_trigger is commonly used to determine whether a state or country has established sufficient industrial infrastructure, thereby unlocking subsequent national focuses, decisions, or event options. For example, in industrial development mods, you can require players to construct a certain number of military factories in a target state to trigger expansion events, or check a state's infrastructure level to decide whether to allow garrison supply.

# In the available block of a decision, require the current country to own at least 5 military factories
available = {
    building_count_trigger = {
        arms_factory > 4
    }
}

# In STATE scope, check if the state's infrastructure reaches level 5
limit = {
    building_count_trigger = {
        infrastructure > 4
    }
}

Synergy

  • [free_building_slots](/wiki/trigger/free_building_slots): These two are commonly paired together. First use building_count_trigger to confirm that existing building counts meet the threshold, then use free_building_slots to verify whether the state still has remaining slots available. After this dual verification, trigger the construction effect.
  • [add_building_construction](/wiki/effect/add_building_construction): When building_count_trigger determines that building counts are insufficient, use this command in the effect block to supplement construction, forming a complete logical closure of "check-and-supplement."
  • [any_owned_state](/wiki/trigger/any_owned_state): Under COUNTRY scope, commonly use any_owned_state to iterate through all territories, then nest building_count_trigger within it to check whether any state reaches a specific building level.
  • [controls_state](/wiki/trigger/controls_state): Combined with building_count_trigger, first confirm that the country actually controls the target state, then check its building level, avoiding erroneous judgments on states without control.

Common Pitfalls

  1. Confusion over comparison operator direction: The official syntax requires writing <Building> < <int> (i.e., "building count is less than some value"). Beginners often mistakenly write "at least X factories" as arms_factory < 5, but this actually means "fewer than 5" evaluates to true. To express "at least 5," you should write arms_factory > 4. Always verify the logical direction.
  2. Statistics results under COUNTRY scope differ from expectations: In country scope, building_count_trigger counts the total buildings across all states owned by that country, not the value of a specific state. If you need to judge a single state, you must first switch to a specific STATE scope using any_owned_state / all_owned_state or similar scope commands before calling it; otherwise, the results will be completely different from what you expected.