Wiki

effect · remove_state_resistance_compliance_modifier

Definition

  • Supported scope:any
  • Supported target:none

Description

removes either a resistance or compliance modifier from a state.
Can only use modifiers from the resistance_modifiers.txt/compliance_modifiers.txt that are marked as is_dynamic = yes

#### Example

remove_state_resistance_compliance_modifier = { modifier = dynamic_modifier_name state = 738 }

实战 · 配合 · 坑

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

实战用法

在占领系统相关 mod 中,当某一动态合规或抵抗修正需要根据剧情事件或玩家决策被撤销时,使用此指令精准移除之前通过 add_state_resistance_compliance_modifier 施加的动态修正器,避免修正器永久堆叠。例如,玩家完成某项"安抚政策"事件后,移除之前施加的反抗压力修正:

# 在事件 option 中,完成安抚后移除对特定州的抵抗修正
option = {
    name = pacify_event.1.a
    remove_state_resistance_compliance_modifier = {
        modifier = harsh_occupation_resistance_debuff
        state = 738
    }
}

配合关系

  • [add_state_resistance_compliance_modifier](/wiki/effect/add_state_resistance_compliance_modifier):添加动态修正的对应逆操作,通常成对出现,用于实现"施加→条件触发→移除"的完整生命周期管理。
  • [has_variable](/wiki/trigger/has_variable):在 if 块中先检查某变量确认该修正器当前是否处于激活状态,防止重复或错误移除。
  • [if](/wiki/effect/if):包裹本指令,确保只在满足特定条件(如州已被占领或事件已触发)时才执行移除,避免空操作或逻辑错误。
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):由于动态修正器的移除在 UI 上不会自动生成友好描述,需要手动配合此指令向玩家展示清晰的效果提示。

常见坑

  1. 未标记 is_dynamic = yes 的修正器无法被此指令处理:新手常直接引用 resistance_modifiers.txtcompliance_modifiers.txt 中的静态修正器名称,导致指令静默失败而不报错,务必确认目标修正器定义中包含 is_dynamic = yes
  2. state 字段填写错误导致指令作用于错误地区state 需填写正确的州 ID(整数),若在动态场景下州 ID 不固定,应通过变量或 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

In occupation system-related mods, when a dynamic compliance or resistance modifier needs to be revoked based on story events or player decisions, use this command to precisely remove dynamic modifiers previously applied via add_state_resistance_compliance_modifier, preventing permanent modifier stacking. For example, after a player completes a "pacification policy" event, remove the previously applied resistance pressure modifier from a specific state:

# In event option, after pacification is complete, remove resistance modifier from specific state
option = {
    name = pacify_event.1.a
    remove_state_resistance_compliance_modifier = {
        modifier = harsh_occupation_resistance_debuff
        state = 738
    }
}

Synergy

  • [add_state_resistance_compliance_modifier](/wiki/effect/add_state_resistance_compliance_modifier): The counterpart operation for adding dynamic modifiers, typically appearing in pairs to implement a complete lifecycle management of "apply → condition trigger → remove".
  • [has_variable](/wiki/trigger/has_variable): Check a variable first within an if block to confirm whether the modifier is currently active, preventing duplicate or erroneous removals.
  • [if](/wiki/effect/if): Wrap this command to ensure removal only executes when specific conditions are met (e.g., state is occupied or event has triggered), avoiding null operations or logical errors.
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): Since the removal of dynamic modifiers does not automatically generate user-friendly descriptions in the UI, manually pair this command with the removal to display clear effect tooltips to the player.

Common Pitfalls

  1. Modifiers not marked with is_dynamic = yes cannot be processed by this command: Beginners often directly reference static modifier names from resistance_modifiers.txt or compliance_modifiers.txt, causing the command to silently fail without error reporting. Always verify that the target modifier definition includes is_dynamic = yes.
  2. Incorrect state field values cause the command to affect the wrong region: The state field must contain the correct state ID (integer). If the state ID is not fixed in dynamic scenarios, it should be passed via variables or scopes rather than hardcoded, otherwise the modifier on an unintended state may be removed.