Wiki

trigger · has_air_ledger

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

has_air_ledger = yes/no - Checks if the current character has an air ledger

实战 · 配合 · 坑

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

实战用法

has_air_ledger 常用于角色类 mod 中,判断某个角色是否持有空军账本(即是否具备空军指挥官身份),从而决定是否显示特定的 focus 选项、决策或顾问能力。例如,当你想为空军指挥官角色专属解锁某项特质或事件选项时,可以用此 trigger 作为前置条件过滤非空军角色:

available = {
    FROM = {
        has_air_ledger = yes
    }
}

配合关系

  • [has_army_ledger](/wiki/trigger/has_army_ledger) / [has_navy_ledger](/wiki/trigger/has_navy_ledger):三者常并列使用,构成对角色账本类型的完整分支判断,互斥筛选出对应兵种指挥官。
  • [is_air_chief](/wiki/trigger/is_air_chief):空军参谋长同样与空军领域强关联,常与 has_air_ledger 组合确认角色的双重身份(既有账本又担任参谋职位)。
  • [has_trait](/wiki/trigger/has_trait):确认角色拥有空军账本后,进一步检查其是否具有特定空战特质,实现多层条件筛选。
  • [add_timed_unit_leader_trait](/wiki/effect/add_timed_unit_leader_trait):满足 has_air_ledger = yes 后,通过此 effect 为空军指挥官授予限时特质,是典型的"判断 → 施加效果"组合。

常见坑

  1. Scope 混用:此 trigger 只能在 CHARACTER scope 下使用,若在 COUNTRY scope 的 trigger 块中直接调用而未先切换到角色 scope(如通过 FROMevery_character 等),会导致脚本报错或静默失效,新手容易忽略当前 scope 的切换。
  2. is_air_chief 混淆has_air_ledger 检查的是角色是否拥有空军账本(即空军指挥官身份),而不等同于"是否担任空军参谋长";将两者当作同义词使用会导致条件判断范围出现偏差。

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

has_air_ledger is commonly used in character-focused mods to determine whether a character holds an air ledger (i.e., possesses air commander status), which can then be used to decide whether to display specific focus options, decisions, or advisor abilities. For example, when you want to unlock certain traits or event options exclusively for air commander characters, you can use this trigger as a prerequisite condition to filter out non-air characters:

available = {
    FROM = {
        has_air_ledger = yes
    }
}

Synergy

  • [has_army_ledger](/wiki/trigger/has_army_ledger) / [has_navy_ledger](/wiki/trigger/has_navy_ledger): These three triggers are often used in parallel to construct comprehensive branching logic for character ledger types, allowing mutually exclusive filtering of corresponding military branch commanders.
  • [is_air_chief](/wiki/trigger/is_air_chief): The air chief of staff shares strong association with the air domain and is commonly combined with has_air_ledger to confirm dual character identity (both possessing a ledger and holding a staff position).
  • [has_trait](/wiki/trigger/has_trait): After confirming a character possesses an air ledger, further check whether they have specific air combat traits, enabling multi-layered conditional filtering.
  • [add_timed_unit_leader_trait](/wiki/effect/add_timed_unit_leader_trait): After satisfying has_air_ledger = yes, use this effect to grant timed traits to air commanders, exemplifying the typical "check → apply effect" pattern.

Common Pitfalls

  1. Scope Confusion: This trigger can only be used within CHARACTER scope. If called directly in a trigger block under COUNTRY scope without first switching to character scope (such as via FROM, every_character, etc.), it will cause script errors or silent failures. Newcomers often overlook the importance of tracking the current scope context.
  2. Confusion with is_air_chief: has_air_ledger checks whether a character possesses an air ledger (i.e., air commander status), not whether they currently serve as air chief of staff. Using these two interchangeably will result in deviations in the conditional logic range.