命令百科

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 会自动为真,实际上必须显式添加才有效。