trigger · is_air_chief
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
_is_air_chief = yes/no - Checks if the character in scope is hired as an air chief
is_air_chiefCHARACTERnone_is_air_chief = yes/no - Checks if the character in scope is hired as an air chief
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
在招募或解雇顾问的脚本中,is_air_chief 常用于检查某角色当前是否以空军参谋长身份在职,从而决定是否允许触发相关事件或执行某些效果。例如在角色晋升事件中,仅当该角色已是空军参谋长时才激活特定剧情分支:
# 事件触发限制:仅当角色已担任空军参谋长时才生效
character_event = {
trigger = {
FROM = {
is_air_chief = yes
}
}
option = {
name = "晋升空军参谋长"
FROM = {
add_skill_level = 1
}
}
}
[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor):两者同时使用可区分角色究竟是以顾问身份在职还是以空军参谋长专职在职,避免误判角色状态。[has_advisor_role](/wiki/trigger/has_advisor_role):用于进一步确认角色拥有的顾问职位类型,与 is_air_chief 联用可做精细化的职位校验逻辑。[remove_advisor_role](/wiki/effect/remove_advisor_role):确认角色 is_air_chief = yes 后,用此 effect 安全地移除其空军参谋长职位,避免对非在职角色执行移除操作导致脚本报错。[advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired):在解雇流程中,先用 is_air_chief 确认身份,再用此 trigger 检查该角色是否允许被解雇,两步结合保证逻辑严谨。is_air_chief 必须在 CHARACTER scope 下调用,新手容易在国家 scope(如 ROOT/FROM 指向的是国家而非角色时)直接写,导致脚本静默失败或报错;需要先通过 country_leader、every_character 等方式进入正确的角色 scope。advisor_role,但 is_air_chief 检查的是当前是否已被雇用,而非角色是否具备该职位定义。未雇用的角色即使有该角色定义,返回值仍为 no,应使用 [has_advisor_role](/wiki/trigger/has_advisor_role) 检查职位定义是否存在。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.
In scripts for recruiting or dismissing advisors, is_air_chief is commonly used to check whether a character is currently employed as an air force chief of staff, thereby determining whether to trigger related events or execute certain effects. For example, in a character promotion event, activate a specific story branch only when the character is already serving as air force chief of staff:
# Event trigger restriction: only takes effect when character is already serving as air force chief of staff
character_event = {
trigger = {
FROM = {
is_air_chief = yes
}
}
option = {
name = "Promote to Air Force Chief of Staff"
FROM = {
add_skill_level = 1
}
}
}
[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor): Using both together allows you to distinguish whether a character is employed as an advisor or is exclusively serving as air force chief of staff, avoiding misidentification of character status.[has_advisor_role](/wiki/trigger/has_advisor_role): Used to further confirm the advisor role type possessed by the character. Combined with is_air_chief, it enables granular validation logic for role verification.[remove_advisor_role](/wiki/effect/remove_advisor_role): After confirming the character has is_air_chief = yes, use this effect to safely remove their air force chief of staff position, avoiding script errors from attempting to remove a role from a character not currently employed.[advisor_can_be_fired](/wiki/trigger/advisor_can_be_fired): In a dismissal workflow, first use is_air_chief to confirm identity, then use this trigger to check whether the character is allowed to be dismissed. Combined, these two steps ensure logical rigor.is_air_chief must be called within a CHARACTER scope. Beginners often mistakenly write it directly when in a country scope (such as when ROOT/FROM refer to countries rather than characters), resulting in silent script failure or errors. You must first enter the correct character scope via country_leader, every_character, or similar methods.advisor_role defined in the character file, but is_air_chief checks whether the character is currently hired, not whether the character possesses that role definition. An unhired character returns no even if they have that role definition, and you should use [has_advisor_role](/wiki/trigger/has_advisor_role) to check whether the role definition exists.