Wiki

trigger · has_carrier_airwings_in_own_combat

Definition

  • Supported scope:COMBATANT
  • Supported target:none

Description

Check if carrier has airplanes that are part of the current combat

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

In mods involving carrier warfare, this trigger is commonly used to design exclusive combat events or decisions for carrier task forces, such as triggering special combat modifiers or narrative events when carrier-based aircraft aboard are participating in the current naval battle. It can also be used to restrict certain traits or combat directives to only take effect when carrier-based aircraft are actually engaged in combat, preventing related logic from being erroneously activated when no carrier aircraft are involved.

# Carrier combat event: trigger special dialogue when carrier aircraft are in combat
combat_event = {
    id = my_mod.carrier_combat.1
    trigger = {
        is_attacker = yes
        has_carrier_airwings_in_own_combat = yes
        is_fighting_in_terrain = sea
    }
    ...
}

Synergy

  • [has_carrier_airwings_on_mission](/wiki/trigger/has_carrier_airwings_on_mission): Both are commonly used in tandem; the former checks whether carrier aircraft are in the current combat, while the latter checks whether they are executing a mission. Combined usage allows precise distinction between different participation states of carrier-based aircraft.
  • [is_attacker](/wiki/trigger/is_attacker) / [is_defender](/wiki/trigger/is_defender): When paired, they distinguish whether the attacking or defending carrier has deployed aircraft, allowing different combat bonuses or event conditions to be set for both sides.
  • [has_combat_modifier](/wiki/trigger/has_combat_modifier): After confirming carrier aircraft participation, further check whether a specific combat modifier already exists to prevent duplicate stacking of modifiers that could cause numerical anomalies.
  • [is_fighting_in_terrain](/wiki/trigger/is_fighting_in_terrain): When paired, this ensures the logic only takes effect in oceanic terrain combat, preventing erroneous activation of carrier-related checks in inland battle scenarios.

Common Pitfalls

  1. Scope Confusion: The scope of this trigger is COMBATANT (i.e., combat participant), not country or province scope. Beginners often directly use it within if blocks in country scope, causing script errors or the condition to always return false. Ensure it is used within combat_event or the correct combat context.
  2. Mistaking it Works Against Ground Combat: This trigger is designed exclusively for carrier-based aircraft and will never return true in land battle scenarios even if the syntax is correct. Without pairing with terrain filtering, related logic will never trigger, and this fundamental constraint is easily overlooked during troubleshooting.