trigger · is_country_leader
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
is_country_leader = yes/no - Checks if the current character is a country leader
is_country_leaderCHARACTERnoneis_country_leader = yes/no - Checks if the current character is a country leader
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_country_leader 常用于角色事件或决策中,判断触发该事件的角色是否当前担任国家领导人,从而区分同一人物在不同职位状态下的不同处理逻辑。例如在政治顾问转为国家领导人后,需要用它来防止重复赋予领导人特质:
# 在 character 作用域内,仅当该角色已是国家领导人时才添加特质
if = {
limit = {
is_country_leader = yes
}
add_country_leader_trait = war_industrialist
}
[can_be_country_leader](/wiki/trigger/can_be_country_leader):通常在检查角色是否「能成为」领导人之后,再用 is_country_leader 确认其「是否已经是」领导人,两者形成前置与现状的双重判断。[add_country_leader_trait](/wiki/effect/add_country_leader_trait):确认角色已是国家领导人后,才对其安全地添加领导人特质,避免在非领导人角色上调用该 effect 导致无效或报错。[remove_country_leader_role](/wiki/effect/remove_country_leader_role):在退出逻辑中,先用 is_country_leader = yes 确认身份,再移除其领导人角色,防止对非领导人角色误触发。[is_advisor](/wiki/trigger/is_advisor):两者组合可以检测"身兼国家领导人与顾问"的罕见状态,用于特殊兼职场景的条件分支。CHARACTER scope 下使用。新手常在 COUNTRY scope 的 trigger 块里直接写 is_country_leader = yes,导致脚本静默失败或报错——需先用 country_leader = { … } 或相关事件将 scope 切换到具体角色上。add_country_leader_role 拥有了领导人角色定义,但若其所属意识形态并非当前执政意识形态,is_country_leader 仍会返回 no。新手容易误以为只要有领导人角色就会为真,需结合国家当前执政意识形态综合判断。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.
is_country_leader is commonly used in character events or decisions to check whether the triggering character currently holds the position of national leader, thereby distinguishing different handling logic for the same person in different roles. For example, after a political advisor becomes a national leader, it must be used to prevent duplicate assignment of leader traits:
# Within character scope, add trait only if the character is already a national leader
if = {
limit = {
is_country_leader = yes
}
add_country_leader_trait = war_industrialist
}
[can_be_country_leader](/wiki/trigger/can_be_country_leader): Typically used after checking whether a character can "become" a leader, then use is_country_leader to confirm whether they "already are" a leader, forming a dual judgment of prerequisite and current state.[add_country_leader_trait](/wiki/effect/add_country_leader_trait): After confirming the character is already a national leader, safely add leader traits to them, avoiding invalid calls or errors when invoking this effect on non-leader characters.[remove_country_leader_role](/wiki/effect/remove_country_leader_role): In exit logic, first use is_country_leader = yes to confirm their status, then remove their leader role, preventing accidental triggers on non-leader characters.[is_advisor](/wiki/trigger/is_advisor): Combined with this trigger, you can detect the rare state of "serving as both national leader and advisor," useful for conditional branching in special dual-role scenarios.CHARACTER scope. Beginners often directly write is_country_leader = yes in the trigger block under COUNTRY scope, causing silent script failure or errors—you must first switch scope to a specific character using country_leader = { … } or related events.add_country_leader_role, but if their ideology does not match the currently ruling ideology, is_country_leader will still return no. Beginners often mistakenly assume that having a leader role guarantees a true result; you must judge comprehensively in combination with the nation's current ruling ideology.