Wiki

trigger · has_country_leader_with_trait

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

check if current country leader has specified trait.
has_country_leader_with_trait = big_fat_idiot

实战 · 配合 · 坑

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

实战用法

常见于政治事件、顾问系统或国策树中,用于判断当前国家领袖是否持有特定 trait,从而触发不同的剧情分支或限制某些选项。例如在一个专注于领导层更迭的 mod 中,可以检测领袖是否拥有某个负面特性来触发内乱事件。

# 事件选项中,仅当领袖拥有 "incompetent" 特性时才可用
option = {
    name = my_event.option_a
    trigger = {
        has_country_leader_with_trait = incompetent
    }
    add_stability = -0.05
}

配合关系

  • [has_country_leader](/wiki/trigger/has_country_leader):先检查某位具体领袖是否在位,再用 has_country_leader_with_trait 确认其特性,两者叠加可精准定位特定人物的特定状态。
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait):检测领袖当前缺少某 trait 后,通过该 effect 为其添加,形成"判断→赋予"的完整逻辑链。
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology):与意识形态检测配合,可构造"特定派系领袖 + 特定特性"的复合条件,用于高度定制化的事件触发门槛。
  • [add_political_power](/wiki/effect/add_political_power):在以领袖特性为条件的 available 块中通过后,搭配政治点数奖惩来强化"优秀/低能领袖"对国政的影响反馈。

常见坑

  1. trait 名称拼写必须与 leader_traits 定义完全一致,包括大小写和下划线,哪怕只差一个字符也会静默失败(条件永远返回 false),且游戏不会报错,极难排查。
  2. 该 trigger 只检测当前执政领袖,若某角色同时担任将领或顾问,其在那些职位上持有的 trait 不会被这个 trigger 检测到;需要检测军事指挥官特性时应改用针对 unit leader 的相关 trigger。

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 found in political events, advisor systems, or national focus trees, used to determine whether the current country's leader possesses a specific trait, thereby triggering different story branches or restricting certain options. For example, in a mod focused on leadership transitions, you can detect whether a leader has a negative trait to trigger a civil unrest event.

# In event options, only available when the leader has the "incompetent" trait
option = {
    name = my_event.option_a
    trigger = {
        has_country_leader_with_trait = incompetent
    }
    add_stability = -0.05
}

Synergy

  • [has_country_leader](/wiki/trigger/has_country_leader): First check whether a specific leader is in office, then use has_country_leader_with_trait to confirm their trait. Combining both allows precise targeting of a specific person's specific state.
  • [add_country_leader_trait](/wiki/effect/add_country_leader_trait): After detecting that a leader currently lacks a certain trait, use this effect to add it, forming a complete "check → assign" logic chain.
  • [has_country_leader_ideology](/wiki/trigger/has_country_leader_ideology): When combined with ideology detection, you can construct compound conditions of "specific faction leader + specific trait," useful for highly customized event trigger thresholds.
  • [add_political_power](/wiki/effect/add_political_power): After passing the available block with leader traits as conditions, pair it with political power rewards or penalties to reinforce the feedback on how "excellent/incompetent leaders" affect national policy.

Common Pitfalls

  1. Trait names must match exactly with the leader_traits definition, including case sensitivity and underscores. Even a single character difference will silently fail (the condition always returns false), and the game will not report an error, making it extremely difficult to debug.
  2. This trigger only checks the currently ruling leader. If a character simultaneously serves as a general or advisor, the traits they hold in those positions will not be detected by this trigger. To check military commander traits, use the relevant trigger designed for unit leaders instead.