trigger · is_unit_template_reserves
Definition
- Supported scope:(none)
- Supported target:
any
Description
returns true if this unit's template has the reserves priority
is_unit_template_reservesanyreturns true if this unit's template has the reserves priority
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
在 mod 中如果你希望区分"预备役模板"与常规作战师模板,可用此 trigger 来决定是否对某支部队施加特殊规则,例如限制预备役师参与特定任务或事件选项。常见场景包括:在国家事件的 trigger 块中检测当前遍历到的师是否属于预备役优先级模板,从而给予不同的叙事描述或条件分支。
# 示例:在某个 on_action 或 unit_leader scope 事件中判断
division_trigger = {
is_unit_template_reserves = yes
# 该师模板被标记为 reserves priority 时条件成立
}
由于当前白名单中同 scope 下没有列出可交叉引用的 effect 或 trigger 命令,暂无可填写的白名单条目。建议在实际脚本中结合外层的 limit 块或 any_of 逻辑运算符使用,但这些不属于本白名单范围,请查阅官方 wiki 确认其 scope 兼容性。
TAG = { is_unit_template_reserves = yes })而没有先通过迭代进入具体的单位 scope,脚本会静默失败或报错,调试时注意查看 error.log。= no 来检测非预备役:虽然 is_unit_template_reserves = no 语法上通常成立,但部分开发者忽略了"reserves priority"是模板级属性而非师级属性,修改模板后需重新指派师才会生效,导致运行时结果与预期不符。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.
If you want to distinguish between "reserves priority templates" and regular combat division templates in your mod, you can use this trigger to decide whether to apply special rules to certain units. For example, you might restrict reserves divisions from participating in specific tasks or event options. Common scenarios include: checking within the trigger block of a country event whether the division currently being iterated belongs to a reserves priority template, thereby providing different narrative descriptions or conditional branches.
# Example: checking in an on_action or unit_leader scope event
division_trigger = {
is_unit_template_reserves = yes
# Condition is true when the division template is marked as reserves priority
}
Since there are no cross-referencing effect or trigger commands listed under the same scope in the current whitelist, there are no whitelist entries to fill. It is recommended to use this with outer limit blocks or any_of logical operators in your actual scripts, but these fall outside the scope of this whitelist. Please consult the official wiki to confirm their scope compatibility.
Scope Mixing: This trigger must be called under the correct division/unit scope; if you write it directly in a country scope (TAG = { is_unit_template_reserves = yes }) without first iterating into a specific unit scope, the script will fail silently or throw an error. When debugging, check error.log.
Mistakenly Using = no to Detect Non-Reserves: Although is_unit_template_reserves = no is typically syntactically valid, some developers overlook that "reserves priority" is a template-level attribute rather than a division-level attribute. After modifying the template, you must reassign divisions for the change to take effect, which can result in runtime behavior differing from expectations.