Wiki

trigger · any_country_with_core

Definition

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

Description

check if any country with a core on the scoped state meets the trigger. tooltip=key can be defined to override title

实战 · 配合 · 坑

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

实战用法

any_country_with_core 常用于判断某个州被多个国家声索时是否满足特定条件,例如检查争议领土的所有声索国中是否有任何一方处于战争状态,或用于释放傀儡/转让领土前的前置判断。典型场景包括:在事件或决策中,仅当争议州的所有核心国之一已完成某项科技或具备某个 idea 时才触发。

# 在某个 STATE scope 下:检查该州是否有任何核心国正在参与战争
focus = {
    id = example_focus
    available = {
        # 当前 scope 为 STATE(通过 every_owned_state 等进入)
        any_country_with_core = {
            has_war = yes
        }
    }
}

# 或在 limit 块中使用,筛选出"至少有一个核心国存在且为主要国家"的州
every_owned_state = {
    limit = {
        any_country_with_core = {
            is_major = yes
        }
    }
    add_resource = {
        type = steel
        amount = 2
    }
}

配合关系

  • any_owned_state — 先通过 any_owned_state 遍历己方持有的州,再在内部使用 any_country_with_core 检查该州的声索国情况,两者常嵌套使用。
  • has_war — 配合检查声索国是否处于战争状态,是判断争议地区局势最常见的组合。
  • is_major — 用来确认某核心国的体量,以决定是否值得触发相关外交或战争逻辑。
  • transfer_state — 在确认核心国满足条件后,通过 transfer_state 将该州划转,二者形成"条件判断→执行转让"的完整逻辑链。

常见坑

  1. Scope 混淆any_country_with_core 必须在 STATE scope 下调用,直接写在 COUNTRY scope 的 trigger 块里会报错或静默失效。进入 STATE scope 通常需要先通过 any_owned_stateevery_owned_state 等命令,初学者容易忘记切换 scope 而直接使用。
  2. 把它当 COUNTRY scope 的 any_country 使用:该 trigger 只遍历"对当前州拥有 core"的国家,而不是所有国家;若需要检查全体国家则应换用其他遍历方式,混淆两者会导致条件覆盖范围远小于预期。

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_with_core is commonly used to check whether a specific condition is met among all countries that have a core on a given state — for example, determining whether any claimant to a disputed territory is currently at war, or as a prerequisite check before releasing a puppet or transferring a state. Typical scenarios include: in events or decisions, triggering only when at least one of the core nations of a disputed state has researched a particular technology or possesses a specific idea.

# Under a STATE scope: check whether any country with a core on this state is at war
focus = {
    id = example_focus
    available = {
        # Current scope is STATE (entered via every_owned_state or similar)
        any_country_with_core = {
            has_war = yes
        }
    }
}

# Or used inside a limit block, filtering for states where at least one core nation exists and is a major country
every_owned_state = {
    limit = {
        any_country_with_core = {
            is_major = yes
        }
    }
    add_resource = {
        type = steel
        amount = 2
    }
}

Synergy

  • any_owned_state — Iterate over your own held states with any_owned_state first, then use any_country_with_core inside to inspect the claimants of each state. These two are frequently nested together.
  • has_war — Paired with any_country_with_core to check whether a claimant is at war; this is the most common combination for assessing the situation in a disputed region.
  • is_major — Used to verify the weight of a core nation, helping decide whether it is worth triggering related diplomatic or war logic.
  • transfer_state — After confirming that a core nation meets the required conditions, transfer_state is used to hand over the state, forming a complete "condition check → execute transfer" logic chain.

Common Pitfalls

  1. Scope confusion: any_country_with_core must be called within a STATE scope. Writing it directly inside a trigger block that is in a COUNTRY scope will cause an error or silent failure. Entering a STATE scope typically requires going through commands such as any_owned_state or every_owned_state first; beginners often forget to switch scope before using this trigger.
  2. Treating it as a COUNTRY-scope any_country: This trigger only iterates over countries that have a core on the current state — not all countries. If you need to check all countries, a different iteration method should be used instead. Confusing the two will result in the condition covering a far smaller set of countries than intended.