Wiki

trigger · any_country

Definition

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

Description

check if any country meets the trigger

实战 · 配合 · 坑

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

实战用法

any_country 常用于检查全局局势——例如判断"是否存在任意一个大国已拥有核武器"来触发某个决议,或检测是否有任何国家与指定势力处于战争状态以解锁特殊事件。此 trigger 在 any scope 下均可使用,非常适合写在 availabletrigger 块中做全局性条件过滤。

# 示例:如果当前存在任意一个主要国家正处于战争中,则该决策不可用
available = {
    NOT = {
        any_country = {
            is_major = yes
            has_war = yes
        }
    }
}

配合关系

  • has_war:最常见的内嵌条件,用于筛选"任意处于战争中的国家",配合 any_country 检查全球战争状态。
  • has_government:在 any_country 内判断是否存在某个意识形态执政的国家,适合用于意识形态扩散相关的 mod 逻辑。
  • is_major:缩小扫描范围至主要大国,避免将小国纳入判断导致条件误触发。
  • has_country_flag:在 any_country 内检查是否有国家被打上了特定标记,适合追踪跨国事件链的推进状态。

常见坑

  1. any_country 当 effect 用any_country 是纯条件判断,不能放在 effect 块中对所有符合条件的国家执行操作;若想对多个国家执行 effect,应改用 every_country(注意:every_country 不在本页 effect 白名单内,实际使用前请确认你的游戏版本支持),或在 effect 内通过具体 tag 逐一操作。
  2. 忘记嵌套作用域any_country 内部的 trigger 以被迭代的那个国家为 scope,而非外层的 ROOT 或 THIS;新手常错误地在内部写针对外层国家的条件(如想判断 ROOT 的状态却直接写,实际判断的是被枚举的国家),需要用 ROOT 显式引用外层国家。

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_country is commonly used to assess the global situation — for example, checking whether any major power has already acquired nuclear weapons in order to trigger a resolution, or detecting whether any country is at war with a specified faction to unlock a special event. This trigger is valid in any scope, making it ideal for use inside available or trigger blocks as a global condition filter.

# Example: if any major country is currently at war, this decision becomes unavailable
available = {
    NOT = {
        any_country = {
            is_major = yes
            has_war = yes
        }
    }
}

Synergy

  • has_war: The most common nested condition — used to filter for any country currently at war, paired with any_country to check global war status.
  • has_government: Used inside any_country to check whether any country is governed by a particular ideology; well-suited for mod logic related to ideological spread.
  • is_major: Narrows the scan to major powers, preventing minor nations from accidentally satisfying the condition and causing false positives.
  • has_country_flag: Used inside any_country to check whether any country has been tagged with a specific flag; useful for tracking the progress of cross-national event chains.

Common Pitfalls

  1. Using any_country as an effect: any_country is a pure condition check and cannot be placed inside an effect block to perform operations on all matching countries. If you want to apply an effect to multiple countries, use every_country instead (note: every_country is not on this page's effect whitelist — verify that your game version supports it before use), or operate on specific tags one by one within the effect block.
  2. Forgetting nested scope behavior: Triggers inside any_country evaluate against the country being iterated, not the outer ROOT or THIS. A common beginner mistake is writing conditions inside the block that are intended to target the outer country — for instance, trying to check ROOT's state but inadvertently checking the enumerated country instead. Use ROOT explicitly to reference the outer country when needed.