Wiki

trigger · all_country_of

Definition

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

Description

Checks if all of the provided countries fulfill the specified triggers.
The `target` supports script constants and `tooltip` supports bindable localization.

### Example

all_country_of = { tooltip = my_loc # Optional bindable localization target = { SWE NOR FIN DEN ICE } has_defensive_war = yes }

all_country_of = { tooltip = my_loc # Optional bindable localization target = constant:country_groups:nordics has_defensive_war = yes }

实战 · 配合 · 坑

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

实战用法

all_country_of 适合用于联盟或阵营相关的事件/决策触发条件,例如检查斯堪的纳维亚所有国家是否都在进行防御战、或某个脚本常量定义的国家组是否全部满足特定政治条件。它比逐一写多个 tag 判断更简洁,也便于用脚本常量维护国家列表。

# 决策 available:只有当北欧四国全部都有战争支持 ≥ 50% 时才可用
available = {
    all_country_of = {
        target = { SWE NOR FIN DEN }
        has_war_support > 0.5
    }
}

配合关系

  • is_in_faction:常与 all_country_of 嵌套使用,先用 all_country_of 枚举目标国家列表,再在内部用 is_in_faction 确认它们是否已加入同一阵营。
  • has_war:在 all_country_of 内部检查所有指定国家是否均处于战争状态,常用于判断多国联合参战的触发条件。
  • has_government:在 all_country_of 内部验证一组国家是否均保持同一意识形态,适用于意识形态统一联盟的判断场景。
  • has_stability:配合 all_country_of 检查目标国家组的稳定度是否全部达标,常见于多国协作事件的前置条件。

常见坑

  1. target 写成单个 tag 而非花括号列表target = SWE 是错误写法,即使只有一个国家也必须写成 target = { SWE } 或使用 constant: 引用脚本常量,否则游戏无法正确解析目标列表。
  2. 误以为内部触发器共享外部 scopeall_country_of 会将 scope 切换到 target 中的每个国家,内部写的触发器是对这些目标国家求值,而非对当前执行 scope 的国家求值——新手容易在内部误用只对原始 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

all_country_of is well-suited for alliance- or faction-related event and decision triggers — for example, checking whether all Scandinavian countries are fighting defensive wars, or whether every country in a scripted-constant-defined group meets a specific political condition. It is more concise than writing multiple individual tag checks and makes it easy to maintain country lists via scripted constants.

# Decision available: only usable when all four Nordic countries have war support ≥ 50%
available = {
    all_country_of = {
        target = { SWE NOR FIN DEN }
        has_war_support > 0.5
    }
}

Synergy

  • is_in_faction: Frequently nested inside all_country_of — enumerate the target country list with all_country_of, then use is_in_faction inside to confirm whether those countries have already joined the same faction.
  • has_war: Used inside all_country_of to check whether all specified countries are currently at war; commonly used to trigger conditions for multi-nation joint entry into a conflict.
  • has_government: Used inside all_country_of to verify that a group of countries all share the same ideology, suitable for evaluating ideologically unified alliance scenarios.
  • has_stability: Paired with all_country_of to check whether all countries in the target group meet a stability threshold; commonly seen as a prerequisite for multi-nation cooperative events.

Common Pitfalls

  1. Writing target as a single tag instead of a brace-enclosed list: target = SWE is incorrect — even when only one country is involved, it must be written as target = { SWE } or referenced via a constant: scripted constant; otherwise the game cannot parse the target list correctly.
  2. Assuming inner triggers share the outer scope: all_country_of switches the scope to each country in target, so triggers written inside are evaluated against those target countries — not against the country in the original executing scope. Beginners often mistakenly use conditions inside that only make sense for the original scope, leading to broken logic.