trigger · surrender_progress
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
check if a country is close to surrendering
surrender_progressCOUNTRYnonecheck if a country is close to surrendering
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
surrender_progress 常用于判断某国是否濒临投降,以便触发特殊外交事件或决议——例如在目标国即将崩溃时允许玩家发出最后通牒、签署停战协议,或在 AI 逻辑中让盟国判断是否值得继续增援。典型场景包括战争结束类 mod 事件的触发条件、以及和平谈判系统中的门槛检测。
# 当目标国投降进度达到一定程度时,触发停战提案事件
country_event = {
id = my_mod.100
trigger = {
any_enemy_country = {
surrender_progress > 0.5
}
}
}
[has_capitulated](/wiki/trigger/has_capitulated):surrender_progress 检测"趋势",has_capitulated 检测"结果",二者配合可构建从"濒临投降"到"已投降"的完整状态链判断。[any_enemy_country](/wiki/trigger/any_enemy_country):通常需要将 scope 切换到敌国,再在其内部调用 surrender_progress,二者几乎是固定搭档。[alliance_strength_ratio](/wiki/trigger/alliance_strength_ratio):同时检测敌方投降进度与双方战力比,可更精确地评估战争走向,避免单一数值误判。[create_wargoal](/wiki/effect/create_wargoal):在确认敌国已处于高投降进度后,适时生成新战争目标,扩大战果,形成"条件判断→施压行动"的完整逻辑闭环。surrender_progress 只在该国处于战争状态且存在实际战争压力时才会返回有意义的值;对未参战国使用时数值通常为 0,条件永远不会满足,导致逻辑静默失效而难以察觉。surrender_progress < 0.5 意图筛选"快要投降"的国家,但实际上该值越高代表越接近投降,应使用 > 0.5 才能正确捕捉濒临崩溃的状态。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.
surrender_progress is commonly used to determine whether a country is on the brink of capitulation, enabling the triggering of special diplomatic events or decisions—for example, allowing the player to issue ultimatums as the target nation nears collapse, negotiate armistices, or enabling AI logic for allies to evaluate whether continued reinforcement is worthwhile. Typical scenarios include trigger conditions for war-ending mod events and threshold detection in peace negotiation systems.
# Trigger an armistice proposal event when the target country's surrender progress reaches a certain threshold
country_event = {
id = my_mod.100
trigger = {
any_enemy_country = {
surrender_progress > 0.5
}
}
}
[has_capitulated](/wiki/trigger/has_capitulated): surrender_progress detects the "trend," while has_capitulated detects the "outcome." Together they construct a complete state chain from "on the verge of surrender" to "already capitulated."[any_enemy_country](/wiki/trigger/any_enemy_country): Typically requires switching scope to enemy countries, then invoking surrender_progress within that scope. These two are nearly inseparable partners.[alliance_strength_ratio](/wiki/trigger/alliance_strength_ratio): Simultaneously checking enemy surrender progress and both sides' military strength ratio allows more precise assessment of war trajectory, avoiding misjudgment from relying on a single metric.[create_wargoal](/wiki/effect/create_wargoal): After confirming the enemy is in a high surrender progress state, timely creation of new war goals expands victory and forms a complete logical loop of "condition check → pressure action."surrender_progress only returns meaningful values when the country is at war with actual military pressure; using it on uninvolved nations typically returns 0, causing conditions to never trigger and logic to silently fail undetected.surrender_progress < 0.5 intending to filter "about to surrender" nations, but in fact higher values indicate closer proximity to capitulation. Use > 0.5 instead to correctly capture states approaching collapse.