Wiki

effect · remove_exile_tag

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

remove exile tag from scope unit leader. remove_exile_tag = yes

实战 · 配合 · 坑

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

实战用法

当角色原本因流亡状态被打上 exile tag 后,若玩家通过事件或决议让该角色"回归本国"或"洗清流亡身份",可用此 effect 将其流亡标记移除,使其恢复为正常的部队指挥官。例如在流亡政府相关 mod 中,某国复辟后需要清除旧流亡将领的标记:

# 在某个复辟事件的 option 块中
character:GER_some_exiled_general = {
    remove_exile_tag = yes
}

配合关系

  • [is_exiled_leader](/wiki/trigger/is_exiled_leader):在执行移除前先用此触发器判断角色当前确实处于流亡状态,避免对非流亡角色做无效操作。
  • [is_exiled_leader_from](/wiki/trigger/is_exiled_leader_from):进一步确认该角色是从哪个国家流亡而来,确保逻辑正确后再执行移除。
  • [set_nationality](/wiki/effect/set_nationality):移除流亡标记后,通常需要同步修改角色国籍,使其正式归属于目标国家。
  • [add_unit_leader_trait](/wiki/effect/add_unit_leader_trait):流亡身份解除后,可为角色添加新 trait(如"归国将领"类自定义特质),在叙事和功能上体现其身份转变。

常见坑

  1. 作用域错误:此 effect 必须位于 CHARACTER scope 下才能生效,直接写在国家 scope(如 GER = { remove_exile_tag = yes })会导致脚本报错或静默失效,需要用 character:TAG_leader_name = { ... }every_unit_leader 等方式正确进入角色 scope。
  2. 未检查流亡状态就执行:对一个本来就不是流亡状态的角色执行此命令虽然通常不会崩溃,但容易掩盖逻辑错误;建议始终配合 [is_exiled_leader](/wiki/trigger/is_exiled_leader) 做前置判断,保持脚本逻辑清晰可维护。

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

When a character has been tagged with the exile tag due to their exile status, if the player uses an event or decision to make the character "return to their homeland" or "clear their exile status," you can use this effect to remove their exile tag and restore them to a normal military commander. For example, in mods related to exile governments, after a country undergoes restoration, you may need to clear the exile tags of old exiled generals:

# In an option block of a certain restoration event
character:GER_some_exiled_general = {
    remove_exile_tag = yes
}

Synergy

  • [is_exiled_leader](/wiki/trigger/is_exiled_leader): Use this trigger to verify that the character is actually in an exiled state before executing the removal, avoiding ineffective operations on non-exiled characters.
  • [is_exiled_leader_from](/wiki/trigger/is_exiled_leader_from): Further confirm which country the character was exiled from, ensuring the logic is correct before executing the removal.
  • [set_nationality](/wiki/effect/set_nationality): After removing the exile tag, you typically need to synchronize the character's nationality change to formally assign them to the target country.
  • [add_unit_leader_trait](/wiki/effect/add_unit_leader_trait): After clearing the exile status, you can add new traits to the character (such as custom traits like "Returned General"), reflecting their identity change both narratively and functionally.

Common Pitfalls

  1. Scope errors: This effect must be executed within the CHARACTER scope to take effect. Writing it directly in a country scope (such as GER = { remove_exile_tag = yes }) will cause script errors or silent failures. You need to properly enter the character scope using methods like character:TAG_leader_name = { ... } or every_unit_leader.
  2. Executing without checking exile status: Running this command on a character that is not actually in an exiled state typically won't cause a crash, but it can easily mask logical errors. It is recommended to always pair this with a prior check using [is_exiled_leader](/wiki/trigger/is_exiled_leader) to keep script logic clear and maintainable.