Wiki

trigger · min_planning

Definition

  • Supported scope:COMBATANT
  • Supported target:none

Description

check if side has maximal planning bonus

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

min_planning 常用于战斗事件或决策树中,判断某一战斗方是否已达到最低规划加成阈值,从而触发特定的战术奖励或惩罚逻辑。例如在自定义战斗 modifier 的 mod 中,可以根据规划状态动态调整战场表现:

# 在战斗相关的 on_action 中使用
combatant_event = {
    trigger = {
        is_attacker = yes
        min_planning = yes
    }
    # 攻方已获得最低规划加成时触发
}

配合关系

  • has_max_planning:与 min_planning 形成"下限/上限"组合,可区分规划处于"刚达到最低"与"完全满格"两种状态,实现精细化的战斗分支逻辑。
  • is_attacker / is_defender:规划加成对进攻方意义更为突出,通常先判断攻守角色再判断规划状态,避免逻辑混淆。
  • phase:战斗阶段与规划加成密切相关,配合使用可以针对特定战斗阶段(如准备阶段结束后)才触发规划相关逻辑。
  • planning_skill_level:指挥官的规划技能等级影响规划加成累积速度,两者搭配可以构建"指挥官能力 + 当前规划状态"的复合条件判断。

常见坑

  1. scope 混用min_planning 只在 COMBATANT scope 下有效,新手常在 countryunit_leader scope 里直接调用,导致脚本报错或条件永远不触发,必须确保在 combatant_event 或战斗相关的 on_action 回调中使用。
  2. has_max_planning 语义混淆min_planning 检查的是"最低"规划加成,而非最高,初学者容易误以为两者等价或方向相反,建议结合官方日志输出实际测试,明确两个 trigger 各自的判断边界后再写分支逻辑。

Hands-On Notes

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.

Hands-On Usage

min_planning is commonly used in combat events or decision trees to check whether a combatant has reached the minimum planning bonus threshold, thereby triggering specific tactical rewards or penalty logic. For example, in a custom combat modifier mod, you can dynamically adjust battlefield performance based on planning status:

# Usage in combat-related on_action
combatant_event = {
    trigger = {
        is_attacker = yes
        min_planning = yes
    }
    # Triggers when the attacker has achieved minimum planning bonus
}

Synergy

  • has_max_planning: Forms a "floor/ceiling" pairing with min_planning, allowing you to distinguish between "just reached minimum" and "completely maxed out" states, enabling fine-grained combat branch logic.
  • is_attacker / is_defender: Planning bonuses are more significant for the attacking side; typically check the attacker/defender role first before evaluating planning status to avoid logical confusion.
  • phase: Combat phase is closely tied to planning bonus accumulation; combined usage allows you to trigger planning-related logic only at specific battle phases (such as after preparation phase completion).
  • planning_skill_level: The commander's planning skill level affects how quickly planning bonuses accumulate; pairing these two creates compound condition logic based on "commander capability + current planning state".

Common Pitfalls

  1. Scope mixing: min_planning only works in the COMBATANT scope. Beginners often call it directly within country or unit_leader scopes, causing script errors or triggers that never fire. Always ensure usage within combatant_event or combat-related on_action callbacks.
  2. Semantic confusion with has_max_planning: min_planning checks for the "minimum" planning bonus, not the maximum. Beginners often mistakenly think the two are equivalent or opposite. It's recommended to test with official logging output to clearly understand each trigger's judgment boundary before writing branch logic.