Wiki

trigger · any_home_area_neighbor_country

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if any neighbor country in the home area meets the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

any_home_area_neighbor_country 常用于判断某国在其本土区域的邻国中是否有满足特定条件的国家,适合在外交事件、焦点树或决议的 available / trigger 块中,实现"本土周边形势"的条件检查,比如判断周边是否有大国或正在交战的国家。

# 焦点 available 示例:本土区域邻国中有任何一国正处于战争状态才能选择
focus = {
    id = prepare_for_regional_war
    ...
    available = {
        any_home_area_neighbor_country = {
            has_war = yes
        }
    }
}
# 决议 trigger 示例:本土区域邻国中有共产主义政权才解锁
available = {
    any_home_area_neighbor_country = {
        has_government = communism
    }
}

配合关系

  • has_war — 最常见搭配,检测本土邻国是否已陷入战争,用于判断周边安全局势。
  • has_government — 判断本土邻国的执政党意识形态,适合意识形态扩张或对抗类焦点的解锁条件。
  • is_in_faction — 检测本土邻国是否加入了某阵营,用于判断周边军事联盟压力。
  • is_major — 判断本土邻国中是否有大国存在,常用于小国外交压力或结盟动机的脚本逻辑。

常见坑

  1. is_neighbor_of 混淆any_home_area_neighbor_country 的"邻国"范围限定为**本土区域(home area)**的接壤国,而非当前所有控制领土的邻国;若该国本土已被完全占领或转移,可能返回意料之外的结果,务必在设计时注意本土区域的实际地理范围。
  2. 忘记内部写子条件:该 trigger 必须在花括号内填写至少一个有效的子 trigger 来描述"任意邻国满足什么条件",单独写 any_home_area_neighbor_country = yes 是无效写法,会导致脚本报错或永远返回假。

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

any_home_area_neighbor_country is commonly used to check whether any country neighboring a nation's home area meets specific conditions. It is well-suited for available / trigger blocks in diplomatic events, focus trees, or decisions to evaluate the "regional situation around the home territory" — for example, checking whether any neighboring country is a major power or is currently at war.

# Focus available example: the focus can only be selected if at least one home area neighbor is at war
focus = {
    id = prepare_for_regional_war
    ...
    available = {
        any_home_area_neighbor_country = {
            has_war = yes
        }
    }
}
# Decision trigger example: unlocks only if a communist government exists among home area neighbors
available = {
    any_home_area_neighbor_country = {
        has_government = communism
    }
}

Synergy

  • has_war — The most common pairing; checks whether any home area neighbor has entered a war, useful for assessing regional security conditions.
  • has_government — Checks the ruling ideology of home area neighbors; suitable as an unlock condition for ideology-expansion or ideological-rivalry focuses.
  • is_in_faction — Checks whether any home area neighbor has joined a faction, useful for evaluating nearby military alliance pressure.
  • is_major — Checks whether any home area neighbor is a major power; commonly used in scripting logic for small-nation diplomatic pressure or alliance motivation.

Common Pitfalls

  1. Confusion with is_neighbor_of: The "neighbors" evaluated by any_home_area_neighbor_country are limited to countries bordering the home area specifically, not all territories currently under the country's control. If the nation's home territory has been fully occupied or transferred, this trigger may return unexpected results — always pay close attention to the actual geographic scope of the home area when designing your script.
  2. Forgetting to include a sub-condition inside the braces: This trigger requires at least one valid sub-trigger inside its curly braces to describe what condition any neighbor must satisfy. Writing any_home_area_neighbor_country = yes on its own is invalid and will cause a script error or always evaluate to false.