Wiki

trigger · has_contested_owner

Definition

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

Description

Checks if a state has the specified country as a contested owner.
The trigger can be used either from a country or a state scope and accepts the other as parameter.
The trigger is localized with a localization environment containing `Country` and `State`.

### Example
The following example has the same end result and localization.

42 = { has_contested_owner = GER } GER = { has_contested_owner = 42 }

Standard scope accessors can also be used:

Assuming current scope is a state and FROM is a country scope

has_contested_owner = FROM

实战 · 配合 · 坑

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

实战用法

has_contested_owner 常用于领土争议或占领系统相关的 mod,例如判断某国是否对特定州拥有争议所有权,从而触发外交事件或解锁特定决策。它的双向写法(从国家 scope 查州、从州 scope 查国家)让条件判断在不同脚本结构中都能灵活嵌入。

# 在某个决策的 available 块中,检查 FROM(目标州)是否有本国作为争议所有者
available = {
    FROM = {
        has_contested_owner = ROOT
    }
}

配合关系

  • [add_contested_owner](/wiki/effect/add_contested_owner):添加争议所有权的效果命令,通常先用 add_contested_owner 建立争议关系,再用本 trigger 检查该关系是否存在,形成完整的建立→验证逻辑。
  • [remove_contested_owner](/wiki/effect/remove_contested_owner):与之对应的移除命令,常在 has_contested_owner = true 条件成立后才执行移除,避免对不存在的争议关系做无效操作。
  • [compliance](/wiki/trigger/compliance):争议所有权场景下,往往需要同时检查州的顺从度来判断是否可以推进实际控制,两者搭配构成更精细的条件。
  • [controls_state](/wiki/trigger/controls_state):争议所有权不等于实际控制,配合 controls_state 可以区分"名义争议"与"实际占领"两种状态,逻辑更严谨。

常见坑

  1. scope 类型混淆:trigger 要求两侧 scope 必须一个是州、一个是国家,若在国家 scope 下写 has_contested_owner = <另一个国家 TAG> 或在州 scope 下写 has_contested_owner = <另一个州 ID>,条件永远不会成立且不会报错,非常难以排查。
  2. 误以为等同于所有者或控制者:争议所有权(contested owner)是独立于 OWNER/CONTROLLER 的字段,仅通过 add_contested_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

has_contested_owner is commonly used in mods involving territorial disputes or occupation systems, such as determining whether a country has contested ownership of a specific state to trigger diplomatic events or unlock certain decisions. Its bidirectional syntax—querying states from country scope or countries from state scope—allows flexible condition embedding across different script structures.

# In the available block of a decision, check whether FROM (target state) has ROOT as a contested owner
available = {
    FROM = {
        has_contested_owner = ROOT
    }
}

Synergy

  • [add_contested_owner](/wiki/effect/add_contested_owner): The effect command for adding contested ownership; typically you first establish a contested relationship using add_contested_owner, then use this trigger to verify that relationship exists, forming a complete establish→verify logic chain.
  • [remove_contested_owner](/wiki/effect/remove_contested_owner): The corresponding removal command; commonly executed only after has_contested_owner = true condition is met, preventing invalid operations on non-existent contested relationships.
  • [compliance](/wiki/trigger/compliance): In contested ownership scenarios, you often need to simultaneously check a state's compliance to determine whether actual control can be advanced; these two work together to create more granular conditions.
  • [controls_state](/wiki/trigger/controls_state): Contested ownership does not equal actual control; pairing with controls_state lets you distinguish between "nominal dispute" and "actual occupation" states, making logic more rigorous.

Common Pitfalls

  1. Scope type confusion: The trigger requires one scope to be a state and the other to be a country on both sides. Writing has_contested_owner = <another country TAG> in country scope or has_contested_owner = <another state ID> in state scope will cause the condition to never be true without errors, making it extremely difficult to debug.
  2. Mistaking it for owner or controller: Contested ownership is an independent field separate from OWNER/CONTROLLER, and only takes effect through add_contested_owner; beginners often mistakenly assume this trigger becomes true once a country controls or owns a state, but in reality it requires explicit addition to be effective.