Wiki

effect · add_claim_by

Definition

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

Description

Add state claim by country.

实战 · 配合 · 坑

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

实战用法

add_claim_by 常用于领土扩张类 mod 中,当某国通过事件、决议或焦点完成特定条件后,为其动态追加对某州的主张,以便后续产生外交压力或战争借口。例如在一个"复兴帝国"剧本中,当玩家完成某个国策时,对历史领土州批量添加宣称:

# 在 STATE scope 下执行,例如迭代特定州组
add_claim_by = ROOT

也可与 every_neighbor_state 配合批量处理相邻州,令某国一次性对所有邻接州声索主张,适合构建势力范围扩张的动态逻辑。

配合关系

  • [is_claimed_by](/wiki/trigger/is_claimed_by):在添加主张前先检测该州是否已被目标国宣称,避免重复触发后续逻辑或事件。
  • [remove_claim_by](/wiki/effect/remove_claim_by):配套的撤销命令,常用于和平结算或条约事件中移除先前添加的主张,形成完整的主张生命周期管理。
  • [add_core_of](/wiki/effect/add_core_of):主张往往是核心的前置步骤,二者搭配可模拟"先宣称、后吞并形成核心"的历史过程。
  • [is_core_of](/wiki/trigger/is_core_of):用于判断目标州是否已是核心,从而决定只添加主张而非重复追加核心,保持脚本逻辑的条件分支清晰。

常见坑

  1. scope 混淆add_claim_by 必须在 STATE scope 下执行,target 才是声索的国家标签或 scope 关键字。新手容易把它写在 COUNTRY scope 下,导致脚本解析错误或静默失效,应注意通过 every_state/state 等方式先切换到正确 scope。
  2. target 写成州而非国家:该 effect 的参数是声索方国家(如 GERROOT),而不是州 ID。将州 ID 填入 target 位置是常见误操作,正确做法是:在哪个州的 scope 下调用,就是对哪个州添加主张,参数只需指定是"哪个国家"来声索。

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_claim_by is commonly used in territorial expansion mods. When a nation fulfills specific conditions through events, decisions, or focuses, it dynamically adds claims to a state, enabling subsequent diplomatic pressure or war justifications. For example, in a "Renaissance Empire" scenario, when the player completes a certain national focus, claims are batch-added to historical territory states:

# Execute under STATE scope, e.g., iterating over specific state groups
add_claim_by = ROOT

It can also be paired with every_neighbor_state to batch-process adjacent states, allowing a nation to claim all neighboring states at once—ideal for constructing dynamic logic around sphere of influence expansion.

Synergy

  • [is_claimed_by](/wiki/trigger/is_claimed_by): Before adding a claim, first check whether the state is already claimed by the target nation to avoid redundant trigger logic or event firing.
  • [remove_claim_by](/wiki/effect/remove_claim_by): The complementary removal command, commonly used in peace settlement or treaty events to remove previously added claims, forming a complete claim lifecycle management system.
  • [add_core_of](/wiki/effect/add_core_of): Claims are often a prerequisite step to cores; combining both simulates the historical process of "claiming first, then annexing to form a core."
  • [is_core_of](/wiki/trigger/is_core_of): Determines whether a target state is already a core, allowing the logic to add only a claim rather than redundantly appending a core, keeping conditional branching clear.

Common Pitfalls

  1. Scope confusion: add_claim_by must be executed under STATE scope; the target parameter specifies the nation tag or scope keyword making the claim. Beginners often mistakenly place it under COUNTRY scope, causing parse errors or silent failures. Always switch to the correct scope first using every_state/state or similar constructs.
  2. Passing a state instead of a nation as target: The effect's parameter is the claiming nation (e.g., GER, ROOT), not a state ID. Filling in a state ID is a common mistake. The correct approach is: call the effect within the state's scope (that's which state gets claimed), and only specify the parameter as "which nation" is doing the claiming.