Wiki

effect · add_country_leader_role

Definition

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

Description

add country leader role to character

Example:
add_country_leader_role = {
	character = "GER_Character_Token" # optional if inside character scope
	promote_leader = yes
	country_leader = {
		ideology = socialism
		expire = "1965.1.1.1"
		traits = {
			war_industrialist
		}
	}
}

实战 · 配合 · 坑

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

实战用法

在 mod 中常用于为已有角色动态赋予国家领导人身份,例如在某条国策或事件触发后让一名将领或顾问"转型"为国家元首,而无需重新创建整个角色。以下示例在一个国家事件中将某角色提升为领导人并赋予意识形态特质:

country_event = {
    id = my_mod.1
    immediate = {
        add_country_leader_role = {
            character = "GER_custom_leader"
            promote_leader = yes
            country_leader = {
                ideology = fascism_ideology
                expire = "1960.1.1.1"
                traits = {
                    dictator
                }
            }
        }
    }
}

配合关系

  • [remove_country_leader_role](/wiki/effect/remove_country_leader_role):先移除旧有的领导人角色再添加新角色,常用于实现领导人"转换阵营"或更换意识形态的剧情。
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait):添加领导人角色后紧接着追加额外特质,弥补初始 traits 块不够灵活的问题。
  • [promote_character](/wiki/effect/promote_character):配合使用可确保角色在获得领导人角色后立刻出现在政治界面,避免角色处于"后台待机"状态。
  • [can_be_country_leader](/wiki/trigger/can_be_country_leader):在执行添加前用作条件检查,确认角色当前允许担任国家领导人,防止因角色状态不符而静默失败。

常见坑

  1. 在 COUNTRY scope 下遗漏 character 字段:只有在 CHARACTER scope 内时该字段才可省略;若在国家事件或国策效果块(COUNTRY scope)中忘写 character = "..." 则指令无效,且游戏通常不会报错,导致难以排查。
  2. promote_leader = yes 与已有在任领导人冲突:若目标意识形态当前已有活跃领导人,强制 promote_leader = yes 会直接顶替现任者,可能打断玩家正在进行的意识形态路线;建议搭配 [can_be_country_leader](/wiki/trigger/can_be_country_leader) 或先用 [remove_country_leader_role](/wiki/effect/remove_country_leader_role) 清理旧角色再执行。

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

Commonly used in mods to dynamically assign country leader roles to existing characters. For example, you can promote a general or advisor to head of state after a focus tree or event triggers, without needing to create an entirely new character. The following example promotes a character to leader and assigns an ideology trait within a country event:

country_event = {
    id = my_mod.1
    immediate = {
        add_country_leader_role = {
            character = "GER_custom_leader"
            promote_leader = yes
            country_leader = {
                ideology = fascism_ideology
                expire = "1960.1.1.1"
                traits = {
                    dictator
                }
            }
        }
    }
}

Synergy

  • [remove_country_leader_role](/wiki/effect/remove_country_leader_role): Remove the old leader role before adding a new one. Useful for implementing narrative scenarios where leaders "switch sides" or change ideologies.
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait): Append additional traits immediately after assigning the leader role, providing flexibility beyond what the initial traits block offers.
  • [promote_character](/wiki/effect/promote_character): Use in conjunction to ensure the character appears in the political interface immediately after gaining the leader role, preventing them from remaining in a "waiting" state.
  • [can_be_country_leader](/wiki/trigger/can_be_country_leader): Use as a conditional check before executing the command to verify the character is currently eligible to serve as country leader, preventing silent failures due to incompatible character state.

Common Pitfalls

  1. Omitting the character field in COUNTRY scope: This field can only be omitted when in CHARACTER scope. Forgetting to write character = "..." in country events or focus effects (COUNTRY scope) will silently fail with no error message, making it difficult to debug.
  2. promote_leader = yes conflicts with an existing active leader: If the target ideology already has an active leader, forcing promote_leader = yes will immediately replace the current leader, potentially disrupting the player's ideological path. It's recommended to pair this with [can_be_country_leader](/wiki/trigger/can_be_country_leader) or use [remove_country_leader_role](/wiki/effect/remove_country_leader_role) to clear old characters first.