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
has_carrier_airwings_in_own_combatCOMBATANTnoneCheck if carrier has airplanes that are part of the current combat
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
在涉及航母作战的 mod 中,此 trigger 常用于为航母战斗群设计专属的战斗事件或决策,例如当航母上的舰载机正在参与当前海战时触发特殊战斗修正或叙事事件。也可用于限定某些 trait 或战斗指令仅在舰载机实际投入战斗时才生效,避免在无舰载机参战时错误激活相关逻辑。
# 航母战斗事件:舰载机参战时触发特殊对话
combat_event = {
id = my_mod.carrier_combat.1
trigger = {
is_attacker = yes
has_carrier_airwings_in_own_combat = yes
is_fighting_in_terrain = sea
}
...
}
[has_carrier_airwings_on_mission](/wiki/trigger/has_carrier_airwings_on_mission):两者常并列使用,前者判断舰载机是否在当前战斗中,后者判断舰载机是否正在执行任务,组合可精确区分舰载机的不同参与状态。[is_attacker](/wiki/trigger/is_attacker) / [is_defender](/wiki/trigger/is_defender):配合区分进攻或防御方的航母是否出动舰载机,用于为攻防双方设置不同的战斗加成或事件条件。[has_combat_modifier](/wiki/trigger/has_combat_modifier):在确认舰载机参战后,进一步检查当前是否已存在某个战斗修正,避免重复叠加 modifier 导致数值异常。[is_fighting_in_terrain](/wiki/trigger/is_fighting_in_terrain):与之搭配确保该逻辑只在海洋地形战斗中生效,防止在内陆战斗场景下误触发航母相关判断。COMBATANT(即战斗参与方),而非国家或省份 scope。新手容易在国家 scope 的 if 块中直接使用它,导致脚本报错或判断永远为假,需确保在 combat_event 或正确的战斗上下文中使用。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.
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
}
...
}
[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.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.