trigger · any_war_score
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
compares the warscore of all wars in a country to see if any fullfills the comparison condition 0-100 - Example: any_war_score > 40
any_war_scoreCOUNTRYnonecompares the warscore of all wars in a country to see if any fullfills the comparison condition 0-100 - Example: any_war_score > 40
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
any_war_score 常用于判断某国是否在任意一场战争中占据优势,从而触发外交事件、开放选项或调整 AI 战略。例如可用于"当己方在至少一场战争中战绩超过 60 分时,才允许提出和平谈判的决策"。
# 在 decision/focus 的 available 块中:判断是否有一场战争战绩超过 60
available = {
has_war = yes
any_war_score > 60
}
也可结合事件触发:当战绩不佳时阻止选项激活:
trigger = {
has_war = yes
any_war_score < 20
has_war_support < 0.4
}
any_war_score 只在交战状态下有意义,通常先用 has_war = yes 确保国家处于战争中,再检查战绩数值,避免逻辑错误。has_war 前置保护:当国家未处于任何战争时,any_war_score 的行为未定义或直接返回假,若不先检查 has_war = yes 就直接比较数值,逻辑可能出现静默失效,条件块永远不满足却难以排查原因。any_war_score > 0.6),导致条件永远无法命中。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.
any_war_score is commonly used to check whether a country holds an advantage in at least one ongoing war, enabling diplomatic events, unlocking options, or adjusting AI strategy. A typical use case is "allow a peace negotiation decision only when the country's war score exceeds 60 in at least one war."
# Inside a decision/focus available block: check whether war score exceeds 60 in any war
available = {
has_war = yes
any_war_score > 60
}
It can also be used in event triggers to block an option from activating when the war is going poorly:
trigger = {
has_war = yes
any_war_score < 20
has_war_support < 0.4
}
any_war_score is only meaningful while a country is at war. Always guard with has_war = yes first before checking the score value to avoid silent logic errors.has_war guard: When a country is not involved in any war, any_war_score is either undefined or evaluates to false outright. Comparing the value without first checking has_war = yes can cause silent failures where the condition block never evaluates to true yet is difficult to debug.any_war_score > 0.6), causing the condition to never match.