Wiki

effect · set_country_leader_description

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

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

实战 · 配合 · 坑

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

实战用法

set_country_leader_description 常用于 mod 中根据剧情分支动态更改领导人的传记文本,例如当某国完成特定国策或触发关键事件后,领导人的自我介绍随之更新,以反映其新的政治立场或历史地位。此外在多意识形态领袖共存的场景中(如同一人物同时持有民主与法西斯意识形态职位),可以为每条意识形态路线单独维护一份描述文本。

# 某国完成国策后,更新当前执政领袖的传记描述
complete_national_focus = SOV_great_purge
hidden_effect = {
    set_country_leader_description = {
        ideology = stalinism
        desc = "SOV_STALIN_POST_PURGE_DESC"
    }
}

配合关系

  • [create_country_leader](/wiki/effect/create_country_leader):创建新领袖时会附带初始描述,之后用 set_country_leader_description 进行动态覆盖,两者构成"创建→更新"的完整领袖管理流程。
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait):为领袖添加特质往往伴随着人物背景的转变,此时同步更新描述文本可保持 UI 叙事一致性。
  • [has_country_leader](/wiki/trigger/has_country_leader):在修改描述前先用此触发器确认目标意识形态的领袖确实存在,避免对空槽位执行指令。
  • [set_country_leader_description](/wiki/effect/set_country_leader_description)(多次调用):在同一事件的不同 option 中分别调用,可实现"玩家选择影响领袖自述"的分支叙事效果。

常见坑

  1. 忽略本地化键必须存在desc 字段填写的是本地化文件中的键名而非直接文本,若对应语言的 .yml 文件里没有该键,游戏会显示原始键名字符串而非预期描述,新手常误以为 effect 本身失效。
  2. 省略 ideology 时的作用对象误解:省略 ideology 字段并非对所有领袖生效,而是仅修改当前执政领袖(即当前国家意识形态路线的领袖)的描述;若想修改某条非执政意识形态下领袖的描述,必须明确填写 ideology,否则会改错目标。

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_description is commonly used in mods to dynamically update a leader's biography text based on storyline branches. For example, when a nation completes a specific national focus or triggers a key event, the leader's self-introduction updates to reflect their new political stance or historical position. Additionally, in scenarios where multiple ideologies coexist for the same character (such as when one person holds both democratic and fascist ideology positions), you can maintain separate description text for each ideological path.

# After a nation completes a national focus, update the current ruling leader's biography
complete_national_focus = SOV_great_purge
hidden_effect = {
    set_country_leader_description = {
        ideology = stalinism
        desc = "SOV_STALIN_POST_PURGE_DESC"
    }
}

Synergy

  • [create_country_leader](/wiki/effect/create_country_leader): When creating a new leader, an initial description is attached. Subsequently use set_country_leader_description for dynamic updates. Together they form a complete "create→update" leader management workflow.
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait): Adding traits to a leader often accompanies changes to the character's background. Synchronizing the description text update at this point maintains UI narrative consistency.
  • [has_country_leader](/wiki/trigger/has_country_leader): Before modifying a description, use this trigger first to confirm that a leader of the target ideology actually exists, avoiding commands executed on empty positions.
  • [set_country_leader_description](/wiki/effect/set_country_leader_description) (multiple calls): Calling it in different options within the same event enables branching narrative effects where "player choices influence the leader's self-description."

Common Pitfalls

  1. Overlooking the requirement that localization keys must exist: The desc field contains a key name from the localization file, not direct text. If the corresponding language's .yml file lacks that key, the game displays the raw key string instead of the intended description. New modders often mistakenly assume the effect itself has failed.
  2. Misunderstanding the target when omitting ideology: Omitting the ideology field does not affect all leaders; it only modifies the description of the currently ruling leader (i.e., the leader of the nation's current ideology path). If you want to modify a leader's description under a non-ruling ideology, you must explicitly specify ideology, otherwise you will modify the wrong target.