Wiki

trigger · occupied_country_tag

Definition

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

Description

compares occupied country that creates resistance to a tag. Example: occupied_country_tag = ITA

实战 · 配合 · 坑

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

实战用法

occupied_country_tag 常用于占领法或抵抗系统相关 mod 中,针对特定被占领国家应用不同的合规/抵抗逻辑,例如对意大利占领区采用更严苛的镇压策略。典型场景是在 on_state_occupation 事件或 decision 的 available 块中,判断当前州的抵抗来源国来触发差异化效果。

# 在某个 decision 的 available 条件中
available = {
    FROM = {
        occupied_country_tag = ITA
        resistance > 25
    }
}

配合关系

  • [resistance](/wiki/trigger/resistance):通常与 occupied_country_tag 联用,先确认抵抗来源国再判断抵抗强度,避免对错误国家误触发效果。
  • [occupation_law](/wiki/trigger/occupation_law):配合使用可以在确认占领国身份后,进一步检查当前占领法是否符合条件,形成双重过滤。
  • [set_occupation_law](/wiki/effect/set_occupation_law):在 trigger 确认目标占领国后,用此 effect 对特定来源国的州动态切换占领法。
  • [has_active_resistance](/wiki/trigger/has_active_resistance):与 occupied_country_tag 搭配,确保只在真正存在活跃抵抗时才执行后续逻辑,防止空判断浪费性能。

常见坑

  1. scope 混淆occupied_country_tag 只能在 STATE scope 下使用,新手常将其写在 COUNTRY scope 的 trigger 块中导致脚本报错或静默失效,需确保外层已通过 any_state/every_state 等进入州 scope。
  2. 与 CONTROLLER/OWNER 概念混淆:该 trigger 比对的是"产生抵抗的被占领国"(即原主权国),而非当前的控制者或拥有者,误用于判断控制国身份会得到完全相反的逻辑结果。

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

occupied_country_tag is commonly used in occupation law or resistance system-related mods to apply different compliance/resistance logic to specific occupied countries. For example, you might enforce stricter suppression policies for Italian-occupied territories. A typical scenario involves using this trigger in an on_state_occupation event or within the available block of a decision to identify the source country of resistance in the current state and trigger differentiated effects.

# In the available condition of a decision
available = {
    FROM = {
        occupied_country_tag = ITA
        resistance > 25
    }
}

Synergy

  • [resistance](/wiki/trigger/resistance): Typically used alongside occupied_country_tag to first confirm the resistance source country before checking resistance strength, preventing unintended effects from triggering on the wrong nation.
  • [occupation_law](/wiki/trigger/occupation_law): Using this together allows you to verify the occupier's identity first, then further check if the current occupation law meets your conditions, creating a dual-filter approach.
  • [set_occupation_law](/wiki/effect/set_occupation_law): After using occupied_country_tag in a trigger to confirm the target occupied country, apply this effect to dynamically switch occupation laws for states from that specific source.
  • [has_active_resistance](/wiki/trigger/has_active_resistance): Pair this with occupied_country_tag to ensure logic executes only when active resistance truly exists, preventing wasted performance on null checks.

Common Pitfalls

  1. Scope confusion: occupied_country_tag can only be used under STATE scope. Beginners often mistakenly place it in trigger blocks under COUNTRY scope, causing script errors or silent failures. Always ensure you've entered state scope via any_state/every_state or similar constructs.
  2. Confusion with CONTROLLER/OWNER concepts: This trigger compares against the "occupied country generating resistance" (i.e., the original sovereign), not the current controller or owner. Misusing it to check the controlling nation's identity will produce completely inverted logic results.