Wiki

effect · create_country_leader

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

creates a leader and adds it to proper party in country
if a character with the same token, or the same name already exists, then just add the country leader role.

Example:
create_country_leader = {
	name = "Leader Name"
	name = XXX_leader_name # optional, faster to find an already existing character
	desc = "LEADER_DESC_LOCALIZATION_TAG"
	picture = "Portrait_leader_name.dds" # picture = "...." also supported for backwards compatibility
	expire = "1965.1.1"
	ideology = despotism
	traits = {
		the_director
	}
}

实战 · 配合 · 坑

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

实战用法

create_country_leader 最常见于 mod 添加新势力、政治剧变或内战事件中,用于为某国即时生成并指定一位特定意识形态的领袖。例如在一个架空历史 mod 里,当某国通过焦点完成政变后,自动替换掉原领导人:

# 某国完成政变焦点后的 completion_reward
GER = {
    create_country_leader = {
        name = "Heinrich Müller"
        desc = "MUELLER_DESC"
        picture = "Portrait_GER_mueller.dds"
        expire = "1965.1.1"
        ideology = fascism_ideology
        traits = {
            ruthless_dictator
        }
    }
}

配合关系

  • [has_country_leader](/wiki/trigger/has_country_leader):在创建新领袖之前,用于检查当前是否已存在特定领袖,避免重复触发或冲突。
  • [add_country_leader_role](/wiki/effect/add_country_leader_role):当角色已作为将领或顾问存在于游戏中时,可改用此命令追加领袖角色,与 create_country_leader 配合覆盖不同的角色创建场景。
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait):领袖创建后立即追加动态特质,弥补 traits 块只能写静态初始特质的局限。
  • [has_country_leader_with_trait](/wiki/trigger/has_country_leader_with_trait):在事件或决策触发条件中,验证当前领袖是否携带某特质,与创建逻辑形成完整的"条件 → 创建 → 验证"流程。

常见坑

  1. 意识形态字段填写层级错误ideology 填的是子意识形态(如 despotismfascism_ideology),而非父级意识形态分组(如 neutralityfascism)。新手常把父级名填进去导致领袖无法正确绑定政党,却不报错只是静默失败。
  2. 同名/同 token 角色未被正确复用:官方描述说明若同名角色已存在会直接追加领袖角色,但若 picturedesc 字段与已有角色不一致,行为可能不符合预期。最稳妥的做法是:对于已在 characters 块中定义过的角色,改用 add_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

create_country_leader is most commonly used in mods for adding new factions, political upheaval, or civil war events, allowing you to instantly generate and assign a leader of a specific ideology to a country. For example, in an alternate history mod, when a country completes a coup through a focus tree, you can automatically replace the original leader:

# Completion reward for a coup focus in a certain country
GER = {
    create_country_leader = {
        name = "Heinrich Müller"
        desc = "MUELLER_DESC"
        picture = "Portrait_GER_mueller.dds"
        expire = "1965.1.1"
        ideology = fascism_ideology
        traits = {
            ruthless_dictator
        }
    }
}

Synergy

  • [has_country_leader](/wiki/trigger/has_country_leader): Before creating a new leader, use this to check if a specific leader already exists, avoiding duplicate triggers or conflicts.
  • [add_country_leader_role](/wiki/effect/add_country_leader_role): When a character already exists in the game as a general or advisor, use this command instead to append a leader role, covering different character creation scenarios alongside create_country_leader.
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait): Dynamically add traits to a leader immediately after creation, compensating for the limitation that the traits block only supports static initial traits.
  • [has_country_leader_with_trait](/wiki/trigger/has_country_leader_with_trait): In event or decision trigger conditions, verify whether the current leader carries a specific trait, forming a complete "condition → create → verify" workflow with the creation logic.

Common Pitfalls

  1. Incorrect hierarchy in ideology field: The ideology field expects a sub-ideology (such as despotism or fascism_ideology), not a parent ideology group (such as neutrality or fascism). Beginners often fill in the parent name, causing the leader to fail binding to the party correctly, yet no error is reported—it silently fails.
  2. Same-named/same-token character not properly reused: The official description states that if a character with the same name already exists, a leader role is directly appended. However, if the picture or desc fields are inconsistent with the existing character, the behavior may not match expectations. The safest approach is: for characters already defined in the characters block, use add_country_leader_role instead of calling this command repeatedly.