Wiki

trigger · num_of_military_factories

Definition

  • Supported scope:COUNTRY
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

check amount of military factories

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

Commonly used to determine whether a country has sufficient military factory capacity, controlling whether decisions, national focuses, or events can be triggered—for example, restricting a "large-scale weapons export" decision to only industrial powerhouses, or checking in AI scripts whether conditions for military expansion are met.

# Only allow a decision to trigger when military factory count reaches a certain threshold
available = {
    num_of_military_factories > 50
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): Often combined with national focus completion checks, requiring both a specific industrial focus to be completed and military factory count to meet the threshold, creating a dual-requirement gate that makes conditions more balanced.
  • [building_count_trigger](/wiki/trigger/building_count_trigger): The two are complementary—the former counts total military factories nationwide, while the latter can target specific building counts in individual states; using them together enables fine-grained capacity judgment.
  • [add_ideas](/wiki/effect/add_ideas): In effect blocks, grant specific national spirits to countries meeting military factory conditions, forming a "reach factory scale → gain production bonus" reward logic.
  • [has_army_size](/wiki/trigger/has_army_size): Factory capacity and army size are often validated simultaneously to determine whether a country possesses both "production capability" and "affordability" for military strength.

Common Pitfalls

  1. Ignoring the impact of building damage: This trigger counts currently available military factories in real-time, which fluctuates due to strategic bombing or combat losses; relying on fixed thresholds in long-duration missions or persistent conditions may cause unexpected failure, so it's recommended to build in safety margins or pair with [has_damaged_buildings](/wiki/trigger/has_damaged_buildings) for fallback checking.
  2. Confusing state-level and country-level military factories: This trigger operates at COUNTRY scope and counts nationwide totals; it cannot directly judge military factories in a specific state at STATE scope. For state-level checks, use [building_count_trigger](/wiki/trigger/building_count_trigger) instead; newcomers often reverse the usage scenarios between the two.