trigger · has_flanked_opponent
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
check if side has flanked their opponent
has_flanked_opponentCOMBATANTnonecheck if side has flanked their opponent
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
has_flanked_opponent 常用于战斗事件或战斗修正 mod 中,用来判断某一方是否成功实施了侧翼包抄,从而触发额外的战斗加成、战斗日志事件或特定将领 trait 的解锁条件。例如,可以在战斗相关 event 的触发条件中判断进攻方是否已完成侧翼,进而给予士气或伤亡修正。
# 战斗事件:侧翼成功时触发额外效果
combat_event = {
id = my_mod.1
trigger = {
is_attacker = yes
has_flanked_opponent = yes
is_winning = yes
}
# event body ...
}
[is_attacker](/wiki/trigger/is_attacker) — 侧翼战术通常由主动进攻方发起,配合此条件可将判断范围限定在进攻侧,避免防守方也意外满足条件。[is_winning](/wiki/trigger/is_winning) — 侧翼成功往往与战场优势并存,两者联用可更精确地描述"包抄且占优"的战场状态。[recon_advantage](/wiki/trigger/recon_advantage) — 侦察优势是实施侧翼的前提之一,配合使用可构建更符合军事逻辑的复合条件判断。[less_combat_width_than_opponent](/wiki/trigger/less_combat_width_than_opponent) — 宽度劣势方被侧翼的概率更高,与 has_flanked_opponent 组合可用于判断兵力劣势且遭受包抄的危险情形。COMBATANT scope 下有效,新手常在普通国家 scope(country scope)的 focus 或 decision 条件块中直接使用,导致脚本报错或永远返回 false,必须确保处于战斗事件或战斗相关的 combatant scope 内。has_flanked_opponent 只是一个状态检测 trigger,它读取游戏内部已经计算好的侧翼结果,无法通过写脚本来"强制"让某方侧翼成功,新手有时会误将其当作 effect 来使用或期望靠它改变战斗结果。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.
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 ...
}
[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.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.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.