Wiki

effect · remove_power_balance_modifier

Definition

  • Supported scope:any
  • Supported target:none

Description

removes static modifier from power balance

Example:
remove_power_balance_modifier = {
	id = power_balance_id
	modifier = static_modifier_id # this must be defined in the static modifier database
}

实战 · 配合 · 坑

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

实战用法

remove_power_balance_modifier 常用于权力平衡(Power Balance)系统的动态管理场景,例如当某个事件结束、某国退出阵营或某一阶段完成时,需要撤销之前施加的静态修正值。典型场景是在一场外交危机事件的 option 中,玩家选择妥协后移除之前代表强硬立场的平衡修正。

# 危机和解事件选项:移除代表对抗态势的平衡修正
option = {
    name = my_crisis_event.1.a
    remove_power_balance_modifier = {
        id = my_cold_war_balance
        modifier = hawkish_stance_modifier
    }
}

配合关系

  • [add_power_balance_modifier](/wiki/effect/add_power_balance_modifier):与本命令成对使用,添加修正与移除修正构成完整的生命周期管理,先 add 后 remove 是标准范式。
  • [remove_all_power_balance_modifiers](/wiki/effect/remove_all_power_balance_modifiers):当需要一次性清空某个权力平衡上的所有修正时作为批量替代方案,与本命令形成粒度互补。
  • [has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier):在执行移除前用此触发器检查该修正是否确实存在,避免因修正不存在导致的逻辑异常。
  • [add_power_balance_value](/wiki/effect/add_power_balance_value):移除静态修正后,往往需要同步调整平衡数值,两者配合实现状态切换时的精确控制。

常见坑

  1. modifier 字段指向未注册的静态修正modifier 的值必须在 static_modifiers 数据库中有对应定义,直接填写普通 modifier 的名称会导致命令静默失败,且游戏日志中不一定给出明显报错,排查时需仔细核对 static_modifiers 文件。
  2. id 与实际权力平衡 id 不匹配id 必须与 add_power_balance_modifier 或权力平衡定义中使用的 id 严格一致(大小写敏感),如果该 id 下根本没有挂载过这个 modifier,命令不会产生任何效果,新手常因复制粘贴时 id 拼写不一致而浪费大量调试时间。

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_power_balance_modifier is commonly used in dynamic management scenarios of the Power Balance system, such as when an event concludes, a country leaves a faction, or a certain phase completes and previously applied static modifiers need to be revoked. A typical scenario is in an option within a diplomatic crisis event where, after the player chooses to compromise, the balance modifier representing a hardline stance is removed.

# Crisis resolution event option: remove the balance modifier representing confrontational stance
option = {
    name = my_crisis_event.1.a
    remove_power_balance_modifier = {
        id = my_cold_war_balance
        modifier = hawkish_stance_modifier
    }
}

Synergy

  • [add_power_balance_modifier](/wiki/effect/add_power_balance_modifier): Used in tandem with this command, adding and removing modifiers form a complete lifecycle management. The standard pattern is to add first, then remove.
  • [remove_all_power_balance_modifiers](/wiki/effect/remove_all_power_balance_modifiers): When you need to clear all modifiers on a power balance at once, serves as a bulk alternative and complements this command at a different granularity level.
  • [has_power_balance_modifier](/wiki/trigger/has_power_balance_modifier): Use this trigger to check whether the modifier actually exists before executing removal, avoiding logic anomalies caused by a non-existent modifier.
  • [add_power_balance_value](/wiki/effect/add_power_balance_value): After removing static modifiers, you often need to sync adjustments to the balance value; the two work together to achieve precise control during state transitions.

Common Pitfalls

  1. The modifier field points to an unregistered static modifier: The value of modifier must have a corresponding definition in the static_modifiers database. Directly entering the name of an ordinary modifier will cause the command to fail silently, and the game log may not provide a clear error message. During troubleshooting, carefully verify the static_modifiers file.
  2. The id does not match the actual power balance id: The id must be strictly identical (case-sensitive) to the id used in add_power_balance_modifier or the power balance definition. If no modifier has ever been attached to that id, the command will have no effect. Beginners often waste considerable debugging time due to id spelling inconsistencies during copy-paste operations.