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

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

常用于判断某国是否具备足够的军工产能,以控制决策、国策或事件是否可触发——例如限制"大规模武器出口"决策只对工业强国开放,或在 AI 脚本中判断是否具备扩军条件。

# 仅当军工厂数量达到一定规模时,允许触发某项决策
available = {
    num_of_military_factories > 50
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):常与国策完成判断组合,既要求完成了特定工业国策,又要求军工厂数量达标,双重门槛使条件更合理。
  • [building_count_trigger](/wiki/trigger/building_count_trigger):两者互补——前者统计全国军工厂总量,后者可精确到特定州的建筑数量,配合使用实现精细化产能判断。
  • [add_ideas](/wiki/effect/add_ideas):在效果块中给满足军工条件的国家添加特定国家精神,形成"达到军工规模 → 获得生产加成"的奖励逻辑。
  • [has_army_size](/wiki/trigger/has_army_size):工厂产能与军队规模常同时检验,用来判断一个国家是否同时具备"造得出"和"养得起"的双重军事实力。

常见坑

  1. 忽略建筑损毁的影响:该 trigger 统计的是当前实际可用的军工厂数量,受轰炸或战损影响会实时变化,在长期 mission 或持续条件中依赖固定阈值可能导致意外失效,建议留有余量或配合 [has_damaged_buildings](/wiki/trigger/has_damaged_buildings) 做容错判断。
  2. 与州级军工厂混淆:该 trigger 作用于 COUNTRY scope,统计全国总量,无法直接用于 STATE scope 判断某个具体州的军工厂数;若需州级判断,应改用 [building_count_trigger](/wiki/trigger/building_count_trigger),新手常将两者场景用反。

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.