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
- 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.
- 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.