Wiki

trigger · all_neighbor_country

Definition

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

Description

check if all neighbor countries meet the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

all_neighbor_country 常用于外交或科技 focus/decision 的条件判断,例如要求某国的所有邻国都满足特定政体、阵营或战争状态,才允许触发事件或解锁决策。典型场景包括:检查某国是否已将周边国家全部收入阵营、或所有邻国均已被纳入傀儡体系后才开放终局选项。

# 当本国所有邻国都是本国的傀儡时,允许触发某个决策
available = {
    all_neighbor_country = {
        is_subject_of = ROOT
    }
}

也可以结合 tooltip 键来覆盖默认提示文本:

trigger = {
    all_neighbor_country = {
        tooltip = neighbor_must_be_in_faction_tt
        is_in_faction = yes
    }
}

配合关系

  • any_neighbor_country:与 all_neighbor_country 互为补充,前者要求"至少一个邻国满足",后者要求"全部邻国满足",常成对出现在不同难度的条件分支中。
  • is_subject_of:常作为内层条件,用来判断每个邻国是否为特定国家的附属国,配合 all_neighbor_country 实现"周边全部收服"的判断。
  • has_government:在 all_neighbor_country 内检查所有邻国的政体类型,常用于意识形态扩张类 mod 判断周边是否已全部"转化"。
  • has_war:在 all_neighbor_country 内使用,判断所有邻国是否均处于战争状态,用于触发特定的包围或封锁相关事件。

常见坑

  1. 误用 any_neighbor_country 语义:新手容易将"所有邻国"与"任意邻国"混淆,在需要"至少一个邻国满足"时误写了 all_neighbor_country,导致条件几乎永远无法成立(尤其是大国邻国众多时)。
  2. 忘记 scope 限制all_neighbor_country 只能在 COUNTRY scope 下使用;若在 STATE 或 PROVINCE scope 的 limit 块中直接调用,脚本会静默失效或报错,需先用 OWNER 等关键字切换回 COUNTRY 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_neighbor_country is commonly used in diplomatic or technology focus/decision conditions — for example, requiring that all neighboring countries meet a specific government type, faction membership, or war status before an event can fire or a decision becomes available. Typical use cases include: checking whether a country has brought all its neighbors into its faction, or unlocking an endgame option only after all neighbors have been incorporated into a puppet network.

# Allow a decision to trigger only when all of the country's neighbors are its puppets
available = {
    all_neighbor_country = {
        is_subject_of = ROOT
    }
}

You can also combine it with the tooltip key to override the default tooltip text:

trigger = {
    all_neighbor_country = {
        tooltip = neighbor_must_be_in_faction_tt
        is_in_faction = yes
    }
}

Synergy

  • any_neighbor_country: The natural counterpart to all_neighbor_country — the former requires "at least one neighbor satisfies the condition" while the latter requires "every neighbor satisfies the condition." They frequently appear together in condition branches of varying difficulty.
  • is_subject_of: Often used as the inner condition to check whether each neighbor is a subject of a specific country, paired with all_neighbor_country to implement a "all surrounding nations subjugated" check.
  • has_government: Used inside all_neighbor_country to check the government type of every neighboring country; commonly found in ideology-expansion mods to verify that all neighbors have been "converted."
  • has_war: Used inside all_neighbor_country to check whether all neighbors are currently at war, typically to fire events related to encirclement or blockade scenarios.

Common Pitfalls

  1. Confusing any_neighbor_country semantics: Beginners often mix up "all neighbors" with "any neighbor," accidentally writing all_neighbor_country when they only need at least one neighbor to satisfy the condition. This makes the condition nearly impossible to fulfill, especially for major powers with many neighbors.
  2. Forgetting scope restrictions: all_neighbor_country can only be used within a COUNTRY scope. Calling it directly inside a limit block that is in a STATE or PROVINCE scope will cause the script to silently fail or throw an error. You must first switch back to a COUNTRY scope using keywords such as OWNER before invoking it.