Wiki

effect · remove_decision

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Remove specified active decision for scope country - Does not run the remove_effect or put the decision on cooldown. Ignores fire_only_once

实战 · 配合 · 坑

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

实战用法

remove_decision 常用于 mod 中需要手动清除某个进行中决议的场景,例如某个事件触发后强制取消玩家或 AI 正在激活的限时决议,或在国家转型(政变、内战结束)时清理旧阵营遗留的决议。值得注意的是,它不会触发决议的 remove_effect,也不会产生冷却时间,适合"静默撤销"的需求。

country_event = {
    id = my_mod.10
    # 政变成功,清除旧政府的外交斡旋决议
    immediate = {
        remove_decision = diplomatic_mediation_decision
    }
}

配合关系

  • [has_decision](/wiki/trigger/has_decision):在移除前先检查该决议是否处于激活状态,避免脚本报错或逻辑异常。
  • [activate_decision](/wiki/effect/activate_decision):与 remove_decision 形成"撤销-重新激活"组合,常用于重置决议状态或切换决议变体。
  • [add_days_remove](/wiki/effect/add_days_remove):若只想加速决议自然到期而非强制静默移除,可选此命令作为替代方案对比考量。
  • [clr_country_flag](/wiki/effect/clr_country_flag):决议激活时往往会设置国家 flag,移除决议后通常需要同步清除对应 flag,防止后续条件判断出错。

常见坑

  1. 误以为会触发 remove_effectremove_decision 属于"强制移除"而非正常到期,决议内定义的 remove_effect不会执行,如果该块里有重要的收尾逻辑(如清除 modifier、归还资源),必须在调用 remove_decision 的同一上下文中手动补写这些效果。
  2. 在非 COUNTRY scope 下使用:该 effect 仅支持 COUNTRY scope,若写在 every_owned_state 或角色相关的 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

remove_decision is commonly used in mods when you need to manually clear an ongoing decision, such as forcing the cancellation of a time-limited decision that the player or AI is currently activating after a certain event triggers, or cleaning up decisions left behind by the old faction when a nation transitions (coup, civil war ends). Notably, it does not trigger the decision's remove_effect, nor does it generate cooldown time, making it suitable for "silent revocation" scenarios.

country_event = {
    id = my_mod.10
    # Coup successful, remove the old government's diplomatic mediation decision
    immediate = {
        remove_decision = diplomatic_mediation_decision
    }
}

Synergy

  • [has_decision](/wiki/trigger/has_decision): Check whether the decision is in an active state before removal to avoid script errors or logic anomalies.
  • [activate_decision](/wiki/effect/activate_decision): Forms a "revoke-reactivate" combination with remove_decision, commonly used to reset decision states or switch decision variants.
  • [add_days_remove](/wiki/effect/add_days_remove): If you only want to expedite natural decision expiration rather than force silent removal, this command serves as an alternative for comparison.
  • [clr_country_flag](/wiki/effect/clr_country_flag): When a decision is activated, it often sets a country flag; after removing the decision, you typically need to synchronously clear the corresponding flag to prevent subsequent condition checks from failing.

Common Pitfalls

  1. Mistaking it for triggering remove_effect: remove_decision is a "forced removal" rather than normal expiration; the remove_effect block defined within the decision will not execute. If that block contains critical cleanup logic (such as clearing modifiers, returning resources), you must manually add these effects in the same context where remove_decision is called.
  2. Using it outside COUNTRY scope: This effect only supports COUNTRY scope. Writing it within every_owned_state or character-related scopes will cause script parsing errors. Ensure the execution block belongs to the correct country scope.