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
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.