Wiki

effect · remove_province_modifier

Definition

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

Description

Removes a static modifiers to specified province
remove_province_modifier = {
	static_modifiers = { mod_1 mod_2 }
Select 1 province:
	province = 500
Or use:
	province = {
		id = 500 id = 501 id = 502 (evaluate for specified provinces)
		all_provinces (includes all in current state)
		limit_to_coastal (only coastal provinces)
		limit_to_border (only provinces bordering different country)
		limit_to_naval_base (only provinces with a naval base)
		limit_to_victory_point (only provinces with a VP)
	}
}

实战 · 配合 · 坑

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

实战用法

remove_province_modifier 常用于事件或决策的"清除阶段",例如当一个特殊事件结束后移除之前通过 add_province_modifier 施加的临时省份加成(如受损基础设施、占领期间的特殊效果等)。也适合在 mod 中配合周期性决策实现"buff 轮换"——先移除旧修正器,再添加新修正器。

# 示例:解除封锁后移除港口封锁修正器
state_event = {
    id = blockade.2
    ...
    immediate = {
        remove_province_modifier = {
            static_modifiers = { port_blockade_penalty }
            province = {
                limit_to_naval_base = yes
            }
        }
    }
}

配合关系

  • [add_province_modifier](/wiki/effect/add_province_modifier):最直接的配套命令,通常先用它添加修正器,再在适当时机用 remove_province_modifier 将其清除,构成完整的"添加—移除"生命周期。
  • [has_occupation_modifier](/wiki/trigger/has_occupation_modifier):在 limit 块中配合使用,可以先检查目标省份是否确实存在某个修正器,避免移除一个不存在的修正器时产生不必要的警告日志。
  • [add_state_modifier](/wiki/effect/add_state_modifier):有时省级修正器和州级修正器需要同步清除,在同一事件选项里将两者配合使用以保持逻辑一致性。
  • [any_province_building_level](/wiki/trigger/any_province_building_level):可在条件判断中筛选出具有特定建筑等级的省份再执行移除,精确控制修正器清除的范围。

常见坑

  1. province 块未指定时默认不生效province 字段是必填的,新手容易只写 static_modifiers 而忘记指定目标省份,导致命令静默失败——既没有报错,修正器也没有被移除。必须明确写 province = 500 或使用省份筛选选项(如 all_provinces)。

  2. 修正器名称必须与 add_province_modifier 时完全一致:如果当初添加时用的是 my_port_mod,移除时写成 my_Port_mod(大小写不同)或拼写有误,游戏不会报错但修正器不会被移除,导致修正器永久残留在省份上。建议在脚本中统一用常量或注释标注修正器名称。

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_province_modifier is commonly used in the "cleanup phase" of events or decisions, such as removing temporary province bonuses previously applied via add_province_modifier after a special event concludes (e.g., infrastructure damage, occupation-period special effects, etc.). It also works well in mods paired with recurring decisions to implement "buff rotation"—first remove the old modifier, then add a new one.

# Example: Remove port blockade modifier after blockade is lifted
state_event = {
    id = blockade.2
    ...
    immediate = {
        remove_province_modifier = {
            static_modifiers = { port_blockade_penalty }
            province = {
                limit_to_naval_base = yes
            }
        }
    }
}

Synergy

  • [add_province_modifier](/wiki/effect/add_province_modifier): The most direct companion command. Typically you use it to add the modifier first, then use remove_province_modifier at the appropriate time to remove it, forming a complete "add—remove" lifecycle.
  • [has_occupation_modifier](/wiki/trigger/has_occupation_modifier): Use together in limit blocks to check whether the target province actually has a certain modifier beforehand, avoiding unnecessary warning logs when trying to remove a non-existent modifier.
  • [add_state_modifier](/wiki/effect/add_state_modifier): Sometimes province-level and state-level modifiers need to be cleared synchronously. Use both together in the same event option to maintain logical consistency.
  • [any_province_building_level](/wiki/trigger/any_province_building_level): Can be used in conditional checks to filter provinces with specific building levels before executing the removal, giving precise control over the scope of modifier cleanup.

Common Pitfalls

  1. province block has no effect when unspecified: The province field is mandatory. Beginners often write only static_modifiers and forget to specify the target province, causing the command to fail silently—no error is reported, but the modifier is not removed either. You must explicitly write province = 500 or use province filtering options (such as all_provinces).

  2. Modifier name must match exactly what was used in add_province_modifier: If you originally added a modifier as my_port_mod but write my_Port_mod (different casing) or misspell it when removing, the game won't report an error but the modifier won't be removed, causing it to permanently persist on the province. It's recommended to use constants or comments in your script to standardize modifier names.