Wiki

trigger · has_attache

Definition

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

Description

Has attaché from any other country

实战 · 配合 · 坑

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

实战用法

has_attache 常用于外交类 mod 中,判断本国是否已接受其他国家的武官派驻,从而开放特定决策或触发外交事件。例如,可以在决策的 available 块中用它限制只有接受过武官的国家才能获取军事情报共享奖励。

# 决策:借助武官渠道申请军备援助
available = {
    has_attache = yes
    is_in_faction = no
}

配合关系

  • [has_attache_from](/wiki/trigger/has_attache_from)has_attache 判断"是否存在任何武官",配合 has_attache_from 可进一步锁定具体来源国,实现更精细的外交条件链。
  • [gives_military_access_to](/wiki/trigger/gives_military_access_to):武官派驻往往伴随军事通行权,两者组合可构建"深度军事合作"的复合判断条件。
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier):确认武官存在后,用该 effect 动态调整双边关系值,模拟武官外交带来的好感度变化。
  • [any_allied_country](/wiki/trigger/any_allied_country):在迭代盟友时结合 has_attache 检查哪些盟友已派驻武官,用于批量触发相关外交奖励。

常见坑

  1. 混淆主动/被动方向has_attache 判断的是"本 scope 国家被其他国家派驻了武官"(被动接受方),而非本国向外派出武官,新手容易将两者搞反,导致条件永远不成立或逻辑颠倒。
  2. 忘记 scope 限定:该 trigger 只能在 COUNTRY scope 下使用,若在 STATE 或 CHARACTER scope 内直接调用会导致脚本报错,需确保外层 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 is commonly used in diplomatic mods to check whether your country has accepted a military attaché from another nation, thereby unlocking specific decisions or triggering diplomatic events. For example, you can use it in a decision's available block to restrict military intelligence sharing bonuses only to countries that have accepted attachés.

# Decision: Request military aid through attaché channels
available = {
    has_attache = yes
    is_in_faction = no
}

Synergy

  • [has_attache_from](/wiki/trigger/has_attache_from): While has_attache checks "whether any attaché exists," combining it with has_attache_from lets you pinpoint the specific source nation, enabling more granular diplomatic condition chains.
  • [gives_military_access_to](/wiki/trigger/gives_military_access_to): Military attaché deployment typically comes with military access rights; using both together builds compound conditions for "deep military cooperation" checks.
  • [add_opinion_modifier](/wiki/effect/add_opinion_modifier): After confirming an attaché exists, use this effect to dynamically adjust bilateral relationship values, simulating diplomatic goodwill changes brought by attaché presence.
  • [any_allied_country](/wiki/trigger/any_allied_country): When iterating through allies, combine has_attache to check which allies have deployed attachés, useful for batch-triggering related diplomatic rewards.

Common Pitfalls

  1. Confusing active and passive directions: has_attache checks whether "this scope's nation has received an attaché from another nation" (passive recipient), not whether your nation deployed attachés abroad. Newcomers often reverse the logic, causing conditions to never trigger or create inverted logic.
  2. Forgetting scope constraints: This trigger only works within COUNTRY scope; calling it directly in STATE or CHARACTER scope will cause script errors. Always ensure the outer scope is correctly switched to the target nation.