Wiki

trigger · occupation_law

Definition

  • Supported scope:STATE, COUNTRY
  • Supported target:any

Description

Checks the occupation law for an occupied country, occupied state, or the default occupation law of an occupying country.

- If THIS is a country and it's the same as the PREV country, then THIS's default law is checked.
- If THIS is a country and it's different from the PREV country, then PREV's country law for THIS is checked.
- If THIS is a state, then the occupier's state law is checked.

Example:
GER = { occupation_law = autonomous_occupation }
GER = { POL = { occupation_law = foreign_civilian_oversight } }
123 = { occupation_law = local_police_force_garrison }

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

occupation_law 常用于占领政策相关的决策或国策判断中,例如检测某占领国是否对特定国家实施了足够宽松或严苛的占领法,以此解锁或封闭后续事件链。典型场景包括:当玩家想让某事件仅在占领地区处于特定管理方式时才触发,或在 AI 行为树中判断是否需要调整占领策略。

# 检查德国对波兰实施的占领法是否为外国文官监管
GER = {
    POL = {
        occupation_law = foreign_civilian_oversight
    }
}

# 在决策的 available 块中检查某州的占领法
available = {
    123 = {
        occupation_law = local_police_force_garrison
    }
}

配合关系

  • [set_occupation_law](/wiki/effect/set_occupation_law):最直接的配对,先用 occupation_law 判断当前占领法状态,再用 set_occupation_law 切换为目标法规,形成"条件检测→执行修改"的标准结构。
  • [set_occupation_law_where_available](/wiki/effect/set_occupation_law_where_available):批量更改所有可用州的占领法前,往往先用 occupation_law 过滤特定状态,避免误改已符合条件的地区。
  • [compliance](/wiki/trigger/compliance):占领法直接影响顺从度增长,两者常一起出现在 limit 块中,确保只有顺从度与占领法同时满足条件时才触发后续逻辑。
  • [has_active_resistance](/wiki/trigger/has_active_resistance):抵抗运动强度与占领政策密切相关,组合使用可精确描述"抵抗仍活跃且当前占领法过于宽松"这类复合条件。

常见坑

  1. Scope 方向搞反:在 COUNTRY scope 下写 GER = { occupation_law = ... } 时,如果 PREV 也是 GER(即同一国家),检查的是 GER 的默认占领法;若 PREV 是另一个国家(如 POL),检查的则是 PREV 对 GER 的特定占领法——新手容易忽略这一区别,导致条件永远不符合或始终为真。
  2. 在未被占领的 STATE 上使用:若目标州实际上没有占领者(例如该州归属国自身控制),occupation_law 无法取到有效的占领法值,条件会静默失败而非报错,排查时非常隐蔽,建议配合 [controls_state](/wiki/trigger/controls_state) 或相关检测先确认该州确实处于占领状态。

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

occupation_law is commonly used in occupation policy-related decisions or national focus checks, such as verifying whether an occupying country has imposed a sufficiently lenient or strict occupation law on a specific nation to unlock or gate subsequent event chains. Typical scenarios include: triggering an event only when an occupied territory operates under a specific administrative method, or evaluating whether AI behavior trees need to adjust occupation strategy.

# Check if Germany's occupation law for Poland is set to foreign civilian oversight
GER = {
    POL = {
        occupation_law = foreign_civilian_oversight
    }
}

# In a decision's available block, check a state's occupation law
available = {
    123 = {
        occupation_law = local_police_force_garrison
    }
}

Synergy

  • [set_occupation_law](/wiki/effect/set_occupation_law): The most direct pairing—first use occupation_law to check the current occupation law status, then use set_occupation_law to switch to the target law, forming a standard "condition check → execute change" structure.
  • [set_occupation_law_where_available](/wiki/effect/set_occupation_law_where_available): Before bulk-changing occupation laws across all available states, occupation_law is often used to filter specific conditions first, preventing unintended changes to regions already meeting requirements.
  • [compliance](/wiki/trigger/compliance): Occupation law directly affects compliance growth; the two frequently appear together in limit blocks to ensure subsequent logic triggers only when both compliance and occupation law conditions are satisfied.
  • [has_active_resistance](/wiki/trigger/has_active_resistance): Resistance activity intensity is closely tied to occupation policy; combined use precisely describes compound conditions like "resistance remains active and current occupation law is too lenient."

Common Pitfalls

  1. Scope direction reversed: When writing GER = { occupation_law = ... } under a COUNTRY scope, if PREV is also GER (same country), it checks GER's default occupation law; if PREV is another country (such as POL), it checks PREV's specific occupation law toward GER—newcomers often overlook this distinction, causing conditions to never match or always evaluate true.
  2. Using on unoccupied STATEs: If a target state has no actual occupier (for example, the state is controlled by its owner nation), occupation_law cannot retrieve a valid occupation law value and the condition silently fails without error, making debugging very opaque. It is recommended to pair this with [controls_state](/wiki/trigger/controls_state) or similar checks to first confirm the state is actually under occupation.