Wiki

trigger · is_fighting_in_weather

Definition

  • Supported scope:COMBATANT
  • Supported target:THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

Description

Checks the weather on a combat
Example:
# true if weather is artic water
is_fighting_in_weather = artic_water
# true if weather is either artic_water or snow
is_fighting_in_weather = { artic_water snow }

实战 · 配合 · 坑

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

实战用法

is_fighting_in_weather 常用于制作天气相关特性或战斗事件的 mod,例如让某些特种部队在极端天气下触发特殊战斗加成,或为暴风雪/沙漠热浪战斗设计专属事件链。需要注意该 trigger 工作在 COMBATANT scope(即交战方),因此通常出现在战斗相关的 on_action 或 combat modifier 条件块中。

# 示例:在冬季风暴或北极水域战斗时,精锐山地师获得特殊 modifier
combat_modifier = {
    allowed = {
        has_trait = mountaineer
        is_fighting_in_weather = { artic_water snow }
    }
    attack = 0.10
    defense = 0.15
}

配合关系

  • is_fighting_in_terrain:天气与地形往往共同决定战场环境,常组合使用以精确筛选"大雪+山地"等复合极端条件。
  • is_attacker / is_defender:结合进攻/防守身份判断,可以区分"在暴风雪中强行进攻"和"依托地形坚守"两种截然不同的战术情境。
  • has_trait:天气加成通常只对持有特定特质(如 winter_specialist)的部队生效,两者配合可避免所有部队无差别受益。
  • night:夜战与恶劣天气常叠加出现,组合判断可用于模拟能见度极低的极端战斗场景。

常见坑

  1. Scope 错误:该 trigger 仅在 COMBATANT scope 下有效,若写在 country scope 或 division scope 的条件块中会静默失败(永远返回 false),新手容易把它误放到 division_trigger 或国家事件的 trigger 块里。
  2. 天气标识符拼写:官方天气 key(如 artic_water 注意不是 arctic_water)来自游戏内部定义,拼写错误不会报错但条件永远不满足,建议直接从原版文件中复制而非凭记忆输入。

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

is_fighting_in_weather is commonly used in mods that implement weather-related traits or combat events, such as triggering special combat bonuses for certain elite units in extreme weather conditions, or designing dedicated event chains for blizzard/desert heat battles. Note that this trigger operates in COMBATANT scope (i.e., the combatant side), so it typically appears in combat-related on_action or combat modifier condition blocks.

# Example: Elite mountain divisions gain special modifier when fighting in winter storms or arctic waters
combat_modifier = {
    allowed = {
        has_trait = mountaineer
        is_fighting_in_weather = { artic_water snow }
    }
    attack = 0.10
    defense = 0.15
}

Synergy

  • is_fighting_in_terrain: Weather and terrain often jointly determine the battle environment; these are frequently combined to precisely filter for compound extreme conditions like "heavy snow + mountains."
  • is_attacker / is_defender: When combined with attacker/defender status checks, you can distinguish between two vastly different tactical scenarios: "forcing an advance through blizzards" versus "holding ground using terrain advantages."
  • has_trait: Weather bonuses typically only apply to units with specific traits (such as winter_specialist); using these two together prevents indiscriminate benefits for all units.
  • night: Night combat and severe weather often occur together; combining these checks allows you to simulate extreme battle scenarios with severely reduced visibility.

Common Pitfalls

  1. Scope Errors: This trigger is only valid in COMBATANT scope. If placed in a country scope or division scope condition block, it will silently fail (always returning false). Beginners often mistakenly place it in division_trigger or national event trigger blocks.
  2. Weather Identifier Spelling: Official weather keys (such as artic_water—note it is not arctic_water) come from game internal definitions. Spelling errors will not generate warnings but the condition will never be satisfied. It is recommended to copy directly from vanilla files rather than relying on memory.