Wiki

trigger · num_of_civilian_factories

Definition

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

Description

check amount of civilian factories

实战 · 配合 · 坑

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

实战用法

num_of_civilian_factories 常用于判断一个国家是否具备足够的工业基础来触发某项决议、解锁特定国策奖励或限制 AI 执行特定行为。例如在自定义决议中,可以要求玩家的民用工厂数量达到一定阈值才能激活:

available = {
    num_of_civilian_factories > 20
}

也可在 limit 块中限制事件选项,仅当国家拥有足够民用工厂时才允许选择高投入的建设方案。

配合关系

  • [building_count_trigger](/wiki/trigger/building_count_trigger) — 常与其搭配,前者检查民用工厂总数,后者检查特定州内建筑数量,共同构成工业门槛的多层校验。
  • [add_cic](/wiki/effect/add_cic) — 作为满足条件后的奖励效果,通过 trigger 先验证工厂规模再给予建设加成,逻辑完整。
  • [has_country_flag](/wiki/trigger/has_country_flag) — 搭配标记防止重复触发,避免同一国家反复通过相同工厂数量检查获取奖励。
  • [add_ideas](/wiki/effect/add_ideas) — 达到工厂门槛后赋予某个国家理念(如工业化思想),与该 trigger 组成"条件→奖励"结构。

常见坑

  1. 混淆军用与民用工厂:新手容易将 num_of_civilian_factories 与军用工厂相关条件搞混,该 trigger 统计的是**民用工厂(civilian factory)**数量,不包含军用工厂(military factory)或船坞(naval dockyard),请勿想当然替换使用。
  2. 忽略占领地工厂的计入规则:被占领州的工厂是否计入取决于游戏当前的控制与所有权状态,测试时若数值对不上,需检查被占领或被借用的工厂是否影响了实际统计结果。

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_civilian_factories is commonly used to determine whether a country possesses sufficient industrial capacity to trigger certain decisions, unlock specific national focus rewards, or restrict AI behavior. For example, in custom decisions, you can require the player's civilian factory count to reach a certain threshold before activation:

available = {
    num_of_civilian_factories > 20
}

It can also be used in limit blocks to restrict event options, allowing high-investment construction plans only when the country has adequate civilian factories.

Synergy

  • [building_count_trigger](/wiki/trigger/building_count_trigger) — Often paired together; the former checks total civilian factory count while the latter checks building count within specific states, creating multi-layer industrial threshold validation.
  • [add_cic](/wiki/effect/add_cic) — Serves as a reward effect upon condition fulfillment; use the trigger to verify factory scale first, then grant construction bonuses for complete logic flow.
  • [has_country_flag](/wiki/trigger/has_country_flag) — Combine with flags to prevent repeated triggering, avoiding the same country repeatedly receiving rewards from identical factory count checks.
  • [add_ideas](/wiki/effect/add_ideas) — Upon reaching factory thresholds, grant national ideas (such as industrialization concepts) to a country, forming a "condition → reward" structure with this trigger.

Common Pitfalls

  1. Confusing military and civilian factories: Beginners often mix up num_of_civilian_factories with military factory-related conditions. This trigger counts civilian factory quantities only and does not include military factories or naval dockyards. Do not substitute arbitrarily.
  2. Overlooking factory inclusion rules for occupied territory: Whether factories in occupied states count depends on the game's current control and ownership status. When testing and values don't match, verify whether occupied or borrowed factories are affecting the actual count.