Wiki

trigger · region

Definition

  • Supported scope:STATE
  • Supported target:none

Description

check state's strategic area id

实战 · 配合 · 坑

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

实战用法

region 常用于判断某个州是否属于特定战略地区,从而在事件、决策或 focus 中限定效果只对特定大区生效,例如仅在东欧战略区触发占领政策变化或建筑建造。典型场景是配合占领系统,对某一大陆板块的多个州批量施加同一逻辑。

# 在决策的 available 块中,限制只对属于战略地区 38(如波兰地区)的州开放
available = {
    FROM = {
        region = 38
    }
}

配合关系

  • [is_controlled_by](/wiki/trigger/is_controlled_by):通常先确认州属于目标战略区,再进一步判断该州是否被特定国家控制,两者结合缩小作用范围。
  • [has_state_category](/wiki/trigger/has_state_category):在同一战略区内区分城市级别(如核心省份 vs 乡村),避免对所有州一视同仁地触发效果。
  • [set_occupation_law](/wiki/effect/set_occupation_law):确认州处于某战略区后,批量为该区州设置占领法,是大区占领管理脚本的标准搭配。
  • [any_neighbor_state](/wiki/trigger/any_neighbor_state):遍历相邻州时用 region 过滤,确保邻州也在同一战略区范围内再执行后续逻辑。

常见坑

  1. 混淆 regionarearegion 对应游戏地图编辑器中更大范围的"战略地区"(strategic region),area 对应更小的"地区"(state area)。两者 ID 体系完全独立,填错 ID 会导致条件永远为假却不报错,难以排查。
  2. 直接在 COUNTRY scope 下使用region 只在 STATE scope 下有效,若在国家或角色 scope 中调用而不先通过 any_state/every_state 等切换 scope,脚本会静默失效,新手常误以为是 ID 填写错误。

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

region is commonly used to check whether a state belongs to a specific strategic region, allowing effects in events, decisions, or focuses to apply only to particular geographic areas—for example, triggering occupation policy changes or construction only in Eastern European strategic regions. A typical use case involves the occupation system, where the same logic is applied in bulk to multiple states across a continental bloc.

# In a decision's available block, restrict the decision to only states belonging to strategic region 38 (e.g., the Polish region)
available = {
    FROM = {
        region = 38
    }
}

Synergy

  • [is_controlled_by](/wiki/trigger/is_controlled_by): First confirm a state belongs to the target strategic region, then further check whether that state is controlled by a specific nation. Combined, these two narrow the scope of application.
  • [has_state_category](/wiki/trigger/has_state_category): Within the same strategic region, differentiate urban tiers (e.g., core provinces vs. rural areas) to avoid triggering effects uniformly on all states.
  • [set_occupation_law](/wiki/effect/set_occupation_law): After confirming states exist within a strategic region, bulk-apply occupation laws to states in that region. This is the standard pairing for large-scale occupation management scripts.
  • [any_neighbor_state](/wiki/trigger/any_neighbor_state): When iterating through adjacent states, use region to filter and ensure neighboring states remain within the same strategic region before executing subsequent logic.

Common Pitfalls

  1. Confusing region with area: region corresponds to the larger "strategic region" in the game's map editor, while area corresponds to the smaller "state area". These two ID systems are completely independent. Using the wrong ID causes conditions to silently fail without error messages, making debugging difficult.
  2. Using directly under COUNTRY scope: region is only valid within STATE scope. If called within a nation or character scope without first switching scope via any_state/every_state or similar constructs, the script fails silently. Newcomers often mistakenly assume the ID was entered incorrectly.