Wiki

trigger · is_army_chief

Definition

  • Supported scope:CHARACTER
  • Supported target:none

Description

is_army_chief = yes/no - Checks if the character in scope is hired as an army chief

实战 · 配合 · 坑

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

实战用法

is_army_chief 常用于判断某角色当前是否担任陆军参谋长职位,例如在顾问解雇逻辑、特质解锁、或事件触发条件中过滤目标角色。典型场景是当玩家想对"正在担任陆军参谋长的角色"施加特定 buff 或触发专属事件时,用此 trigger 作为前置条件。

# 仅当该角色正担任陆军参谋长时,才允许触发某事件
character_event = {
    id = my_mod.101
    trigger = {
        is_army_chief = yes
        has_trait = brilliant_strategist
    }
    # ...
}

配合关系

  • [is_advisor](/wiki/trigger/is_advisor)is_army_chief 只检查陆军参谋长这一具体职位,而 is_advisor 检查角色是否处于任意顾问状态,两者配合可构建"正在担任顾问且具体为陆军参谋长"的精确条件层。
  • [has_advisor_role](/wiki/trigger/has_advisor_role):用于进一步确认角色拥有陆军参谋长角色定义,与 is_army_chief 组合可区分"有该角色但未聘用"与"已聘用上岗"两种状态。
  • [advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired):在需要强制解雇陆军参谋长之前,先用 is_army_chief = yes 确认其在职,再配合此 trigger 验证解雇是否被允许,避免脚本报错。
  • [remove_advisor_role](/wiki/effect/remove_advisor_role):确认角色正担任陆军参谋长后,用此 effect 移除其顾问角色,是"检查后执行清除"流程的标准搭档。

常见坑

  1. 混淆"拥有角色"与"已被聘用":角色可以通过 add_advisor_role 被赋予陆军参谋长的角色定义,但 is_army_chief = yes 只在该角色实际被国家聘用上岗时才返回真——仅定义了角色但未聘用的角色会返回假,新手常因此误以为脚本有 bug。
  2. Scope 错误:此 trigger 必须在 CHARACTER scope 下使用,若直接写在国家 scope(如 country_event 的顶层 trigger 块)而未先切换到具体角色 scope,会导致条件永远无法正确求值甚至报错。

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_army_chief is commonly used to check whether a character currently holds the position of army chief of staff. Typical applications include filtering target characters in advisor dismissal logic, trait unlocking, or event trigger conditions. The standard use case is when you want to apply specific buffs or trigger exclusive events for "characters currently serving as army chief of staff"—use this trigger as a prerequisite condition.

# Only trigger the event if the character is currently serving as army chief of staff
character_event = {
    id = my_mod.101
    trigger = {
        is_army_chief = yes
        has_trait = brilliant_strategist
    }
    # ...
}

Synergy

  • [is_advisor](/wiki/trigger/is_advisor): is_army_chief checks only the specific position of army chief of staff, while is_advisor checks whether a character holds any advisor position. Combining both allows you to build precise conditional layers like "serving as an advisor and specifically as army chief of staff."
  • [has_advisor_role](/wiki/trigger/has_advisor_role): Used to further confirm that a character possesses the army chief of staff role definition. Combined with is_army_chief, it helps distinguish between "has the role but not hired" and "hired and actively serving" states.
  • [advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired): Before forcibly dismissing an army chief of staff, first confirm they are in office with is_army_chief = yes, then pair this trigger to verify whether dismissal is permitted, avoiding script errors.
  • [remove_advisor_role](/wiki/effect/remove_advisor_role): After confirming a character actively serves as army chief of staff, use this effect to remove their advisor role. This is the standard companion step in a "check then execute removal" workflow.

Common Pitfalls

  1. Confusing "role possession" with "active employment": A character can be assigned the army chief of staff role definition via add_advisor_role, but is_army_chief = yes only returns true when that character is actually hired and employed by the nation. Characters with only the role defined but not hired will return false—beginners often mistake this for a script bug.
  2. Scope errors: This trigger must be used within a CHARACTER scope. If written directly in a national scope (such as the top-level trigger block of a country_event) without first switching to a specific character scope, the condition will fail to evaluate correctly or cause errors.