Wiki

trigger · is_leader_visible

Definition

  • Supported scope:COUNTRY
  • Supported target:any

Description

Checks if the leader is visible to its owner (is_visible trigger in the leader's script)

实战 · 配合 · 坑

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

实战用法

is_leader_visible 常用于国家领袖相关的事件或决策中,用来判断某位领袖是否对其国家"可见"(即其 is_visible 脚本条件为真),从而决定是否触发与该领袖相关的剧情、决策解锁或顾问激活逻辑。例如在一个隐藏领袖重新登场的 mod 中,可以用它作为解锁条件门槛。

# 在某个决策的 available 块中,仅当当前国家领袖可见时才允许激活
activate_decision = {
    available = {
        has_country_leader = {
            ruling_only = yes
        }
        is_leader_visible = yes
        has_stability > 0.5
    }
}

配合关系

  • has_country_leader:通常先确认某位特定领袖存在并执政,再用 is_leader_visible 进一步判断其可见性,两者组合构成完整的领袖状态检查。
  • has_government:当领袖可见性与政体意识形态挂钩时,常一同用在 limit 块中,限制事件只对特定政体下可见的领袖生效。
  • hidden_trigger:将 is_leader_visible 包裹在 hidden_trigger 中,可在不向玩家显示条件细节的情况下进行后台领袖可见性校验。
  • activate_advisor:当领袖可见性满足后,配合此 effect 将该领袖以顾问身份激活,是"隐藏人物重新出现"类 mod 的常见流程。

常见坑

  1. 将 scope 用错is_leader_visible 只能在 COUNTRY scope 下使用,若写在 characterstate scope 内则不会生效,新手容易在 every_character 块内部直接调用而忘记切回国家 scope。
  2. 误以为可以传入具体领袖参数:该 trigger 不接受任何字段参数,直接写 is_leader_visible = yes 即可;试图写成 is_leader_visible = { character = XXX } 会导致解析错误,其可见性判断来源于领袖脚本中的 is_visible 定义,无法在此处覆盖指定目标。

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

is_leader_visible is most commonly used in events or decisions related to country leaders, checking whether a given leader is "visible" to their country (i.e., their is_visible scripted condition evaluates to true). This determines whether to trigger leader-specific story beats, unlock decisions, or fire advisor activation logic. For example, in a mod where a hidden leader makes a comeback, this trigger serves as the gating condition for the unlock.

# Inside a decision's available block — only allows activation when the current country leader is visible
activate_decision = {
    available = {
        has_country_leader = {
            ruling_only = yes
        }
        is_leader_visible = yes
        has_stability > 0.5
    }
}

Synergy

  • has_country_leader: Typically used first to confirm that a specific leader exists and is in power, then paired with is_leader_visible to further verify their visibility — together they form a complete leader state check.
  • has_government: When leader visibility is tied to government ideology, both triggers are often placed together in a limit block to restrict events so they only fire for visible leaders under a specific government type.
  • hidden_trigger: Wrapping is_leader_visible inside a hidden_trigger allows background visibility checks without exposing the condition details to the player.
  • activate_advisor: Once leader visibility is confirmed, pair this with activate_advisor to bring that leader in as an advisor — a standard pattern in "hidden character resurfaces" style mods.

Common Pitfalls

  1. Wrong scope: is_leader_visible can only be used within a COUNTRY scope. Writing it inside a character or state scope will cause it to silently do nothing. A common beginner mistake is calling it directly inside an every_character block without switching back to the country scope first.
  2. Assuming it accepts a character parameter: This trigger takes no field arguments — simply write is_leader_visible = yes and nothing more. Attempting to write is_leader_visible = { character = XXX } will cause a parse error. The visibility check is driven entirely by the is_visible definition in the leader's script and cannot be overridden by specifying a target here.