Wiki

trigger · has_flanked_opponent

Definition

  • Supported scope:COMBATANT
  • Supported target:none

Description

check if side has flanked their opponent

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

has_flanked_opponent is commonly used in combat events or battle modifier mods to determine whether one side has successfully executed a flanking maneuver, thereby triggering additional combat bonuses, combat log events, or unlocking specific commander traits. For example, you can check in a combat-related event's trigger conditions whether the attacker has completed a flank, and subsequently grant morale or casualty modifiers.

# Combat event: trigger additional effects when flank succeeds
combat_event = {
    id = my_mod.1
    trigger = {
        is_attacker = yes
        has_flanked_opponent = yes
        is_winning = yes
    }
    # event body ...
}

Synergy

  • [is_attacker](/wiki/trigger/is_attacker) — Flanking tactics are typically initiated by the active attacking side; combining with this condition restricts the scope to the attacking side and prevents the defending side from unexpectedly satisfying the condition.
  • [is_winning](/wiki/trigger/is_winning) — A successful flank often coexists with battlefield advantage; using both together provides a more precise description of the "envelopment with superiority" battlefield state.
  • [recon_advantage](/wiki/trigger/recon_advantage) — Reconnaissance advantage is a prerequisite for executing a flank; combined use constructs more militarily-sound composite condition checks.
  • [less_combat_width_than_opponent](/wiki/trigger/less_combat_width_than_opponent) — The side with width disadvantage is more likely to be flanked; combining with has_flanked_opponent can be used to assess dangerous situations of numerical inferiority under encirclement.

Common Pitfalls

  1. Scope mixing: This trigger only works within COMBATANT scope. Beginners often use it directly in regular country scope conditions (such as focus or decision blocks), causing script errors or perpetually returning false. You must ensure you are within a combat event or combat-related combatant scope.
  2. Mistaking it for an active flank trigger: has_flanked_opponent is merely a state-checking trigger that reads the flank result already calculated by the game engine; you cannot use scripting to "force" one side to successfully flank, nor can it be used as an effect. Beginners sometimes misuse it as an effect or expect it to change combat outcomes.