trigger · is_field_marshal
Definition
- Supported scope:
CHARACTER - Supported target:
none
Description
is_field_marshal = yes/no - Checks if the current unit leader is a field marshall
is_field_marshalCHARACTERnoneis_field_marshal = yes/no - Checks if the current unit leader is a field marshall
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
is_field_marshal 常用于区分元帅与军长,在角色相关事件或决策中限定触发对象,例如只允许元帅才能触发某条晋升链或特殊特质的授予。也可用于 unit_leader 类循环中过滤掉非元帅角色,避免误操作普通指挥官。
# 仅当当前角色为元帅时,才允许添加某个特殊特质
add_trait = {
character = THIS
limit = {
is_field_marshal = yes
}
trait = legendary_commander
}
[is_corps_commander](/wiki/trigger/is_corps_commander) — 常与 is_field_marshal 并列写在 OR/NOT 块中,共同覆盖或排除所有陆军指挥官类型。[add_field_marshal_role](/wiki/effect/add_field_marshal_role) — 在 effect 块中晋升角色为元帅之前,先用 is_field_marshal = no 确认其尚未持有该身份,避免重复赋予。[promote_leader](/wiki/effect/promote_leader) — 与 is_field_marshal = no 搭配作为前提条件,确保只有非元帅的指挥官才会被提升。[has_trait](/wiki/trigger/has_trait) — 确认元帅身份后,再进一步检查其是否持有特定特质,实现多层筛选逻辑。is_field_marshal 必须处于 CHARACTER scope 下才有效,若在国家或省份 scope 中直接调用会导致脚本报错或永远返回 false,新手容易忘记先通过 any_army_leader 或 country_leader 等方式切换到正确 scope。is_army_leader 的混淆:is_army_leader 检查的是"正在指挥某支军队"的状态,而 is_field_marshal 检查的是角色的职务类型,二者含义不同;元帅未必正在领军,军长也未必不是元帅级别,混用会导致条件判断出现意外漏网或误判。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_field_marshal is commonly used to distinguish field marshals from corps commanders in character-related events or decisions, restricting trigger targets to field marshals only—for example, allowing only marshals to trigger certain promotion chains or receive special traits. It can also be used within unit_leader loops to filter out non-marshal characters and prevent accidental modifications to regular commanders.
# Add a special trait only if the current character is a field marshal
add_trait = {
character = THIS
limit = {
is_field_marshal = yes
}
trait = legendary_commander
}
[is_corps_commander](/wiki/trigger/is_corps_commander) — Commonly paired with is_field_marshal in OR/NOT blocks to collectively cover or exclude all land army commander types.[add_field_marshal_role](/wiki/effect/add_field_marshal_role) — Before promoting a character to field marshal in an effect block, first confirm with is_field_marshal = no that they do not yet hold that rank, avoiding duplicate assignment.[promote_leader](/wiki/effect/promote_leader) — Pair with is_field_marshal = no as a prerequisite condition to ensure only non-marshal commanders are promoted.[has_trait](/wiki/trigger/has_trait) — After confirming marshal status, further check whether they possess specific traits to implement multi-layer filtering logic.is_field_marshal only functions within CHARACTER scope; calling it directly in a national or state scope will cause script errors or always return false. Beginners often forget to switch to the correct scope first using methods like any_army_leader or country_leader.is_army_leader: is_army_leader checks whether the character is actively commanding an army, whereas is_field_marshal checks the character's job rank—these have different meanings. A marshal may not be actively leading troops, and a corps commander may still hold marshal-level rank; mixing them up causes unexpected condition failures or false positives.