trigger · skill_advantage
Definition
- Supported scope:
COMBATANT - Supported target:
none
Description
compare leader skill levels
skill_advantageCOMBATANTnonecompare leader skill levels
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
skill_advantage 常用于 AI 或事件脚本中,根据交战双方指挥官技能差距来触发特殊战斗事件或调整战术决策,例如在"名将系统"类 mod 中为技能占优的一方触发士气加成事件。也可用于战斗相关的 limit 块,仅当己方指挥官综合技能高于对手时才允许触发某个战术机动选项。
# 当己方指挥官技能占优时触发特殊战斗事件
combat_event = {
id = my_mod.101
trigger = {
is_attacker = yes
skill_advantage > 2
is_winning = no # 虽然技能占优但暂时落后,更有戏剧张力
}
...
}
[skill](/wiki/trigger/skill) —— skill 用于检查指挥官的绝对技能值,与 skill_advantage 的相对差值比较形成互补,可同时限定"己方技能够高且相对占优"两个条件。[is_attacker](/wiki/trigger/is_attacker) / [is_defender](/wiki/trigger/is_defender) —— 进攻方和防守方在战斗中的技能优势意义不同,通常需要先区分阵营角色再判断技能差距。[is_winning](/wiki/trigger/is_winning) —— 与胜负状态结合使用,可区分"技能占优但仍在落败"这类反常情况,用于触发翻盘类事件。[has_trait](/wiki/trigger/has_trait) —— 当指挥官技能占优且同时拥有特定特质时,才激活高阶战术奖励,让技能系统与特质系统协同生效。skill_advantage 来判断指挥官的"绝对技能是否足够高",但该 trigger 比较的是双方技能的差值,若双方技能都很高但相差无几,结果可能为负或接近零——此时应改用 [skill](/wiki/trigger/skill) 做绝对值判断。skill_advantage 只在 COMBATANT scope(即战斗中的交战方)下有效,若将其写在普通国家 scope 或角色 scope 的条件块中,脚本会静默失效或报错,务必确认触发环境处于正在进行的战斗上下文中。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.
skill_advantage is commonly used in AI or event scripts to trigger special combat events or adjust tactical decisions based on the skill gap between opposing commanders. For example, in "famous general system" style mods, it can trigger morale bonus events for the side with superior skills. It can also be used in combat-related limit blocks to permit certain tactical maneuver options only when your commander's combined skill exceeds the opponent's.
# Trigger special combat event when your commander has skill advantage
combat_event = {
id = my_mod.101
trigger = {
is_attacker = yes
skill_advantage > 2
is_winning = no # Has skill advantage but temporarily behind, more dramatic tension
}
...
}
[skill](/wiki/trigger/skill) —— skill checks the commander's absolute skill value, forming a complement to skill_advantage's relative difference comparison. Both conditions can be used together to enforce "your skill is high enough AND relatively superior."[is_attacker](/wiki/trigger/is_attacker) / [is_defender](/wiki/trigger/is_defender) —— The significance of skill advantage differs between attacker and defender in combat. Usually you need to distinguish faction roles first before evaluating skill gaps.[is_winning](/wiki/trigger/is_winning) —— When combined with victory/defeat status, it helps identify anomalous situations like "skill advantage yet still losing," useful for triggering comeback events.[has_trait](/wiki/trigger/has_trait) —— High-tier tactical rewards activate only when the commander has skill advantage AND simultaneously possesses specific traits, allowing the skill system and trait system to synergize.skill_advantage to judge whether a commander's "absolute skill is high enough," but this trigger compares the difference between both sides' skills. If both commanders have high skills but differ little, the result may be negative or near zero—in such cases, use [skill](/wiki/trigger/skill) for absolute value checks instead.skill_advantage only works in COMBATANT scope (i.e., belligerents in active combat). If placed in condition blocks under normal country scope or character scope, the script will silently fail or error. Always ensure the trigger environment is in an active combat context.