Wiki

trigger · compare_intel_with

Definition

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

Description

Compare the intel of the scoped country with the specified one:
GER = {
  # is true if all predicates are satisfied
  compare_intel_with = { 
    target = POL
    civilian_intel > 0.5  # GER has at least 0.5 more civ. intel than POL
    army_intel = 0  # GER has as much army intel as POL
    navy_intel < 0  # POL has more navy intel than GER
    # airforce_intel is not specified and thus ignored in the comparison
  }
}

实战 · 配合 · 坑

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

实战用法

compare_intel_with 常用于情报系统相关的 mod 场景,例如判断某国是否已对目标国取得足够的情报优势,从而解锁特殊决策或触发事件(如策反行动、预判敌军部署等)。下面示例判断德国对波兰的平民情报是否领先,若满足则可用于某决策的 available 块:

# 在决策的 available 块中,判断 GER 是否对 POL 有足够情报优势
available = {
    GER = {
        compare_intel_with = {
            target = POL
            civilian_intel > 0.3
            army_intel > 0
        }
    }
}

配合关系

  • [has_collaboration](/wiki/trigger/has_collaboration):协作度与情报获取密切相关,通常先检测是否已对目标国建立一定协作度,再用 compare_intel_with 确认情报量级是否达标,两者共同作为行动前置条件。
  • [add_intel](/wiki/effect/add_intel):当情报比较结果不满足时,可在对应 effect 块中补充情报值;或在条件满足时奖励更多情报,形成情报滚雪球逻辑。
  • [has_active_mission](/wiki/trigger/has_active_mission):情报任务进行中时往往需要同时满足特定情报数值条件,两者配合可精确控制任务触发时机。
  • [any_operative_leader](/wiki/trigger/any_operative_leader):间谍行动派遣后情报会发生变化,配合此 trigger 可检查是否已有特工活跃于目标国,再结合 compare_intel_with 做双重门槛判断。

常见坑

  1. 比较运算符写成等号赋值语法:新手容易将 civilian_intel > 0.5 误写为 civilian_intel = 0.5,但在该 trigger 内 = 表示"恰好相等"而非赋值,数值必须精确匹配才为真,导致条件几乎永远不触发。请根据实际需求明确区分 ><= 三种运算符的语义。
  2. scope 指向错误导致比较主客体颠倒compare_intel_with 的 scope 是"拥有情报的一方",target 是"被侦察的一方",若在错误的国家 scope 下书写,navy_intel < 0 实际上反映的是目标国情报更多,初学者容易混淆比较方向,写出与预期完全相反的逻辑。

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

compare_intel_with is commonly used in intelligence system–related mod scenarios, such as determining whether a country has gained sufficient intelligence advantage over a target nation, thereby unlocking special decisions or triggering events (e.g., subversion operations, predicting enemy deployment, etc.). The following example checks whether Germany has a leading civilian intelligence level against Poland; if satisfied, it can be used in a decision's available block:

# In a decision's available block, check if GER has sufficient intelligence advantage over POL
available = {
    GER = {
        compare_intel_with = {
            target = POL
            civilian_intel > 0.3
            army_intel > 0
        }
    }
}

Synergy

  • [has_collaboration](/wiki/trigger/has_collaboration): Collaboration degree is closely related to intelligence acquisition. Typically, first check whether a certain collaboration level has been established with the target nation, then use compare_intel_with to confirm whether the intelligence scale meets the threshold. Both work together as a prerequisite for action.
  • [add_intel](/wiki/effect/add_intel): When the intelligence comparison result does not meet requirements, you can supplement intelligence values in the corresponding effect block; or reward additional intelligence when conditions are satisfied, forming a snowball effect in intelligence accumulation.
  • [has_active_mission](/wiki/trigger/has_active_mission): When an intelligence mission is in progress, specific intelligence value conditions must often be met simultaneously. Together, these can precisely control mission trigger timing.
  • [any_operative_leader](/wiki/trigger/any_operative_leader): Intelligence changes after operatives are dispatched. Combined with this trigger, you can check whether operatives are already active in the target nation, then use compare_intel_with for a dual-threshold assessment.

Common Pitfalls

  1. Using assignment syntax instead of comparison operators: Beginners often mistakenly write civilian_intel = 0.5 instead of civilian_intel > 0.5. However, within this trigger, = means "exactly equal" rather than assignment, and the value must match precisely to evaluate true, causing the condition to almost never fire. Clearly distinguish the semantics of >, <, and = operators based on your actual needs.
  2. Incorrect scope causing reversed comparison subjects: The scope of compare_intel_with is "the party that possesses intelligence," while target is "the party being surveilled." If written under the wrong country scope, navy_intel < 0 actually reflects that the target nation has more intelligence. Beginners easily confuse the comparison direction, resulting in logic that is completely opposite to expectations.