trigger · is_navy_chief
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
_is_navy_chief_ = yes/no - Checks if the character in scope is hired as a navy chief
is_navy_chiefCHARACTERnone_is_navy_chief_ = yes/no - Checks if the character in scope is hired as a navy chief
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_navy_chief 常用于限制某些事件或决策只对当前担任海军总司令顾问职位的角色生效,例如在顾问相关事件中检查触发角色的身份。也可用于 available 块,防止玩家对海军总司令执行不合适的操作。
# 事件触发条件:仅当该角色是海军总司令时触发
character_event = {
id = my_mod.101
trigger = {
is_navy_chief = yes
}
# ...
}
[is_advisor](/wiki/trigger/is_advisor):先判断角色是否为顾问,再用 is_navy_chief 精确区分顾问类型,避免逻辑冗余。[has_advisor_role](/wiki/trigger/has_advisor_role):两者结合可在更复杂的条件块中交叉验证角色的顾问角色定义与实际上岗状态是否一致。[remove_advisor_role](/wiki/effect/remove_advisor_role):确认角色确实是海军总司令后,再安全地移除其顾问角色,防止对无该职位的角色误操作。[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor):与 is_navy_chief 搭配可同时检查"已被雇用"和"具体是海军总司令"两个层面,逻辑更严谨。is_navy_chief 必须在 CHARACTER scope 下使用,直接写在国家 scope 的 trigger 块里会静默失败或报错,需先通过 any_character / with_character 等方式切换到角色 scope。advisor 定义中拥有 navy_chief 角色,但若尚未被雇用,is_navy_chief 仍返回 no;若只想检查角色是否拥有该角色定义,应改用 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.
is_navy_chief is commonly used to restrict certain events or decisions to only apply when the triggering character currently holds the Naval High Command advisor position. For example, you can check the identity of the triggered character in advisor-related events. It can also be used in available blocks to prevent players from performing inappropriate actions on naval commanders.
# Event trigger condition: only fire when the character is a naval chief
character_event = {
id = my_mod.101
trigger = {
is_navy_chief = yes
}
# ...
}
[is_advisor](/wiki/trigger/is_advisor): First determine whether the character is an advisor, then use is_navy_chief to precisely distinguish advisor type, avoiding logical redundancy.[has_advisor_role](/wiki/trigger/has_advisor_role): Combining the two allows cross-validation in more complex condition blocks to verify whether the character's advisor role definition matches their actual employed status.[remove_advisor_role](/wiki/effect/remove_advisor_role): After confirming the character is indeed a naval chief, safely remove their advisor role to prevent accidental operations on characters without that position.[is_hired_as_advisor](/wiki/trigger/is_hired_as_advisor): Used together with is_navy_chief to simultaneously check both "has been hired" and "specifically is a naval chief" at different levels, making the logic more rigorous.is_navy_chief must be used under CHARACTER scope. Writing it directly in a country scope trigger block will fail silently or produce an error. You must first switch to character scope using methods like any_character or with_character.navy_chief role in the advisor definition, but if they have not yet been hired, is_navy_chief will still return no. If you only want to check whether a character possesses that role definition, use has_advisor_role instead.