Wiki

effect · strategic_state_location

Definition

  • Supported scope:STATE
  • Supported target:none

Description

Add strategic locations to a state in scope
The available strategic locations is defined in strategic_locations.
Ex:
10 = {
  strategic_state_location = {
    my_strategic_area = [province_id]
    my_other_area = [province_id]
  }
}

实战 · 配合 · 坑

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

实战用法

strategic_state_location 常用于 mod 中动态创建或扩展战略区域,例如在新增自定义地区划分、调整战役地图逻辑时,将特定省份归入某个战略地点分类。典型场景是在游戏开始事件或决议执行后,将新占领的省份动态指定到自定义战略区域,从而影响 AI 的战略规划与资源调度。

# 在某个国家事件的 immediate 块中触发,作用于目标州
12 = {  # STATE scope
    strategic_state_location = {
        my_custom_area = 1234  # 将省份 1234 添加为该战略区域的锚点
    }
}

配合关系

  • [set_state_category](/wiki/effect/set_state_category):修改州的行政等级后配合本命令重新划定战略位置,两者共同完成对州的全面重新定义。
  • [add_building_construction](/wiki/effect/add_building_construction):确定战略锚点后,在该位置安排基础设施建设,使战略意义与生产能力同步落地。
  • [has_state_flag](/wiki/trigger/has_state_flag):执行前用此触发器检查州是否已被标记,避免重复添加同一战略位置导致逻辑混乱。
  • [set_state_flag](/wiki/effect/set_state_flag):执行本命令后立即打上标记,防止后续事件或决议二次触发时重复写入。

常见坑

  1. 省份 ID 必须实际属于该州:如果填写的 province_id 不归属于当前 scope 的州,游戏会静默忽略或报错,新手常因复制其他州的脚本而未替换省份 ID 导致效果失效。
  2. 战略区域键名须在 strategic_locations 中预先声明my_strategic_area 这类键名不是任意字符串,必须先在对应的 strategic_locations 定义文件中注册,否则加载时会报未定义错误,mod 效果完全不生效。

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

strategic_state_location is commonly used in mods to dynamically create or extend strategic regions, such as when adding custom territorial divisions or adjusting campaign map logic by assigning specific provinces to a strategic location category. The typical scenario involves triggering this during game start events or after decision execution, dynamically assigning newly occupied provinces to custom strategic regions, thereby influencing AI strategic planning and resource allocation.

# Triggered in the immediate block of a country event, targeting the specified state
12 = {  # STATE scope
    strategic_state_location = {
        my_custom_area = 1234  # Add province 1234 as the anchor point for this strategic region
    }
}

Synergy

  • [set_state_category](/wiki/effect/set_state_category): After modifying the state's administrative tier with this command, use it in conjunction with this effect to redefine strategic location; both commands work together to completely redefine the state.
  • [add_building_construction](/wiki/effect/add_building_construction): After determining the strategic anchor point, schedule infrastructure construction at that location using this effect to align strategic significance with production capacity.
  • [has_state_flag](/wiki/trigger/has_state_flag): Use this trigger before execution to check whether the state has already been flagged, avoiding logic confusion from adding the same strategic location multiple times.
  • [set_state_flag](/wiki/effect/set_state_flag): Immediately flag the state after executing this command to prevent subsequent events or decisions from triggering duplicate writes.

Common Pitfalls

  1. Province ID must actually belong to the state: If the province_id specified does not belong to the state in the current scope, the game will silently ignore it or produce an error. Beginners often copy scripts from other states without replacing the province ID, resulting in the effect failing to apply.
  2. Strategic region key name must be pre-declared in strategic_locations: Keys like my_strategic_area are not arbitrary strings and must first be registered in the corresponding strategic_locations definition file, otherwise the mod will report an undefined error at load time and the effect will not work at all.