Wiki

trigger · resistance

Definition

  • Supported scope:STATE
  • Supported target:any

Description

Compares the current resistance level of a state to a value. Example: resistance > 50

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

resistance is commonly used in occupation management mods to check whether a state's resistance level exceeds a threshold within the available/trigger block of a decision or event, thereby triggering suppression actions, switching occupation laws, or unlocking specific options. For example, automatically triggering an event to alert the player when resistance surpasses a critical threshold:

# Check if resistance exceeds the alert threshold in state scope
available = {
    resistance > 50
}

Synergy

  • [has_active_resistance](/wiki/trigger/has_active_resistance): Use it first to confirm the state has an active resistance network, then use resistance for precise numeric filtering to avoid meaningless checks on states without resistance.
  • [compliance](/wiki/trigger/compliance): Resistance and compliance are often inversely related; checking both simultaneously constructs more granular occupation state conditions (e.g., trigger only when "compliance is low AND resistance is high").
  • [set_occupation_law](/wiki/effect/set_occupation_law): Once the resistance trigger condition is met, switch to stricter occupation laws in the effect block to suppress resistance.
  • [add_resistance](/wiki/effect/add_resistance): In testing or events, use it to manually adjust resistance values to verify whether the resistance trigger condition works as expected.

Common Pitfalls

  1. Scope in wrong location: resistance only works in STATE scope; placing it in a COUNTRY scope trigger block will silently fail or throw an error. Ensure the outer scope has been switched to STATE scope via every_state/any_neighbor_state or similar iteration commands.
  2. Misusing equality comparison: Resistance is a floating-point number; directly writing resistance = 50 will almost never hit the exact value. Always use >, <, >=, <= for range comparisons instead.