effect · set_border_war_data
Definition
- Supported scope:
any - Supported target:
none
Description
update border war properties
set_border_war_dataanynoneupdate border war properties
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
set_border_war_data 用于在边境战争进行中动态调整其参数,例如修改交战双方的兵力上限、进攻方向或战场宽度等属性,适合在剧本事件或决议中根据战局演变调整边境冲突的规则。常见场景包括:玩家做出外交决策后通过事件选项调整边境战争强度,或在定时事件中根据双方实力差异平衡战场数值。
# 在某事件选项中调整边境战争数据
option = {
name = border_war_event.1.a
set_border_war_data = {
attacker_modifier = {
attack = 0.1
}
defender_modifier = {
defense = -0.1
}
}
}
[has_border_war_between](/wiki/trigger/has_border_war_between):在执行 set_border_war_data 前用此触发器验证两国之间确实存在边境战争,避免在无效状态下执行指令导致报错或静默失败。[start_border_war](/wiki/effect/start_border_war):通常先用 start_border_war 发起边境战争,随后再用 set_border_war_data 对刚建立的战争进行初始参数微调。[finalize_border_war](/wiki/effect/finalize_border_war):边境战争结束流程的配套指令,set_border_war_data 负责过程调整,finalize_border_war 负责结算收尾,两者共同构成完整的边境冲突生命周期管理。[cancel_border_war](/wiki/effect/cancel_border_war):当需要强制终止并清除边境战争时与之形成对比使用,确保开发者在"修改"还是"取消"之间做出明确选择。set_border_war_data 不会报错但完全无效,务必先用 [has_border_war_between](/wiki/trigger/has_border_war_between) 做条件检查,将指令包裹在 [if](/wiki/effect/if) 块内。set_border_war_data 的属性中需要明确指定交战双方,若 scope 层级混乱(例如在 country scope 内未正确引用边境战争的 attacker/defender),参数将无法正确写入,调试时应善用 [log](/wiki/effect/log) 输出当前 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.
set_border_war_data is used to dynamically adjust border war parameters during an ongoing conflict, such as modifying troop limits for both sides, attack directions, or battlefield width. It's ideal for adjusting border conflict rules based on evolving tactical situations within scripted events or decisions. Common scenarios include: adjusting border war intensity through event options after a player makes a diplomatic decision, or balancing battlefield values in timed events based on relative military strength.
# Adjust border war data within an event option
option = {
name = border_war_event.1.a
set_border_war_data = {
attacker_modifier = {
attack = 0.1
}
defender_modifier = {
defense = -0.1
}
}
}
[has_border_war_between](/wiki/trigger/has_border_war_between): Use this trigger before executing set_border_war_data to verify that a border war actually exists between the two nations, preventing command execution in invalid states that could cause errors or silent failures.[start_border_war](/wiki/effect/start_border_war): Typically initiate a border war with start_border_war first, then use set_border_war_data to fine-tune initial parameters for the newly established conflict.[finalize_border_war](/wiki/effect/finalize_border_war): The companion command for border war resolution. set_border_war_data handles in-process adjustments while finalize_border_war handles settlement and cleanup, together forming a complete border conflict lifecycle management system.[cancel_border_war](/wiki/effect/cancel_border_war): Use in contrast when you need to forcibly terminate and clear a border war, ensuring developers make an explicit choice between "modify" and "cancel".set_border_war_data will not error but will be completely ineffective. Always perform a condition check using [has_border_war_between](/wiki/trigger/has_border_war_between) first, wrapping the command within an [if](/wiki/effect/if) block.set_border_war_data attributes require explicitly specifying both combatants. If scope hierarchy is confused (for example, failing to correctly reference the border war's attacker/defender from within a country scope), parameters will not write correctly. When debugging, use [log](/wiki/effect/log) to output the current scope state for investigation.