Wiki

trigger · num_of_factories

Definition

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

Description

Check amount of available factories (excluding temporary sources like trade and lend-lease)
Example:
GER = { num_of_factories < 50 }

实战 · 配合 · 坑

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

实战用法

num_of_factories 常用于国家决策或科技加速的解锁条件,判断某国工业实力是否达到门槛,例如限制只有具备一定工厂数量的国家才能开启特定军工扩张计划。注意它只统计"可用"工厂(军工厂+船坞),不含贸易/租借借入的临时产能,因此能更真实地反映本国工业底蕴。

# 仅当本国工厂数达到一定规模时才允许触发决策
available = {
    num_of_factories > 30
}

配合关系

  • [has_completed_focus](/wiki/trigger/has_completed_focus):先检查是否完成了某个工业扩张焦点,再用 num_of_factories 确认工厂数量已实际增长,两者结合形成"焦点已完工 + 产能到位"的双重门槛。
  • [building_count_trigger](/wiki/trigger/building_count_trigger)num_of_factories 反映可用工厂总数,而 building_count_trigger 可精确查询某州特定建筑的数量,两者搭配可以同时约束全局产能与局部建设进度。
  • [add_research_slot](/wiki/effect/add_research_slot):常在工厂数量满足条件后作为奖励添加研究槽,体现"工业强国获得科研加成"的设计逻辑。
  • [add_tech_bonus](/wiki/effect/add_tech_bonus):与工厂数量触发搭配,给达到工业规模阈值的国家提供装备或生产科技的研发加速,强化工业路线的正向反馈。

常见坑

  1. 误以为包含贸易/租借工厂:新手常以为该值等于生产界面看到的"当前总产能",实际上贸易协议借入的工厂不计入,导致条件设置偏严或逻辑与预期不符,调试时需在无贸易状态下验证。
  2. 在非 COUNTRY scope 下使用:该 trigger 仅适用于国家 scope,若写在州(state)或单位领袖的条件块内会静默失效或报错,需确保外层 scope 是国家,或显式用 OWNER = { num_of_factories > X } 转换 scope。

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

num_of_factories is commonly used in country decisions or technology acceleration unlock conditions to assess whether a nation's industrial capacity meets the threshold, such as restricting certain military industrial expansion plans to only those countries with a minimum factory count. Note that it only counts "available" factories (military factories + dockyards) and excludes temporary production capacity from trade agreements or lend-lease imports, thus providing a more accurate reflection of a country's inherent industrial strength.

# Only allow decision trigger when country's factory count reaches a certain scale
available = {
    num_of_factories > 30
}

Synergy

  • [has_completed_focus](/wiki/trigger/has_completed_focus): First check whether a specific industrial expansion focus has been completed, then use num_of_factories to confirm the factory count has actually grown; combining both creates a dual threshold of "focus completed + production capacity in place."
  • [building_count_trigger](/wiki/trigger/building_count_trigger): num_of_factories reflects total available factories globally, while building_count_trigger can precisely query the quantity of specific buildings in a state; pairing both allows simultaneous constraint of global production capacity and local construction progress.
  • [add_research_slot](/wiki/effect/add_research_slot): Commonly added as a reward after factory count conditions are met, embodying the design logic of "industrial powers receive research bonuses."
  • [add_tech_bonus](/wiki/effect/add_tech_bonus): Paired with factory count triggers to provide equipment or production technology research acceleration to nations reaching industrial scale thresholds, reinforcing positive feedback in industrial-focused strategies.

Common Pitfalls

  1. Mistakenly assuming it includes trade/lend-lease factories: Newcomers often assume this value equals the "current total production capacity" shown in the production interface; in reality, factories borrowed through trade agreements are not counted, leading to overly strict condition settings or logic misaligned with expectations. Verification without trade agreements is necessary during debugging.
  2. Using outside COUNTRY scope: This trigger only applies to country scope; if placed in state or unit leader condition blocks, it will silently fail or throw errors. Ensure the outer scope is a country, or explicitly convert scope using OWNER = { num_of_factories > X }.