Wiki

trigger · has_attache_from

Definition

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

Description

Has attaché from specified country

实战 · 配合 · 坑

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

实战用法

has_attache_from 常见于外交类 mod 中,用于判断本国是否已接受某国派驻的武官,从而解锁特定的合作决策或科技共享选项。例如,当玩家与盟友建立武官关系后,才能触发额外的军事援助事件链。

# 仅当已接受德国武官时,才允许执行该决策
available = {
    has_attache_from = GER
}

配合关系

  • [has_attache](/wiki/trigger/has_attache) — 先用 has_attache 判断本国是否向外派驻了武官,再搭配 has_attache_from 判断双向武官关系是否完整,常用于对等外交条件检查。
  • [gives_military_access_to](/wiki/trigger/gives_military_access_to) — 武官关系通常与军事通行权绑定,两者联用可构建更严格的军事合作门槛条件。
  • [any_allied_country](/wiki/trigger/any_allied_country) — 在 any_allied_country 的循环 scope 内嵌套本 trigger,可批量检查联盟中是否有任意盟国已派驻武官。
  • [diplomatic_relation](/wiki/effect/diplomatic_relation) — 当条件满足时,通过该 effect 进一步修改外交关系,形成"有武官 → 提升关系"的完整逻辑链。

常见坑

  1. scope 混淆:本 trigger 必须在 COUNTRY scope 下使用,新手容易误写在 STATE scope(如 limit 块内指向某个州时),导致脚本报错或静默失效。
  2. target 填错:target 必须是具体国家 TAG(如 GER)或支持的 scope 关键字(THIS/ROOT 等),直接填国家名称字符串或使用不在白名单内的 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

has_attache_from is commonly used in diplomacy-focused mods to check whether your country has accepted a military attaché from another nation, thereby unlocking specific diplomatic decisions or technology sharing options. For example, after establishing an attaché relationship with an ally, you can trigger additional military aid event chains.

# Only allow this decision when a German attaché has been accepted
available = {
    has_attache_from = GER
}

Synergy

  • [has_attache](/wiki/trigger/has_attache) — Use has_attache first to check if your country has sent out military attachés, then pair it with has_attache_from to verify whether the bilateral attaché relationship is complete; commonly used for reciprocal diplomatic condition checks.
  • [gives_military_access_to](/wiki/trigger/gives_military_access_to) — Attaché relationships are typically tied to military access rights; using both together establishes stricter military cooperation thresholds.
  • [any_allied_country](/wiki/trigger/any_allied_country) — Nest this trigger within the scope loop of any_allied_country to batch-check whether any ally in the alliance has sent a military attaché.
  • [diplomatic_relation](/wiki/effect/diplomatic_relation) — Once conditions are met, use this effect to further modify diplomatic relations, forming a complete logic chain of "has attaché → improve relations."

Common Pitfalls

  1. Scope confusion: This trigger must be used under COUNTRY scope; beginners often mistakenly place it in STATE scope (such as within limit blocks pointing to a specific state), resulting in script errors or silent failures.
  2. Incorrect target: The target must be a concrete country TAG (such as GER) or supported scope keywords (THIS/ROOT, etc.); directly entering a country name string or using scope keywords not in the whitelist will cause the condition to never evaluate to true.