关于钢铁雄心4中国工业疏散只拆不建bug的分析
直接说结论工厂数的变量未事先声明,故原文件在调用变量当场声明时,处在state下,故声明为state变量,故在应转移的state无此变量,缺省值为零,故不建。
应将几个变量声明为全局变量,例如global.af_to_move。另外原版的0.75也是个大坑,我就不详细说了,那段直接删掉吧。
附修改结果
remove_effect = {
if = {
limit = {
controls_state = 283
}
283 = { #283 #gansu
set_variable = {
var = global.af_level
value = arms_factory_level
}
set_variable = {
var = global.af_to_move
value = arms_factory_level
}
set_variable = {
var = global.ic_level
value = industrial_complex_level
}
set_variable = {
var = global.ic_to_move
value = industrial_complex_level
}
custom_effect_tooltip = CHI_industrial_evacuations_remove_AF
custom_effect_tooltip = CHI_industrial_evacuations_remove_IC
hidden_effect = {
remove_building = {
type = arms_factory
level = global.af_level
}
remove_building = {
type = industrial_complex
level = global.ic_level
}
}
#Move AF
CONTROLLER = {
random_owned_controlled_state = {
prioritize = { 605 603 601 }
limit = {
is_fully_controlled_by = ROOT
free_building_slots = {
building = arms_factory
size > 2
include_locked = yes
}
}
custom_effect_tooltip = CHI_industrial_evacuations_add_AF
hidden_effect = {
add_extra_state_shared_building_slots = global.af_to_move
add_building_construction = {
type = arms_factory
level = global.af_to_move
instant_build = yes
}
CONTROLLER = { set_country_flag = CHI_industrial_evacuations_moved_AF }
}
}
#If no states are really safe or all safe are filled
#Move to random controlled state
if = {
limit = {
NOT = { has_country_flag = CHI_industrial_evacuations_moved_AF }
NOT = {
any_state = {
is_fully_controlled_by = ROOT
free_building_slots = {
building = arms_factory
size > 2
include_locked = yes
}
}
}
}
random_owned_controlled_state = {
prioritize = { 605 603 601 }
limit = {
is_controlled_by = ROOT
free_building_slots = {
building = arms_factory
size > 2
include_locked = yes
}
}
custom_effect_tooltip = CHI_industrial_evacuations_add_AF
hidden_effect = {
add_extra_state_shared_building_slots = global.af_to_move
add_building_construction = {
type = arms_factory
level = global.af_to_move
instant_build = yes
}
}
}
}
clr_country_flag = CHI_industrial_evacuations_moved_AF
#Move IC
random_owned_controlled_state = {
prioritize = { 605 603 601 }
limit = {
is_fully_controlled_by = ROOT
free_building_slots = {
building = industrial_complex
size > 2
include_locked = yes
}
}
custom_effect_tooltip = CHI_industrial_evacuations_add_IC
hidden_effect = {
add_extra_state_shared_building_slots = global.ic_to_move
add_building_construction = {
type = industrial_complex
level = global.ic_to_move
instant_build = yes
}
CONTROLLER = { set_country_flag = CHI_industrial_evacuations_moved_IC }
}
}
#If no states are really safe or all safe are filled
#Move to random controlled state
if = {
limit = {
NOT = { has_country_flag = CHI_industrial_evacuations_moved_IC }
NOT = {
any_state = {
is_fully_controlled_by = ROOT
free_building_slots = {
building = industrial_complex
size > 2
include_locked = yes
}
}
}
}
random_owned_controlled_state = {
prioritize = { 605 603 601 }
limit = {
is_controlled_by = ROOT
free_building_slots = {
building = industrial_complex
size > 2
include_locked = yes
}
}
custom_effect_tooltip = CHI_industrial_evacuations_add_IC
hidden_effect = {
add_extra_state_shared_building_slots = global.ic_to_move
add_building_construction = {
type = industrial_complex
level = global.ic_to_move
instant_build = yes
}
}
}
}
clr_country_flag = CHI_industrial_evacuations_moved_IC
}
}
}
}
页:
[1]