Wiki

effect · set_occupation_law_where_available

Definition

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

Description

See set_occupation_law for basic functionality. What differentiates this effect is that if the law is not available on the given level it will attempt to set it on a level below. I.e. if the law can't be set as the default law it will try to set it on each country, and if that fails it will try to set it on each state. Any existing law overrides below a level at which a law is successfully set will be cleared.

Example:
ITA = { set_occupation_law_where_available = colonial_police } # Set law in all countries/states where it's available.
ITA = { every_occupied_country = { set_occupation_law_where_available = default_law } } # Remove all country and state overrides.

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_occupation_law_where_available is commonly used in mods for mass deployment of occupation laws across multiple territories. For example, after a nation completes a specific national focus or event, it can automatically switch all occupied regions to a designated law without manually checking which regions are eligible for that law. Compared to set_occupation_law, it automatically attempts degradation (default → country-wide coverage → state-wide coverage), making it especially suitable for large-scale occupation management across multiple nations and states.

# After a nation completes the "Colonial Integration" focus, deploy colonial police system across all occupied territories
complete_national_focus = colonial_integration
hidden_effect = {
    ITA = {
        set_occupation_law_where_available = colonial_police
    }
}

# Clear all nation/state-level overrides and restore default law
ITA = {
    every_occupied_country = {
        set_occupation_law_where_available = default_law
    }
}

Synergy

  • [occupation_law](/wiki/trigger/occupation_law): Check the current occupation law status before setting to avoid duplicate triggers or logical conflicts.
  • [set_occupation_law](/wiki/effect/set_occupation_law): Use this command when precise control over a specific tier (no degradation fallback) is required; the two commands form a complementary relationship between fine-grained and coarse-grained control.
  • [compliance](/wiki/trigger/compliance): The effects of occupation laws are typically linked to compliance levels. Pairing with this trigger allows you to set compliance thresholds before implementing more lenient laws.
  • [add_compliance](/wiki/effect/add_compliance): After changing occupation laws, compliance adjustments are often needed to simulate population sentiment changes during the policy transition period.

Common Pitfalls

  1. Mistaking this effect as completely equivalent to set_occupation_law: Beginners often use this command even when setting a single-tier law is sufficient, accidentally clearing state/nation-level overrides below that tier (the effect "clears all overrides below this tier after successful application"), destroying carefully designed differentiated occupation policies.
  2. Calling in STATE scope of non-occupied regions produces no effect but no error: If the target STATE is not under any occupation status, this command fails silently without any warning, making it difficult to detect unapplied laws during mod debugging. It's recommended to validate with [occupation_law](/wiki/trigger/occupation_law) or related conditions beforehand.