Wiki

trigger · tag

Definition

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

Description

country tag trigger

实战 · 配合 · 坑

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

实战用法

tag 是最基础的国家身份判断,常用于限制某个 focus、决策或事件选项仅对特定国家生效,例如只有德国才能触发某条特殊决策,或在 any/all 循环中排除本国。在事件 trigger 块或 limit 块中配合其他条件组合,可以精确地为不同国家定制不同的历史分支路线。

# 仅德国可用的决策
available = {
    tag = GER
    has_war_support > 0.5
}

# 在 any_neighbor_country 循环中排除自身
any_neighbor_country = {
    NOT = { tag = ROOT }
    is_in_faction_with = ROOT
}

配合关系

  • [exists](/wiki/trigger/exists):通常先用 exists 确认目标国家存在于当前游戏中,再用 tag 判断其具体身份,避免对已被吞并的国家触发逻辑。
  • [has_completed_focus](/wiki/trigger/has_completed_focus):与 tag 组合,限定「某个特定国家完成了某个国策」才满足条件,用于构建国家互动剧情节点。
  • [any_allied_country](/wiki/trigger/any_allied_country):在同盟循环作用域内用 tag 筛选某个具体盟友是否存在,是多国联动事件的标准写法。
  • [country_event](/wiki/effect/country_event):在效果块中先用 tag 条件锁定触发对象,再发送定向事件,保证事件只流向预期国家。

常见坑

  1. 作用域混淆:在 any_owned_stateany_neighbor_country 等 scope 内直接写 tag = GER 时,此时 scope 已切换到 STATE 或其他国家,tag 判断的是当前 scope 的国家而非原始作用域,需要用 ROOT/PREV 回溯到正确的国家 scope,否则条件永远不会按预期工作。
  2. 大小写拼写错误:国家标签必须完全匹配游戏内的三字母大写代码(如 SOV 而非 sovUSSR),拼错会导致条件静默失败,且游戏不会报错提示,排查时极易遗漏。

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

tag is the most fundamental trigger for country identity verification, commonly used to restrict a focus, decision, or event option to specific nations—for example, allowing only Germany to trigger a particular special decision, or excluding the player's own nation in any/all loops. Combined with other conditions in event trigger or limit blocks, it enables precise branching of historical paths tailored to different countries.

# Decision available only to Germany
available = {
    tag = GER
    has_war_support > 0.5
}

# Exclude self within any_neighbor_country loop
any_neighbor_country = {
    NOT = { tag = ROOT }
    is_in_faction_with = ROOT
}

Synergy

  • [exists](/wiki/trigger/exists): Typically use exists first to confirm the target nation exists in the current game, then use tag to verify its specific identity, avoiding logic triggers on annexed nations.
  • [has_completed_focus](/wiki/trigger/has_completed_focus): Combined with tag, restricts the condition to "a specific nation has completed a particular focus tree branch," useful for constructing diplomatic story nodes between nations.
  • [any_allied_country](/wiki/trigger/any_allied_country): Within any_allied_country loop scope, use tag to filter whether a specific ally exists—the standard pattern for multi-nation coordinated events.
  • [country_event](/wiki/effect/country_event): In effect blocks, first lock the trigger target with tag conditions, then send the targeted event, ensuring the event reaches only the intended nation.

Common Pitfalls

  1. Scope Confusion: When writing tag = GER directly inside scopes like any_owned_state or any_neighbor_country, the scope has already shifted to STATE or another nation—tag evaluates the current scope's nation, not the original context. Use ROOT/PREV to trace back to the correct nation scope, otherwise the condition will never function as intended.
  2. Case and Spelling Errors: Country tags must exactly match the three-letter uppercase codes in-game (e.g., SOV not sov or USSR). Misspelled tags cause silent condition failures with no error messages, making them easy to miss during debugging.