Wiki

effect · set_resistance

Definition

  • Supported scope:STATE
  • Supported target:any

Description

set resistance of a state. Example: set_resistance = 30

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

set_resistance is commonly used in events or decisions to force the resistance level of an occupied state to a specific value. For example, you might immediately lower the resistance after implementing a conciliatory policy, or raise it after triggering a revolt event to simulate a shift in public sentiment. It's particularly useful when combined with dynamic modifiers and occupation laws—resetting the resistance to a target value when switching occupation laws allows the new policy to take effect from a clean baseline, avoiding anomalous values during transitions.

# In an option of an occupation policy event, force the state's resistance to 30
123 = {  # Target STATE scope
    set_resistance = 30
}

Synergy

  • [set_occupation_law](/wiki/effect/set_occupation_law): When switching occupation laws, you often need to synchronize and reset the resistance value. Combining these two ensures the new occupation law takes effect from a clean baseline.
  • [add_compliance](/wiki/effect/add_compliance): Compliance and resistance are inverse indicators of each other. Using set_resistance to lock the resistance level first, then add_compliance to adjust compliance, allows you to precisely construct the initial occupation state.
  • [resistance](/wiki/trigger/resistance): Used as a conditional check, set_resistance only triggers when the current resistance exceeds or falls below a threshold, preventing unnecessary repeated overwriting of values.
  • [set_compliance](/wiki/effect/set_compliance): Like set_resistance, this is a "direct assignment" command. Both appear in pairs when you need to initialize compliance and resistance simultaneously (such as in mod initialization or major story events).

Common Pitfalls

  1. Forgetting that scope must be STATE: Beginners often write set_resistance = 30 directly inside an if block within COUNTRY scope, resulting in silent errors or ineffective execution. You must first switch to the corresponding state scope using 123 = { … } or every_controlled_state / any_state before calling the command.
  2. Confusing add_resistance semantics: set_resistance is a direct assignment that overwrites the current value unconditionally, while add_resistance is relative increment/decrement. In logic where you want to "lower but not below a certain value," using set_resistance by mistake will unconditionally overwrite the value, causing unexpected jumps.