Wiki

trigger · num_of_controlled_factories

Definition

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

Description

check the number of factories in controlled states excluding any gained or lost through trade, relations, modifiers etc.

实战 · 配合 · 坑

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

实战用法

num_of_controlled_factories 常用于判断某国工业实力是否达到门槛,从而解锁特定决议、国策分支或 AI 策略——例如规定只有工厂数量足够的大国才能启动某条军备扩张路线。注意它统计的是实际控制的工厂,剔除贸易/关系/修正器带来的浮动,因此比其他工厂相关判断更能反映"硬实力"。

# 只有控制足够工厂的国家才能激活该决议
available = {
    num_of_controlled_factories > 50
}

配合关系

  • [controls_state](/wiki/trigger/controls_state) — 验证某国是否同时控制了关键州,与工厂数量判断组合可精确限定"工业核心区控制"场景。
  • [has_army_size](/wiki/trigger/has_army_size) — 工厂数量往往与军队规模挂钩,两者并列使用可衡量一国综合战争潜力。
  • [add_political_power](/wiki/effect/add_political_power) — 作为达成条件后的奖励 effect,常见于"工业里程碑"类任务:满足工厂阈值后给予政治点奖励。
  • [building_count_trigger](/wiki/trigger/building_count_trigger) — 用于进一步细化判断具体建筑类型(军工厂/船坞)的数量,与本 trigger 互补使用。

常见坑

  1. 误以为包含贸易收益:新手容易把它和"总工厂数"混淆——通过贸易协定、傀儡关系或修正器额外获得的工厂产能不计入本 trigger,若要做"综合产能"判断需考虑换用其他方式。
  2. Scope 用错:本 trigger 只能在 COUNTRY scope 下使用,若在 STATE scope(如 limit 嵌套在 every_owned_state 内层)直接调用会导致脚本报错或静默失效,需先用 OWNER 切回国家 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_controlled_factories is commonly used to determine whether a nation's industrial strength meets a threshold, thereby unlocking specific decisions, focus tree branches, or AI strategies—for example, stipulating that only major powers with sufficient factory counts can activate a certain military expansion route. Note that it counts only actually controlled factories, excluding fluctuations from trade, relations, or modifiers, making it a more reliable indicator of "hard power" compared to other factory-related checks.

# Only countries controlling enough factories can activate this decision
available = {
    num_of_controlled_factories > 50
}

Synergy

  • [controls_state](/wiki/trigger/controls_state) — Verifies whether a nation simultaneously controls key states; combined with factory count checks, it can precisely define "industrial core control" scenarios.
  • [has_army_size](/wiki/trigger/has_army_size) — Factory counts are often correlated with army size; using both together measures a nation's comprehensive war potential.
  • [add_political_power](/wiki/effect/add_political_power) — Serves as a reward effect upon meeting conditions, commonly seen in "industrial milestone" type tasks: grant political power after meeting factory thresholds.
  • [building_count_trigger](/wiki/trigger/building_count_trigger) — Used to further refine checks on specific building types (military factories/dockyards); complements this trigger when used together.

Common Pitfalls

  1. Mistaking it for including trade income: Newcomers often confuse this with "total factory count"—factories gained through trade agreements, puppet relations, or modifiers are not counted in this trigger; if you need "total production capacity" judgments, consider using alternative approaches.
  2. Wrong scope usage: This trigger only works in COUNTRY scope; calling it directly in STATE scope (such as limit nested inside every_owned_state) causes script errors or silent failures; use OWNER to switch back to country scope before the check.