Wiki

trigger · resource_count_trigger

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:none

Description

Checks if the current scope has the specified amount of the specified resource.
Usage: <Resource> < <int>
Supported Resources: oil, aluminium, rubber, tungsten, steel, chromium, coal.

实战 · 配合 · 坑

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

实战用法

resource_count_trigger 常见于国策、决策或事件中,用来检测某州/国家是否持有足够的战略资源,从而解锁特定奖励或触发剧情分支。例如在工业建设类 mod 里,可以要求玩家先积累一定量的钢铁才能开放重工业升级决策。

# 决策 available 块示例:确保国家级别至少有 50 单位钢铁才可用
available = {
    resource_count_trigger = {
        resource = steel
        amount > 50
    }
}

配合关系

  • [free_building_slots](/wiki/trigger/free_building_slots):同时检查建筑位是否充足,与资源数量检测组合,确保玩家既有资源又有空间再进行工业建设类决策的前置验证。
  • [add_resource](/wiki/effect/add_resource):在 effect 块中作为对照操作——trigger 确认当前资源不足后,通过 add_resource 给予补充,形成"不够才补"的条件式奖励逻辑。
  • [has_resources_rights](/wiki/trigger/has_resources_rights):检测某国是否拥有该州资源开采权,与 resource_count_trigger 搭配可以区分"有资源但无开采权"和"已在利用资源"两种不同的游戏状态。
  • [controls_state](/wiki/trigger/controls_state):常先用控制权检查再做资源数量检查,避免玩家通过占领他人州绕过资源积累的设计意图。

常见坑

  1. 混淆 STATE 和 COUNTRY scope:在 STATE scope 下,trigger 只统计该单个州的资源量;在 COUNTRY scope 下统计的是全国总量。新手容易在国策(COUNTRY scope)里按单州期望值来写阈值,导致条件永远无法满足或过于宽松。
  2. 资源单位与实际产出的混淆resource_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

resource_count_trigger is commonly used in focuses, decisions, or events to check whether a state or nation possesses sufficient strategic resources, thereby unlocking specific rewards or branching story paths. For example, in industry-building mods, you can require players to accumulate a certain amount of steel before opening decision branches for heavy industry upgrades.

# Example available block in a decision: ensures the nation has at least 50 units of steel to proceed
available = {
    resource_count_trigger = {
        resource = steel
        amount > 50
    }
}

Synergy

  • [free_building_slots](/wiki/trigger/free_building_slots): Simultaneously checks for available building slots, combining with resource quantity detection to ensure players have both sufficient resources and space before executing industrial decisions.
  • [add_resource](/wiki/effect/add_resource): Used as a counterpart operation in effect blocks—after trigger confirms insufficient resources, add_resource supplements them, creating a "top up if insufficient" conditional reward logic.
  • [has_resources_rights](/wiki/trigger/has_resources_rights): Verifies whether a nation possesses resource extraction rights for a given state; pairing with resource_count_trigger distinguishes between "has resources but no extraction rights" and "actively utilizing resources" gameplay states.
  • [controls_state](/wiki/trigger/controls_state): Typically perform control checks before resource quantity checks to prevent players from bypassing resource accumulation mechanics by occupying others' states.

Common Pitfalls

  1. Confusing STATE and COUNTRY scope: Under STATE scope, the trigger only counts that single state's resources; under COUNTRY scope, it counts the national total. Beginners often write thresholds in focuses (COUNTRY scope) based on single-state expectations, resulting in conditions that never activate or are overly permissive.
  2. Conflating resource units with actual output: resource_count_trigger detects base resource slot quantities (the raw resource values on the map), not the player's actual usable amount after trade and requisition adjustments. Using it as an approximate "stockpile" creates judgment errors; clarify this distinction based on design intent.