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