trigger · has_army_ledger
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
has_army_ledger = yes/no - Checks if the current character has an army ledger
has_army_ledgerCHARACTERnonehas_army_ledger = yes/no - Checks if the current character has an army ledger
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_army_ledger 常用于判断某个角色是否拥有陆军账本(即该角色是否被赋予了陆军指挥相关的领导者角色),从而决定是否触发特定的奖励、特质或事件分支。例如在自定义将领成长系统中,可以在提升技能前先确认角色的身份归属,避免给非陆军角色错误赋值。
# 仅当角色持有陆军账本时,才允许获得特定特质
add_unit_leader_trait = {
limit = {
has_army_ledger = yes
}
trait = infantry_expert
}
[is_army_leader](/wiki/trigger/is_army_leader):两者常结合使用,is_army_leader 判断角色是否正在领导陆军部队,配合 has_army_ledger 可双重确认该角色既拥有陆军账本又处于实际指挥状态。[has_navy_ledger](/wiki/trigger/has_navy_ledger)、[has_air_ledger](/wiki/trigger/has_air_ledger):通常以互斥方式出现,用于区分三军将领身份,确保特定逻辑只作用于对应兵种的角色。[add_unit_leader_trait](/wiki/effect/add_unit_leader_trait):在 limit 块中用 has_army_ledger 做门控,确保只有陆军账本持有者才能被添加相应的陆军专属特质。[has_trait](/wiki/trigger/has_trait):与 has_army_ledger 联用,在授予新特质前同时检查角色是否已有某前置特质,构成多条件的复合判断。has_army_ledger 只能在 CHARACTER scope 下生效,若在 COUNTRY 或 STATE 等其他 scope 中使用会导致脚本报错或静默失败,需注意在进入正确 scope(如通过 any_army_leader 等迭代器)后再调用。is_army_leader 混淆:has_army_ledger 检查的是角色是否被分配了陆军账本(角色类型层面),而非是否正在实际领兵,两者语义不同,混用会导致条件判断范围不符合预期。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.
has_army_ledger is commonly used to determine whether a character possesses an army ledger (i.e., whether the character has been assigned a military command-related leader role), thereby deciding whether to trigger specific bonuses, traits, or event branches. For example, in a custom general growth system, you can confirm the character's role identity before promoting skills, avoiding incorrect assignments to non-army characters.
# Only allow acquiring specific traits when the character holds an army ledger
add_unit_leader_trait = {
limit = {
has_army_ledger = yes
}
trait = infantry_expert
}
[is_army_leader](/wiki/trigger/is_army_leader): These two are often used in combination. is_army_leader checks whether a character is actively commanding army forces, and paired with has_army_ledger provides a dual confirmation that the character both possesses an army ledger and is in an actual command state.[has_navy_ledger](/wiki/trigger/has_navy_ledger), [has_air_ledger](/wiki/trigger/has_air_ledger): Typically appear in mutually exclusive patterns to distinguish between the three military branches, ensuring specific logic only applies to characters of the corresponding unit type.[add_unit_leader_trait](/wiki/effect/add_unit_leader_trait): Used as a gate condition in limit blocks with has_army_ledger to ensure only army ledger holders can be granted the corresponding army-exclusive traits.[has_trait](/wiki/trigger/has_trait): When used together with has_army_ledger, simultaneously checks whether a character already has a prerequisite trait before granting a new one, forming a multi-condition composite check.has_army_ledger only functions within CHARACTER scope. Using it in other scopes such as COUNTRY or STATE will cause script errors or silent failures. Be sure to call it only after entering the correct scope (such as through iterators like any_army_leader).is_army_leader: has_army_ledger checks whether a character has been assigned an army ledger (character type level), not whether they are actively commanding troops. The semantics are different, and mixing them up will result in condition checks that don't match expectations.