Wiki

effect · set_nationality

Definition

  • Supported scope:COUNTRY, CHARACTER
  • Supported target:none

Description

Transfer from one country to another for the character in scope.
Note that this is not related to operative nationalities added via add_nationality.
Note that for operative, this will temporarily lock their slot on the country of origin.

Examples:
SOV = { # origin country
	my_character = {
	set_nationality = POL # target country
}
SOV = { # origin country
	set_nationality = {
		target_country = POL
		character = my_character
	}
}

实战 · 配合 · 坑

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

实战用法

set_nationality 常用于叛逃、流亡政府或角色转移等剧情 mod 中,将某个角色(顾问、将领、情报人员等)从原国家移交给另一国。例如在二战流亡政府 mod 里,法国投降后将戴高乐转移至自由法国:

FRA = {
    degaulle_character = {
        set_nationality = FFL
    }
}

配合关系

  • [add_country_leader_role](/wiki/effect/add_country_leader_role):角色转籍后,需要在新国家重新授予领导人职位,否则角色虽已归属新国但不会出现在任何岗位上。
  • [remove_advisor_role](/wiki/effect/remove_advisor_role):在调用 set_nationality 前先移除原国的顾问职位,防止原国残留一个"幽灵"顾问槽位。
  • [add_corps_commander_role](/wiki/effect/add_corps_commander_role):情报人员或顾问转籍后若要作为将领使用,需在新 scope 内重新添加指挥官角色。
  • [has_character](/wiki/trigger/has_character):执行转籍前用于确认目标角色确实存在于来源国,避免因角色缺失导致脚本报错或静默失效。

常见坑

  1. Scope 写错set_nationality 必须在角色自身的 scope 下调用(即先进入角色 scope,再写指令),而非直接写在国家 scope 下——漏掉角色 scope 层是最常见的语法错误。
  2. add_nationality 混淆add_nationality 仅为情报人员添加可用国籍伪装,不会真正改变角色所属国;set_nationality 才是真正的"转籍",两者目的完全不同,切勿互换使用。

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

set_nationality is commonly used in narrative mods involving defections, exile governments, or character transfers, moving a character (advisor, general, intelligence officer, etc.) from one country to another. For example, in a WWII exile government mod, after France's surrender, de Gaulle can be transferred to Free France:

FRA = {
    degaulle_character = {
        set_nationality = FFL
    }
}

Synergy

  • [add_country_leader_role](/wiki/effect/add_country_leader_role): After a character changes nationality, you must reassign a leader role in the new country; otherwise the character belongs to the new nation but will not appear in any position.
  • [remove_advisor_role](/wiki/effect/remove_advisor_role): Remove the advisor role from the original country before calling set_nationality to prevent leaving behind a "ghost" advisor slot in the source nation.
  • [add_corps_commander_role](/wiki/effect/add_corps_commander_role): If an intelligence officer or advisor is to serve as a general after transferring, you must re-add the commander role within the new scope.
  • [has_character](/wiki/trigger/has_character): Verify the target character actually exists in the source country before executing the transfer, preventing script errors or silent failures due to missing characters.

Common Pitfalls

  1. Incorrect Scope: set_nationality must be called within the character's own scope (i.e., enter the character scope first, then write the command), not directly under a country scope—omitting the character scope layer is the most common syntax error.
  2. Confusion with add_nationality: add_nationality only adds available nationality disguises for intelligence officers and does not actually change the character's home country; set_nationality is the true "change of nationality" effect. These serve completely different purposes and should never be used interchangeably.