trigger · has_max_planning
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
check if side has maximal planning bonus
has_max_planningCOMBATANTnonecheck if side has maximal planning bonus
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_max_planning 常用于战斗事件或 on_action 触发器中,判断某一交战方是否已达到最大计划加成,从而决定是否触发特定的战斗奖励、特质解锁或 AI 行为分支。例如,在自定义战斗事件中,当进攻方计划加成拉满时,给予额外的士气或作战加成:
combat_event = {
id = my_mod.1
trigger = {
is_attacker = yes
has_max_planning = yes
}
# 事件内容...
}
min_planning 检查当前加成是否达到某一下限,结合 has_max_planning 可区分"刚开始计划"和"计划已满"两种状态。has_max_planning 搭配可精确描述"在某一阶段且计划已满"的战况。has_max_planning 只能在 COMBATANT scope(即战斗中的交战方)内使用,新手容易将其写在国家 scope 或将领 scope 下,导致脚本报错或静默失败,务必确认外层是 combat_event 或正确的战斗 on_action。min_planning 语义混淆:min_planning 接受一个数值参数检查计划加成下限,而 has_max_planning 是无参数的布尔检查,新手有时会尝试给 has_max_planning 传值(如 has_max_planning = yes 之外写数字),这是无效写法。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.
has_max_planning is commonly used in combat events or on_action triggers to determine whether a combatant has reached maximum planning bonus, thereby deciding whether to trigger specific combat rewards, trait unlocks, or AI behavior branches. For example, in a custom combat event, when the attacker's planning bonus is maxed out, grant additional morale or combat bonuses:
combat_event = {
id = my_mod.1
trigger = {
is_attacker = yes
has_max_planning = yes
}
# Event content...
}
min_planning verifies whether the current bonus reaches a lower threshold, and combined with has_max_planning you can distinguish between "planning just started" and "planning maxed out" states.has_max_planning, it precisely describes combat situations like "in a specific phase and planning is maxed out".has_max_planning can only be used within COMBATANT scope (i.e., combatants in a fight). Beginners often write it under country scope or general scope, causing script errors or silent failures. Always confirm the outer layer is combat_event or the correct combat on_action.min_planning: min_planning accepts a numeric parameter to check the planning bonus lower limit, while has_max_planning is a parameterless boolean check. Beginners sometimes attempt to pass a value to has_max_planning (e.g., writing numbers beyond has_max_planning = yes), which is invalid syntax.