Wiki

effect · add_province_modifier

Definition

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

Description

Adds static modifiers to specified province.
add_province_modifier = {
	static_modifiers = { mod_1 mod_2 }
	days = 42 # will be temporary if specified, can be variable
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 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

add_province_modifier 常用于事件或决议中为特定省份附加临时或永久的静态修正,例如在战争事件中给某个沿海省份施加"港口封锁"减益,或在决议完成后为含胜利点的省份附加生产加成。示例:为当前州内所有海军基地省份添加一个限时修正:

add_province_modifier = {
    static_modifiers = { naval_blockade_debuff }
    days = 180
    province = {
        limit_to_naval_base
    }
}

配合关系

  • [remove_province_modifier](/wiki/effect/remove_province_modifier):与 add_province_modifier 成对使用,在事件或效果结束时手动移除未指定 days 的永久修正,避免修正残留。
  • [add_state_modifier](/wiki/effect/add_state_modifier):当需要在州级别而非省级别施加修正时配合使用,两者覆盖粒度不同,常同时出现在同一事件选项中以实现多层叠加效果。
  • [has_occupation_modifier](/wiki/trigger/has_occupation_modifier):在触发条件中检查占领修正是否存在,从而决定是否需要叠加省份修正,避免重复施加。
  • [any_province_building_level](/wiki/trigger/any_province_building_level):在执行 add_province_modifier 前先检查省份建筑等级,确保只对符合条件的省份施加修正,逻辑更精确。

常见坑

  1. 混淆 static_modifiers 与动态修正add_province_modifier 只接受在 00_static_modifiers.txt(或对应文件)中定义的静态修正,直接填写 add_dynamic_modifier 使用的动态修正名称会静默失效,不报错但毫无效果。
  2. 忘记 days 导致修正永久残留:不填 days 时修正为永久生效,若事件或决议逻辑没有配套的 remove_province_modifier,该修正将一直存在直到存档结束,在反复触发的循环事件中尤其容易造成修正不断叠加堆积。

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

add_province_modifier is commonly used in events or decisions to attach temporary or permanent static modifiers to specific provinces. For example, apply a "naval blockade" debuff to a coastal province during a war event, or add production bonuses to victory point provinces after a decision is completed. Example: Add a time-limited modifier to all naval base provinces within the current state:

add_province_modifier = {
    static_modifiers = { naval_blockade_debuff }
    days = 180
    province = {
        limit_to_naval_base
    }
}

Synergy

  • [remove_province_modifier](/wiki/effect/remove_province_modifier): Used in pair with add_province_modifier to manually remove permanent modifiers that lack days specification when events or effects conclude, preventing modifier residue.
  • [add_state_modifier](/wiki/effect/add_state_modifier): Applied when modifiers need to be applied at state level rather than province level. Both commands operate at different granularities and often appear together in the same event option to achieve multi-layer stacking effects.
  • [has_occupation_modifier](/wiki/trigger/has_occupation_modifier): Check in trigger conditions whether occupation modifiers exist, then decide whether additional province modifiers need to be stacked, preventing duplicate application.
  • [any_province_building_level](/wiki/trigger/any_province_building_level): Check province building levels before executing add_province_modifier to ensure modifiers are only applied to qualifying provinces, making the logic more precise.

Common Pitfalls

  1. Confusing static_modifiers with dynamic modifiers: add_province_modifier only accepts static modifiers defined in 00_static_modifiers.txt (or corresponding files). Directly inserting dynamic modifier names used by add_dynamic_modifier will silently fail without error, producing no effect whatsoever.
  2. Forgetting days causes modifiers to persist permanently: Without specifying days, the modifier takes permanent effect. If the event or decision logic lacks a corresponding remove_province_modifier, the modifier will remain indefinitely until save game ends. This is especially problematic in recurring loop events where modifiers continuously stack and accumulate.