Wiki

effect · annex_country

Definition

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

Description

(no description in vanilla docs)

实战 · 配合 · 坑

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

实战用法

annex_country 常用于事件链或国策完成后强制吞并某国,例如实现历史性合并(如德奥合并、苏联吞并波罗的海三国)或 mod 中的特殊剧情结局。它会将目标国的领土、资源、部队等全部转移至执行方,是最彻底的外交/战争结果效果之一。

# 国策完成后吞并目标国
complete_national_focus = annex_austria
country_event = {
    id = ger.100
    immediate = {
        annex_country = {
            target = AUS
            transfer_troops = yes
        }
    }
}

配合关系

  • [has_capitulated](/wiki/trigger/has_capitulated):在目标国已经投降的前提下触发吞并,避免在战争仍在进行时就执行合并逻辑,符合现实流程。
  • [every_owned_state](/wiki/effect/every_owned_state):吞并后遍历新获得的州,批量添加核心或修改合规度,常与 annex_country 组合完成吞并后的领土整合。
  • [add_state_core](/wiki/effect/add_state_core):吞并后为新领土添加核心,防止出现"占领但无核心"导致的合规惩罚,是吞并流程的标配后续步骤。
  • [diplomatic_relation](/wiki/effect/diplomatic_relation):吞并前先解除相关外交关系(如保证、傀儡协议),避免因残留外交关系引发脚本逻辑冲突。

常见坑

  1. 未判断目标国是否存在:直接写 annex_country = { target = TAG } 而不先用 [exists](/wiki/trigger/exists) 检查,若目标国已被他人吞并则会报错或产生未定义行为,应在触发条件或 if 块中先确认 exists = TAG
  2. scope 指向错误annex_country 的执行主体必须是 COUNTRY scope,若写在 STATE scope 的效果块中会静默失败,新手常因嵌套 scope 层级混乱(如在 every_owned_state 内直接调用)而导致效果不生效,需先用 OWNER 或显式 country = 切回国家 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

annex_country is commonly used in event chains or upon national focus completion to forcibly annex a nation. Examples include implementing historical mergers (such as the Anschluss or the Soviet annexation of the Baltic states) or special story endings in mods. It transfers all territory, resources, and troops of the target nation to the executor, making it one of the most comprehensive diplomatic/war outcome effects available.

# Annex target nation upon focus completion
complete_national_focus = annex_austria
country_event = {
    id = ger.100
    immediate = {
        annex_country = {
            target = AUS
            transfer_troops = yes
        }
    }
}

Synergy

  • [has_capitulated](/wiki/trigger/has_capitulated): Trigger annexation only after the target nation has capitulated, preventing merger logic from executing while the war is still ongoing and following realistic progression.
  • [every_owned_state](/wiki/effect/every_owned_state): After annexation, iterate through newly acquired states to batch-add cores or modify compliance; commonly paired with annex_country to complete territorial integration post-annexation.
  • [add_state_core](/wiki/effect/add_state_core): Add cores to newly acquired territory after annexation to prevent compliance penalties from "occupied but non-core" states; this is a standard follow-up step in the annexation workflow.
  • [diplomatic_relation](/wiki/effect/diplomatic_relation): Resolve related diplomatic relations (such as guarantees or puppet agreements) before annexation to avoid script logic conflicts caused by lingering diplomatic ties.

Common Pitfalls

  1. Failure to check if target nation exists: Writing annex_country = { target = TAG } directly without first verifying with [exists](/wiki/trigger/exists) will cause errors or undefined behavior if the target has already been annexed by another nation. Always confirm exists = TAG in trigger conditions or within an if block beforehand.
  2. Incorrect scope assignment: The executor of annex_country must be in COUNTRY scope; placing it in a STATE scope effect block will silently fail. Beginners often encounter this due to confused nested scope hierarchies (such as calling it directly within every_owned_state), requiring explicit scope switching back to country level using OWNER or an explicit country = statement.