trigger · longest_war_length
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Check number of months the country has been at war
longest_war_lengthCOUNTRYnoneCheck number of months the country has been at war
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
longest_war_length 常用于判断某国是否已深陷持久战,从而触发"战争疲劳"类事件、解锁特定决策或改变 AI 行为倾向。例如,当一个国家连续交战超过若干个月时,可以允许某项媾和外交选项变为可用:
# 在某个决策的 available 块中使用
available = {
longest_war_length > 24 # 该国已连续交战超过 24 个月
has_war_support < 0.4
}
[has_defensive_war](/wiki/trigger/has_defensive_war) — 常与 longest_war_length 联用,区分"被动防御性持久战"与主动进攻战,使触发条件更精准。[has_war_support](/wiki/trigger/has_war_support)(注:has_war_support 不在白名单,改用下方替代)[has_bombing_war_support](/wiki/trigger/has_bombing_war_support) — 长期战争往往伴随战争支持度下滑,两者组合可还原真实疲战逻辑。[casualties_k](/wiki/trigger/casualties_k) — 伤亡数与战争持续时长共同衡量战争烈度,双重门槛能更准确筛选出"消耗战"情形。[add_war_support](/wiki/effect/add_war_support) — 确认条件满足后,通过此 effect 给予战争支持度惩罚或补偿,形成"时间越长 → 支持度变化"的完整逻辑闭环。days_since_capitulated)的习惯,错误地填入天数数值,造成条件永远不满足或过早触发。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.
longest_war_length is commonly used to determine whether a country is caught in prolonged conflict, thereby triggering "war fatigue" events, unlocking specific decisions, or altering AI behavioral tendencies. For example, when a nation has been continuously at war for more than a certain number of months, you can make a specific peace negotiation option available:
# Use within the available block of a decision
available = {
longest_war_length > 24 # This country has been at war continuously for more than 24 months
has_war_support < 0.4
}
[has_defensive_war](/wiki/trigger/has_defensive_war) — Frequently paired with longest_war_length to distinguish between "passive defensive prolonged warfare" and active offensive warfare, making trigger conditions more precise.[has_war_support](/wiki/trigger/has_war_support) (Note: has_war_support is not whitelisted; use the alternative below) [has_bombing_war_support](/wiki/trigger/has_bombing_war_support) — Extended warfare typically coincides with declining war support; combining these two captures realistic war fatigue mechanics.[casualties_k](/wiki/trigger/casualties_k) — Casualty count and war duration together measure conflict intensity; dual thresholds allow more accurate identification of "attrition warfare" scenarios.[add_war_support](/wiki/effect/add_war_support) — Once conditions are confirmed, apply this effect to penalize or compensate war support, creating a complete logical loop of "longer duration → war support change."days_since_capitulated), erroneously inputting day values, causing conditions to never trigger or trigger prematurely.