Hands-On Usage
set_occupation_law is commonly used in occupation events or decisions to dynamically switch occupation policies based on current compliance, resistance strength, or war progress. For example, in a mod you might implement "automatically upgrade to a more lenient law when a region's compliance reaches a threshold." It can also set default occupation laws for the occupying nation when a country is puppeted or made a subject, simulating more granular political control mechanics.
# Germany forcibly sets military governor occupation on Poland's state 123
GER = {
123 = {
set_occupation_law = military_governor_occupation
}
}
# Remove Germany's state-level override on Poland, reverting to default law
GER = {
POL = {
set_occupation_law = default_law
}
}
Synergy
[occupation_law](/wiki/trigger/occupation_law): First check if the current occupation law is already the target type to avoid redundant assignments or branch on conditions (e.g., only upgrade if the current law is a certain value).
[compliance](/wiki/trigger/compliance): Compliance is the core decision factor for switching occupation laws; commonly paired with set_occupation_law to automatically trigger more lenient or stricter law changes when compliance reaches specific thresholds.
[add_compliance](/wiki/effect/add_compliance): Adjust compliance while setting a new occupation law to simulate the immediate morale effects of policy adjustments.
[has_active_resistance](/wiki/trigger/has_active_resistance): Check for active resistance movements; combined use allows forcibly switching to harsher occupation laws when resistance is strong.
Common Pitfalls
- Incorrect scope nesting: This effect requires a nested structure where the outer scope is the occupying nation (COUNTRY) and the inner scope is the occupied nation or state. If you write
set_occupation_law directly at the top-level country scope without nesting, it actually modifies that nation's own default law rather than applying an override to a specific country or state. Beginners often mistakenly treat these as equivalent.
- Misusing
default_law as a regular law token: default_law is a special-purpose reset/remove override marker, not the name of an actual occupation law. Using it to "set" an occupation law actually clears the override or reverts to the initial law defined by starting_law=yes. If you intend to set a specific policy, use the corresponding law token instead.