Wiki

effect · retire

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

Retires character, use in character scope

实战 · 配合 · 坑

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

实战用法

retire 用于在剧情事件或决议中强制让某个角色"退役/卸任",常见于历史事件触发时淘汰老将、或在政治清洗事件中移除某位顾问/将领。例如,当某个将领因伤病或政治原因离开舞台,可在事件的 option 块中调用:

character_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # 先切换到角色 scope,再执行退役
        GER_erich_von_manstein = {
            retire = yes
        }
    }
}

配合关系

  • [is_corps_commander](/wiki/trigger/is_corps_commander) / [is_field_marshal](/wiki/trigger/is_field_marshal):退役前先判断角色当前是否处于活跃指挥职位,避免对未激活角色触发无效逻辑。
  • [remove_unit_leader](/wiki/effect/remove_unit_leader):若需彻底从游戏中移除角色(而非仅退役),可在 retire 之后补充调用,确保角色不残留在领导人列表中。
  • [promote_character](/wiki/effect/promote_character):常与 retire 配对使用,在一位角色退役的同时提拔另一位角色,实现"新老交替"的叙事效果。
  • [set_character_flag](/wiki/effect/set_character_flag):在执行 retire 前打标记,防止同一角色被多个事件重复触发退役流程。

常见坑

  1. 忘记进入 CHARACTER scoperetire 必须在角色自身的 scope 内调用,若直接写在国家 scope(如 GER = { retire = yes })会报错或静默失效,需要用 角色TAG = { retire = yes }any_character = { limit = { ... } retire = yes } 的方式先切换到角色 scope。
  2. 对已死亡/已退役角色再次调用:若角色已经通过其他途径(如 remove_unit_leader)从游戏中移除,再对其执行 retire 不会报显式错误,但可能产生意料之外的 scope 解析警告,建议配合 [is_unit_leader](/wiki/trigger/is_unit_leader)[is_advisor](/wiki/trigger/is_advisor) 先做存在性检查。

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

retire is used to forcibly retire or remove a character from active duty, typically triggered during historical events to phase out veteran commanders, or in political purge scenarios to remove an advisor or general. When a character leaves the stage due to injury, illness, or political reasons, you can invoke it within an event's option block:

character_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # Switch to character scope first, then execute retire
        GER_erich_von_manstein = {
            retire = yes
        }
    }
}

Synergy

  • [is_corps_commander](/wiki/trigger/is_corps_commander) / [is_field_marshal](/wiki/trigger/is_field_marshal): Check if the character is currently in an active command position before retiring, to avoid triggering invalid logic on inactive characters.
  • [remove_unit_leader](/wiki/effect/remove_unit_leader): If you need to completely remove a character from the game (rather than just retiring them), call this after retire to ensure the character doesn't linger in the leader list.
  • [promote_character](/wiki/effect/promote_character): Often paired with retire to promote another character at the same time one character retires, creating a narrative effect of "succession of old and new".
  • [set_character_flag](/wiki/effect/set_character_flag): Flag the character before executing retire to prevent the same character from being triggered by multiple events to retire multiple times.

Common Pitfalls

  1. Forgetting to enter CHARACTER scope: retire must be called within the character's own scope. Writing it directly in country scope (e.g., GER = { retire = yes }) will error or silently fail. Use character_tag = { retire = yes } or any_character = { limit = { ... } retire = yes } to switch to character scope first.
  2. Calling retire again on already dead/retired characters: If a character has already been removed from the game through other means (such as remove_unit_leader), executing retire again on them won't produce an explicit error, but may generate unexpected scope resolution warnings. It's recommended to check existence first using [is_unit_leader](/wiki/trigger/is_unit_leader) or [is_advisor](/wiki/trigger/is_advisor).