Wiki

trigger · num_of_civilian_factories_available_for_projects

Definition

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

Description

check amount of civilian factories available for a new project to use

实战 · 配合 · 坑

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

实战用法

该 trigger 常用于国策、决策或事件中,判断当家是否有足够的空闲民用工厂来启动某个专项项目(如特殊项目、生产许可等),避免玩家在资源紧张时被强制触发消耗。例如在决策的 available 块中设置门槛,确保玩家有富余民用工厂才能点击:

available = {
    num_of_civilian_factories_available_for_projects > 3
}

配合关系

  • [has_built](/wiki/trigger/has_built):常与本 trigger 一起检查建筑完成情况,综合判断工业基础是否支持开展项目。
  • [building_count_trigger](/wiki/trigger/building_count_trigger):可交叉验证当前民用工厂总量,与可用数量对比,排查是否大量工厂被征用。
  • [add_cic](/wiki/effect/add_cic):当判断通过后,常用此 effect 奖励或补充民用工厂产能,形成"满足条件→给予奖励"的标准流程。
  • [amount_research_slots](/wiki/trigger/amount_research_slots):民用工厂空闲与科研槽数量往往同时作为衡量国家发展潜力的指标,常并列出现在同一 trigger 块中。

常见坑

  1. 混淆"可用"与"总量":新手容易把该 trigger 当作检查民用工厂总数量来用,但它实际检查的是未被分配给贸易进口、建设队列等用途后剩余的空闲数量,总量高并不代表可用量高,大量进口依赖会显著压低该值。
  2. 比较运算符遗漏:直接写 num_of_civilian_factories_available_for_projects = 5 在部分上下文中语义模糊,建议明确使用 > / < / >= 等运算符,否则可能产生非预期的等值判断行为。

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

This trigger is commonly used in focus trees, decisions, or events to check whether a country has enough idle civilian factories to launch a specific project (such as special projects, production licenses, etc.), preventing players from being forced to trigger consumption during resource shortages. For example, set a threshold in the available block of a decision to ensure the player has surplus civilian factories before clicking:

available = {
    num_of_civilian_factories_available_for_projects > 3
}

Synergy

  • [has_built](/wiki/trigger/has_built): Often used together with this trigger to check building completion status, comprehensively assessing whether the industrial base supports project development.
  • [building_count_trigger](/wiki/trigger/building_count_trigger): Can cross-verify the current total civilian factory count, comparing it against available quantity to identify whether large numbers of factories are being requisitioned.
  • [add_cic](/wiki/effect/add_cic): After the condition passes, this effect is commonly used to reward or replenish civilian factory production capacity, forming a standard "condition met → reward given" flow.
  • [amount_research_slots](/wiki/trigger/amount_research_slots): Idle civilian factories and research slot quantity often serve simultaneously as indicators of national development potential, frequently appearing side-by-side in the same trigger block.

Common Pitfalls

  1. Confusing "available" with "total": Beginners often mistake this trigger for checking the total number of civilian factories, but it actually checks the remaining idle quantity after subtracting factories assigned to trade imports, construction queues, and other purposes. High total quantity does not mean high available quantity; heavy import dependency will significantly reduce this value.
  2. Missing comparison operators: Writing num_of_civilian_factories_available_for_projects = 5 directly creates semantic ambiguity in certain contexts. It is recommended to explicitly use comparison operators like > / < / >=, otherwise unexpected equality judgment behavior may occur.