Wiki

trigger · can_be_country_leader

Definition

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

Description

Returns true if specified character has a least one country leader role.

Example:
can_be_country_leader = GER_erwin_rommelGER_erwin_rommel = { can_be_country_leader = yes }

实战 · 配合 · 坑

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

实战用法

can_be_country_leader 常用于判断某角色是否具备国家领袖职务,从而在 focus、decision 或 on_action 中安全地执行领袖相关操作,避免对非领袖角色误操作。例如在角色死亡后决定接班人时,先过滤掉没有领袖角色的候选人:

# 在某个 decision 的 available 块中,判断目标角色是否能作为国家领袖
available = {
    GER_erwin_rommel = {
        can_be_country_leader = yes
    }
}

配合关系

  • [add_country_leader_role](/wiki/effect/add_country_leader_role):若角色尚未拥有领袖角色,可先行添加,与 can_be_country_leader 配合做"有则跳过、无则补充"的逻辑。
  • [remove_country_leader_role](/wiki/effect/remove_country_leader_role):在确认角色确实持有领袖角色(can_be_country_leader = yes)后,才安全地移除,防止对无该角色的角色执行移除报错。
  • [has_character](/wiki/trigger/has_character):在跨 scope 调用前先确认角色存在于该国,与 can_be_country_leader 形成"角色存在 → 角色有领袖职务"的双重检查链。
  • [promote_character](/wiki/effect/promote_character):晋升角色前先验证其领袖资格,避免将普通顾问或将领误提升为国家领袖。

常见坑

  1. Scope 混淆:该 trigger 可在 COUNTRY scope 下以 TAG = { can_be_country_leader = yes } 写法调用,但此时实际上是检查该 TAG 下某具体角色,不少新手误以为是判断"该国是否存在任意一位国家领袖",实际上必须明确指向具体角色才有意义。
  2. has_advisor_role 混用can_be_country_leader 仅检查是否拥有 country leader role,而顾问职务需用 [has_advisor_role](/wiki/trigger/has_advisor_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

can_be_country_leader is commonly used to verify whether a character possesses a country leader role, enabling safe execution of leader-related operations within focus, decision, or on_action blocks while avoiding unintended actions on non-leader characters. For example, when determining a successor after a character's death, you can first filter out candidates who lack the leader role:

# In the available block of a decision, check whether the target character can serve as a country leader
available = {
    GER_erwin_rommel = {
        can_be_country_leader = yes
    }
}

Synergy

  • [add_country_leader_role](/wiki/effect/add_country_leader_role): If a character does not yet possess a leader role, you can add one first. Combined with can_be_country_leader, this creates an "if present skip, otherwise add" logic pattern.
  • [remove_country_leader_role](/wiki/effect/remove_country_leader_role): Only safely remove a leader role after confirming the character actually holds it (can_be_country_leader = yes), preventing errors when attempting to remove a role from a character who doesn't have it.
  • [has_character](/wiki/trigger/has_character): Before cross-scope invocation, first verify that the character exists in the target country. Combined with can_be_country_leader, this forms a dual-check chain of "character exists → character has leader role".
  • [promote_character](/wiki/effect/promote_character): Verify a character's leader eligibility before promotion to avoid mistakenly elevating ordinary advisors or generals to country leader status.

Common Pitfalls

  1. Scope Confusion: This trigger can be invoked under COUNTRY scope using the syntax TAG = { can_be_country_leader = yes }, but this actually checks a specific character under that TAG. Many beginners mistakenly believe this determines "whether the country has any country leader at all," when in fact it requires explicit reference to a specific character to be meaningful.
  2. Mixing with has_advisor_role: can_be_country_leader only checks whether a character holds a country leader role, while advisor roles must be checked using [has_advisor_role](/wiki/trigger/has_advisor_role). These two cannot be used interchangeably; doing so will cause conditions to fail silently without error messages.