Wiki

effect · add_core_of

Definition

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

Description

Add state as core of country

实战 · 配合 · 坑

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

实战用法

add_core_of 常用于领土扩张类 mod 中,当一个国家通过事件、决议或战后和平谈判获得某个州时,同步赋予该国对此州的核心,以消除因非核心领土带来的整合惩罚。例如在"大波兰计划"类 mod 的决策完成事件中,将历史声索州批量设为核心:

# 在 STATE scope 内执行
123 = {  # 进入目标州 scope
    add_core_of = GER  # 将该州设为德国的核心
}

也可配合 set_state_owner_to 一并使用,在同一事件中完成领土转移与核心赋予。

配合关系

  • [set_state_owner_to](/wiki/effect/set_state_owner_to):转移州的归属权时,通常同步调用 add_core_of,避免新领土长期处于非核心状态产生整合惩罚。
  • [remove_core_of](/wiki/effect/remove_core_of):在领土交换剧本中,往往一边用 remove_core_of 撤销旧主权国的核心,一边用 add_core_of 赋予新国家核心,保持逻辑一致。
  • [is_core_of](/wiki/trigger/is_core_of):用于在 limittrigger 块中验证核心是否已存在,防止重复触发或作为后续事件的前置条件。
  • [is_claimed_by](/wiki/trigger/is_claimed_by):常与 add_core_of 搭配检查,若已有声索再升级为核心,可以设计声索→核心的多阶段剧情链。

常见坑

  1. Scope 写错层级add_core_of 必须在 STATE scope 下调用,新手经常在 COUNTRY scope 直接写 add_core_of = GER 而不先进入州 scope,导致脚本报错或静默失效;正确做法是先用州 ID 或 every_neighbor_state 等方式进入对应 STATE scope 再执行。
  2. TARGET 填国家标签而非变量add_core_of 的目标是国家(如 GERTHISROOT),不能填州 ID 或省份 ID;若想动态指向当前事件触发国,应使用 ROOTFROM 等关键字,硬编码错误标签会导致核心无法正确添加且不产生任何报错提示。

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

add_core_of is commonly used in territorial expansion mods. When a country acquires a state through events, decisions, or post-war peace settlements, you typically grant that country a core on the state simultaneously to eliminate integration penalties from non-core territory. For example, in the completion event of a "Greater Poland Plan" style mod decision, you can batch-set historical claim states as cores:

# Execute within STATE scope
123 = {  # Enter target state scope
    add_core_of = GER  # Set this state as a German core
}

You can also use it together with [set_state_owner_to](/wiki/effect/set_state_owner_to) to complete territory transfer and core assignment in a single event.

Synergy

  • [set_state_owner_to](/wiki/effect/set_state_owner_to): When transferring state ownership, it's standard practice to call add_core_of simultaneously to prevent the new territory from remaining non-core for extended periods and triggering integration penalties.
  • [remove_core_of](/wiki/effect/remove_core_of): In territory exchange scenarios, you typically use remove_core_of to revoke the old sovereign's core while using add_core_of to grant the new country a core, maintaining logical consistency.
  • [is_core_of](/wiki/trigger/is_core_of): Used within limit or trigger blocks to verify whether a core already exists, preventing duplicate triggers or serving as a prerequisite for subsequent events.
  • [is_claimed_by](/wiki/trigger/is_claimed_by): Frequently paired with add_core_of to check claims. If a state is already claimed, you can upgrade it to a core, allowing you to design multi-stage story chains progressing from claim to core.

Common Pitfalls

  1. Incorrect scope hierarchy: add_core_of must be called within a STATE scope. Beginners often write add_core_of = GER directly in COUNTRY scope without first entering the state scope, resulting in script errors or silent failures. The correct approach is to first enter the corresponding STATE scope using a state ID or methods like every_neighbor_state, then execute the command.
  2. Providing a country tag instead of a variable as TARGET: The target of add_core_of must be a country (such as GER, THIS, or ROOT), not a state ID or province ID. If you need to dynamically reference the current event trigger country, use keywords like ROOT or FROM. Hardcoding an incorrect tag will fail to add the core and produce no error message whatsoever.