Wiki

trigger · is_embargoed_by

Definition

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

Description

check if embargoed by specified country

实战 · 配合 · 坑

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

实战用法

is_embargoed_by 常用于贸易/外交类 mod 中,当某国被特定国家封锁贸易时触发特殊事件或解锁反制决议。例如在制裁链剧本里,被封锁的国家满足条件后才能发动"打破封锁"的外交行动。

# 示例:当玩家国家被某强国封锁时,可用的反制决议才变为可选
available = {
    is_embargoed_by = FROM
}

配合关系

  • [break_embargo](/wiki/effect/break_embargo):检测到封锁存在后,通过该 effect 让目标国主动解除封锁,形成"判断→行动"的完整闭环。
  • [has_country_flag](/wiki/trigger/has_country_flag):配合国家标志,追踪封锁事件是否已被触发过,防止重复响应同一封锁状态。
  • [any_allied_country](/wiki/trigger/any_allied_country):遍历盟友,判断是否有盟友同样被同一国封锁,用于实现"集体被制裁"的联合反应逻辑。
  • [has_active_rule](/wiki/trigger/has_active_rule):与贸易规则类条件联用,确保封锁判断在特定经济规则框架下才生效,避免逻辑冲突。

常见坑

  1. target 混淆is_embargoed_by 的 target 填写的是实施封锁的一方,而非被封锁的一方;新手容易把 scope(被封锁国)和 target(发起封锁国)写反,导致条件永远不成立。
  2. scope 范围错误:该 trigger 只在 COUNTRY scope 下有效,若误写在 state scope(如 any_owned_state 内部)中使用,脚本不会报错但逻辑上判断的主体已发生改变,结果会出现非预期行为,务必在进入子 scope 前完成判断或用 ROOT/PREV 回溯。

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

is_embargoed_by is commonly used in trade/diplomatic mods to trigger special events or unlock counter-sanctions decisions when a country is embargoed by a specific nation. For example, in a sanctions chain scenario, an embargoed country can only initiate a "break embargo" diplomatic action after meeting certain conditions.

# Example: When the player's country is embargoed by a major power, 
# counter-sanctions decisions become available
available = {
    is_embargoed_by = FROM
}

Synergy

  • [break_embargo](/wiki/effect/break_embargo): After detecting an embargo exists, use this effect to have the target nation actively lift the embargo, forming a complete "detect → act" loop.
  • [has_country_flag](/wiki/trigger/has_country_flag): Combined with country flags, track whether an embargo event has already been triggered, preventing duplicate responses to the same embargo state.
  • [any_allied_country](/wiki/trigger/any_allied_country): Iterate through allies to determine if any are embargoed by the same nation, useful for implementing "collective sanctions" response logic.
  • [has_active_rule](/wiki/trigger/has_active_rule): Used with trade rule conditions to ensure embargo detection only applies within specific economic rule frameworks, avoiding logical conflicts.

Common Pitfalls

  1. Target Confusion: The target in is_embargoed_by refers to the nation implementing the embargo, not the embargoed nation. Beginners often reverse the scope (embargoed country) and target (embargo-initiating country), causing the condition to never evaluate true.
  2. Scope Range Error: This trigger only works in COUNTRY scope. If mistakenly used within a state scope (such as inside any_owned_state), the script won't error but the logical subject changes unexpectedly, producing unintended behavior. Always complete the check before entering subscopes, or use ROOT/PREV to backtrack.