Wiki

effect · set_country_leader_name

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

changes the name of country leader. no tooltip is generated
set_country_leader_name = {
  ideology = neutrality # can be ommitted. if so it will change the name of current ruler
  name = "James Boned"
}

实战 · 配合 · 坑

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

实战用法

set_country_leader_name 常用于事件或决议触发后动态修改领导人姓名的场景,例如某国领导人经历特定事件后改用化名、恢复真名,或在内战结束后更新执政者的显示名称。以下示例展示在一个国家事件中将当前执政者改名:

country_event = {
    id = my_mod.1
    title = my_mod.1.t
    desc = my_mod.1.d

    option = {
        name = my_mod.1.a
        set_country_leader_name = {
            ideology = neutrality
            name = "Johann von Neumann"
        }
    }
}

配合关系

  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait):在改名的同时为该领导人添加新特质,两者配合可完整塑造一次"人物转变"事件。
  • [create_country_leader](/wiki/effect/create_country_leader):当需要完全替换领导人时先创建新领导人,set_country_leader_name 则用于只改名而保留原有特质与意识形态的轻量场景,二者形成互补选择。
  • [has_country_leader](/wiki/trigger/has_country_leader):在执行改名前用该触发器检测目标领导人是否存在,避免对不存在的领导人执行改名而静默失败。
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology):配合意识形态条件判断,确保只在正确的执政党/意识形态领导人在位时才触发改名逻辑。

常见坑

  1. 省略 ideology 字段时的误解:省略 ideology 时效果作用于"当前执政者",而非所有领导人。如果目标领袖并非当前执政党,必须显式填写 ideology,否则改名会错误地作用在当前领袖身上,且不会有任何报错提示。
  2. 不产生 tooltip 却期望玩家可见:该 effect 不生成任何界面提示(no tooltip),若希望玩家感知到改名发生,需要在同一 option/event 中额外添加文字描述或自定义 effect tooltip,否则改名对玩家来说是完全无声的。

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_country_leader_name is commonly used in scenarios where a leader's name needs to be dynamically modified following an event or decision trigger, such as when a leader adopts an alias after a specific event, restores their true name, or when the displayed name of the ruling figure is updated after a civil war concludes. The following example demonstrates renaming the current ruling leader within a country event:

country_event = {
    id = my_mod.1
    title = my_mod.1.t
    desc = my_mod.1.d

    option = {
        name = my_mod.1.a
        set_country_leader_name = {
            ideology = neutrality
            name = "Johann von Neumann"
        }
    }
}

Synergy

  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait): Adding new traits to the leader while renaming them allows both effects to work together and completely craft a "character transformation" event.
  • [create_country_leader](/wiki/effect/create_country_leader): When a complete leader replacement is needed, first create a new leader; set_country_leader_name is better suited for lightweight scenarios where you only want to rename while preserving existing traits and ideology, forming a complementary choice between the two.
  • [has_country_leader](/wiki/trigger/has_country_leader): Use this trigger to verify the target leader exists before executing the rename, preventing silent failures from attempting to rename non-existent leaders.
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology): Combine with ideology conditions to ensure the rename logic only triggers when the correct ruling party/ideology leader is in office.

Common Pitfalls

  1. Misunderstanding when the ideology field is omitted: When ideology is omitted, the effect applies to the "current ruling leader" only, not all leaders. If the target leader is not from the current ruling party, you must explicitly specify ideology, otherwise the rename will incorrectly apply to the current leader and produce no error message.
  2. Expecting player visibility without generating tooltips: This effect generates no UI tooltip (no tooltip), and if you want players to perceive the name change, you must add additional text descriptions or custom effect tooltips within the same option/event, otherwise the rename will be completely silent to the player.