Wiki

trigger · has_occupation_modifier

Definition

  • Supported scope:STATE
  • Supported target:any

Description

compares occupied country that creates resistance to a tag. Example: has_occupation_modifier = modifier_name

实战 · 配合 · 坑

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

实战用法

has_occupation_modifier 常用于占领系统相关的 mod 中,例如根据某个占领修正的存在来决定是否触发特定事件、激活决策或限制某些操作。典型场景是:当占领国对该州施加了特定修正时,才允许执行抵抗相关的决策链或解锁额外的合规度奖励。

# 仅当该州存在特定占领修正时,才允许触发抵抗事件
state_event = {
    id = resistance_flavor.1
    trigger = {
        has_occupation_modifier = brutal_occupation_modifier
    }
}

配合关系

  • [has_active_resistance](/wiki/trigger/has_active_resistance):常与 has_occupation_modifier 联用,在确认某占领修正存在的同时,进一步判断该州是否有活跃抵抗,双重条件收窄触发范围。
  • [compliance](/wiki/trigger/compliance):占领修正往往影响合规度阈值判断,两者配合可实现"只有在特定修正且合规度低于某值时才触发"的精细逻辑。
  • [add_state_modifier](/wiki/effect/add_state_modifier):在 trigger 条件满足后,通过 effect 块叠加新的州修正,实现占领修正链式升级的设计。
  • [occupation_law](/wiki/trigger/occupation_law):占领法令与占领修正经常共同定义一个占领政策的完整状态,两者搭配可精确描述当前占领环境。

常见坑

  1. 修正名拼写错误导致永假has_occupation_modifier 的值必须与 occupation_modifier 定义文件中的修正名完全一致(区分大小写),写错名字不会报错,只会让条件永远返回 false,极难排查。
  2. 在非 STATE scope 中使用:此 trigger 只在 STATE scope 下有效,若误写在 COUNTRY 或 CHARACTER scope 的 trigger 块里,游戏通常会静默忽略或报 scope 错误,新手容易因 scope 嵌套混乱而将其放错位置。

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

has_occupation_modifier is commonly used in mods related to the occupation system, such as deciding whether to trigger specific events, activate decisions, or restrict certain actions based on the existence of a particular occupation modifier. Typical scenarios include: allowing resistance-related decision chains to execute or unlocking additional compliance bonuses only when the occupying country has applied a specific modifier to the state.

# Only trigger resistance events when the state has a specific occupation modifier
state_event = {
    id = resistance_flavor.1
    trigger = {
        has_occupation_modifier = brutal_occupation_modifier
    }
}

Synergy

  • [has_active_resistance](/wiki/trigger/has_active_resistance): Frequently used together with has_occupation_modifier to confirm the presence of an occupation modifier while further checking whether the state has active resistance, narrowing the trigger scope with dual conditions.
  • [compliance](/wiki/trigger/compliance): Occupation modifiers often affect compliance threshold evaluations; combining them enables fine-grained logic such as "only trigger when a specific modifier is present and compliance is below a certain value."
  • [add_state_modifier](/wiki/effect/add_state_modifier): After trigger conditions are met, use effect blocks to stack new state modifiers, enabling cascading upgrade designs for occupation modifier chains.
  • [occupation_law](/wiki/trigger/occupation_law): Occupation laws and occupation modifiers frequently work together to define the complete state of an occupation policy; pairing them allows precise descriptions of the current occupation environment.

Common Pitfalls

  1. Modifier name typos causing permanent falsehood: The value of has_occupation_modifier must exactly match the modifier name in the occupation_modifier definition file (case-sensitive). Misspelling the name will not produce an error but will cause the condition to always return false, making it extremely difficult to debug.
  2. Using in non-STATE scopes: This trigger only works in STATE scope. If mistakenly placed in trigger blocks within COUNTRY or CHARACTER scopes, the game typically silently ignores it or reports a scope error. Beginners often accidentally place it in the wrong location due to scope nesting confusion.