Checks for an existing rail connection. Uses same params as can_build_railway. Example:
has_railway_connection = {
build_only_on_allied = yes # No by default. If yes and the effect scope is country, it will only build on allied territories for the country
# The following options are used for picking a path. You can specify multiple options and it will pick in following order:
fallback = yes # Default no. If yes, each option will try to fallback to next one.
# option 1: List of provinces to draw railways. If fallback = yes uses start and end provinces of the path as fallback in option 2.
path = { 10 20 30 40 }
# option 2: Specify start & end province IDs. It will pick the shortest path. If provinces are not valid and if fallback = yes it will use states of those provs and use in option 3.
start_province = 42
target_province = 84
# option 3: Specify start & end state IDs. It will pick provinces with the best node (capital > nodes > naval )
start_state = 50
target_state = 100
}
实战 · 配合 · 坑
实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。
实战用法
has_railway_connection 常用于 mod 中判断两地之间是否已有铁路相连,从而控制某些决议、科技或事件的可用条件——例如只有在本国核心省份之间铁路贯通后才能触发工业化事件。也可用于 AI 策略逻辑,在补给线相关判断中验证前线与后方的铁路联通状态。