trigger · phase
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
check if we are in this combat phase
phaseCOMBATANTnonecheck if we are in this combat phase
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
phase 常用于自定义战斗事件或决策中,根据当前战斗所处的阶段(如突破阶段、持续战斗阶段等)触发不同的效果或加成。例如可以在 mod 中实现"只有在特定战斗阶段才触发某种士气崩溃事件"的逻辑:
COMBATANT = {
limit = {
phase = preparation
is_attacker = yes
}
# 在准备阶段且为进攻方时触发某逻辑
}
phase 搭配确认某阶段是否已存在特定战斗加成,避免重复叠加同类修正。phase 接受的具体阶段名称必须与游戏内部定义完全一致(区分大小写),新手容易凭直觉猜写,导致条件永远不满足却没有任何报错提示,建议直接参考官方脚本中已有用例确认合法值。phase 只在战斗双方(COMBATANT)scope 下有效,若误用在 country 或 unit_leader 等 scope 中,游戏不会报错但条件始终返回 false,排查时容易被忽视。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.
phase is commonly used in custom battle events or decisions to trigger different effects or bonuses based on the current stage of combat (such as breakthrough phase, sustained combat phase, etc.). For example, you can implement logic in a mod like "trigger a morale collapse event only during a specific combat phase":
COMBATANT = {
limit = {
phase = preparation
is_attacker = yes
}
# Triggers certain logic when in preparation phase and as the attacker
}
phase to confirm whether a specific combat bonus already exists during that stage, preventing unwanted stacking of similar modifiers.phase must exactly match the in-game definitions (case-sensitive). Beginners often guess based on intuition, resulting in conditions that never trigger with no error messages. It is recommended to directly reference existing examples in official scripts to confirm valid values.phase is only valid within the COMBATANT scope (the two sides in combat). If mistakenly used in scopes like country or unit_leader, the game will not report an error but the condition will always return false, making it easy to overlook during troubleshooting.