Wiki

trigger · controls_province

Definition

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

Description

check controller for province

实战 · 配合 · 坑

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

实战用法

controls_province 常用于判断某国是否实际控制某个战略省份,从而触发特殊决议、任务或事件——例如在战役 mod 中判断某方是否控制了关键港口或要塞省份后才解锁奖励。注意它检查的是控制权(controller),而非所有权,因此适合用在战争进程追踪或占领触发场景。

# 示例:仅当本国控制某关键省份时,决议才可用
available = {
    controls_province = 1234  # 1234 为目标省份 ID
}

配合关系

  • [controls_state](/wiki/trigger/controls_state)controls_province 精确到省份级别,而 controls_state 检查整个州,两者常组合使用以分层判断占领程度——先用州级过滤大范围,再用省份级核实关键地块。
  • [any_controlled_state](/wiki/trigger/any_controlled_state):在需要遍历当前控制州并进一步检查其内特定省份时,常作为外层循环容器与 controls_province 嵌套使用。
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision):确认控制省份后立即激活针对特定目标的决议,形成「条件满足→解锁行动」的完整链路。
  • [has_country_flag](/wiki/trigger/has_country_flag):通常搭配国家旗帜一起使用,避免同一省份控制事件反复触发,先检查旗帜再检查省份控制状态。

常见坑

  1. 混淆省份 ID 与州 ID:新手常把州(state)的数字 ID 填入 controls_province,导致条件永远不成立。省份 ID 需在地图编辑器或 map/definition.csv 中查找,与州 ID 是完全不同的数值体系。
  2. 忽略"控制"与"所有权"的区别controls_province 检查的是当前控制方,战争期间被敌军占领后原主权国并不满足该条件,若场景逻辑需要判断"谁拥有该省份"则应改用所有权相关判断,否则会在占领状态下产生意外的条件失效。

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

controls_province is commonly used to check whether a nation actually controls a specific strategic province, triggering special decisions, tasks, or events—for example, in campaign mods to unlock rewards only after one side controls a key port or fortress province. Note that it checks control (controller), not ownership, making it ideal for war progression tracking or occupation trigger scenarios.

# Example: A decision is only available when the player nation controls a specific key province
available = {
    controls_province = 1234  # 1234 is the target province ID
}

Synergy

  • [controls_state](/wiki/trigger/controls_state): controls_province operates at the province level, while controls_state checks an entire state. These are often combined for layered occupation assessment—use state-level filtering for broad scope, then province-level verification for critical locations.
  • [any_controlled_state](/wiki/trigger/any_controlled_state): When iterating over currently controlled states to further check specific provinces within them, commonly used as an outer loop container nested with controls_province.
  • [activate_targeted_decision](/wiki/effect/activate_targeted_decision): After confirming province control, immediately activate a decision targeting that specific objective, forming a complete chain of "condition met → action unlocked".
  • [has_country_flag](/wiki/trigger/has_country_flag): Typically paired with country flags to prevent control events from repeatedly triggering on the same province. Check the flag first before checking province control status.

Common Pitfalls

  1. Confusing province ID with state ID: Beginners often input a state's numerical ID into controls_province, causing the condition to never be met. Province IDs must be looked up in the map editor or map/definition.csv—they follow a completely different numbering system than state IDs.
  2. Overlooking the distinction between "control" and "ownership": controls_province checks the current controller. During war, if an enemy occupies a province, the original owner no longer satisfies this condition. If your scenario logic requires checking "who owns the province," use ownership-related checks instead; otherwise the condition will unexpectedly fail during occupation.