mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 02:08:11 -06:00
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -24,6 +24,7 @@
|
|||||||
"./.vscode/factorio"
|
"./.vscode/factorio"
|
||||||
],
|
],
|
||||||
"Lua.workspace.userThirdParty": [
|
"Lua.workspace.userThirdParty": [
|
||||||
"/home/mami/.config/Code/User/workspaceStorage/9536dbf0665a54126a4b0958ecd5829f/justarandomgeek.factoriomod-debug/sumneko-3rd"
|
"/home/mami/.config/Code/User/workspaceStorage/9536dbf0665a54126a4b0958ecd5829f/justarandomgeek.factoriomod-debug/sumneko-3rd",
|
||||||
|
"/home/mami/.config/Code/User/workspaceStorage/fdae937c5189f993d370b36f3104188f/justarandomgeek.factoriomod-debug/sumneko-3rd"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
21
TODO
21
TODO
@@ -1,19 +1,32 @@
|
|||||||
bugs:
|
bugs:
|
||||||
https://mods.factorio.com/mod/cybersyn/discussion/63a52e54be4341bccc0446f8
|
https://mods.factorio.com/mod/cybersyn/discussion/63afff871c9e44028b2acab8
|
||||||
|
https://mods.factorio.com/mod/cybersyn/discussion/63af6ed2f532e8870d639157
|
||||||
|
|
||||||
major:
|
major:
|
||||||
debug output
|
debug output
|
||||||
add in game guide
|
add in game guide
|
||||||
|
gui-based system readout:
|
||||||
|
absolute count of unfulfilled requests
|
||||||
|
item count of unfulfilled requests
|
||||||
|
absolute count of available provides (is this even possible without a provide threshold?)
|
||||||
|
item count of available provides
|
||||||
|
system log
|
||||||
|
check out LTN addons that do this for inspiration
|
||||||
move to an event based algorithm
|
move to an event based algorithm
|
||||||
models & art
|
models & art
|
||||||
|
|
||||||
minor:
|
minor:
|
||||||
|
check if necessary entities can be destroyed without raising events
|
||||||
|
improve the behavior of trains if players intervene during deliveries
|
||||||
handle if signals are removed from the game during migration
|
handle if signals are removed from the game during migration
|
||||||
update wagon control combinators immediately upon placement
|
update wagon control combinators immediately upon placement
|
||||||
railloader compat
|
|
||||||
deadlocks signals compat
|
|
||||||
close gui when the combinator is destroyed
|
close gui when the combinator is destroyed
|
||||||
do not play close sound when a different gui is opened
|
do not play close sound when a different gui is opened
|
||||||
gui can desync if settings are changed outside of it while it is open
|
gui can desync if settings are changed outside of it while it is open
|
||||||
give the combinators a sensible reaction to low or no power
|
give the combinators a sensible reaction to low or no power
|
||||||
picker dollies compat?
|
|
||||||
|
compat:
|
||||||
|
train upgrader mod
|
||||||
|
deadlocks signals
|
||||||
|
railloader
|
||||||
|
picker dollies?
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 1.2.6
|
||||||
|
Date: 2022-12-30
|
||||||
|
Bugfixes:
|
||||||
|
- Fixed a crash when deconstructing the connected rail of a station
|
||||||
|
- Improved the stability of migrations
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 1.2.5
|
Version: 1.2.5
|
||||||
Date: 2022-12-30
|
Date: 2022-12-30
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cybersyn",
|
"name": "cybersyn",
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"title": "Project Cybersyn",
|
"title": "Project Cybersyn",
|
||||||
"author": "Mami",
|
"author": "Mami",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
|
|||||||
@@ -169,6 +169,29 @@ end
|
|||||||
---@param start_at_depot boolean?
|
---@param start_at_depot boolean?
|
||||||
function set_manifest_schedule(map_data, train, depot_stop, same_depot, p_stop, p_enable_inactive, r_stop, r_enable_inactive, manifest, start_at_depot)
|
function set_manifest_schedule(map_data, train, depot_stop, same_depot, p_stop, p_enable_inactive, r_stop, r_enable_inactive, manifest, start_at_depot)
|
||||||
--NOTE: can only return false if start_at_depot is false, it should be incredibly rare that this function returns false
|
--NOTE: can only return false if start_at_depot is false, it should be incredibly rare that this function returns false
|
||||||
|
if not p_stop.connected_rail or not r_stop.connected_rail then
|
||||||
|
--NOTE: create a schedule that cannot be fulfilled, the train will be stuck but it will give the player information what went wrong
|
||||||
|
train.schedule = {current = 1, records = {
|
||||||
|
create_inactivity_order(depot_stop.backer_name),
|
||||||
|
create_loading_order(p_stop, manifest, p_enable_inactive),
|
||||||
|
create_unloading_order(r_stop, r_enable_inactive),
|
||||||
|
}}
|
||||||
|
lock_train(train)
|
||||||
|
send_alert_station_of_train_broken(map_data, train)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
if same_depot and not depot_stop.connected_rail then
|
||||||
|
--NOTE: create a schedule that cannot be fulfilled, the train will be stuck but it will give the player information what went wrong
|
||||||
|
train.schedule = {current = 1, records = {
|
||||||
|
create_inactivity_order(depot_stop.backer_name),
|
||||||
|
create_loading_order(p_stop, manifest, p_enable_inactive),
|
||||||
|
create_unloading_order(r_stop, r_enable_inactive),
|
||||||
|
}}
|
||||||
|
lock_train(train)
|
||||||
|
send_alert_depot_of_train_broken(map_data, train)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
local old_schedule
|
local old_schedule
|
||||||
if not start_at_depot then
|
if not start_at_depot then
|
||||||
old_schedule = train.schedule
|
old_schedule = train.schedule
|
||||||
@@ -269,6 +292,11 @@ function add_refueler_schedule(map_data, train, stop)
|
|||||||
schedule.current = i
|
schedule.current = i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not stop.connected_rail then
|
||||||
|
send_alert_refueler_of_train_broken(map_data, train)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local t_surface = train.front_stock.surface
|
local t_surface = train.front_stock.surface
|
||||||
local f_surface = stop.surface
|
local f_surface = stop.surface
|
||||||
local t_surface_i = t_surface.index
|
local t_surface_i = t_surface.index
|
||||||
@@ -279,7 +307,7 @@ function add_refueler_schedule(map_data, train, stop)
|
|||||||
table_insert(schedule.records, i, create_inactivity_order(stop.backer_name))
|
table_insert(schedule.records, i, create_inactivity_order(stop.backer_name))
|
||||||
|
|
||||||
train.schedule = schedule
|
train.schedule = schedule
|
||||||
return
|
return true
|
||||||
elseif IS_SE_PRESENT then
|
elseif IS_SE_PRESENT then
|
||||||
local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i})--[[@as {}]]
|
local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i})--[[@as {}]]
|
||||||
local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = f_surface_i})--[[@as {}]]
|
local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = f_surface_i})--[[@as {}]]
|
||||||
@@ -302,7 +330,7 @@ function add_refueler_schedule(map_data, train, stop)
|
|||||||
end
|
end
|
||||||
|
|
||||||
train.schedule = schedule
|
train.schedule = schedule
|
||||||
return
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--create an order that probably cannot be fulfilled and alert the player
|
--create an order that probably cannot be fulfilled and alert the player
|
||||||
|
|||||||
@@ -161,21 +161,23 @@ local migrations_table = {
|
|||||||
settings.global["cybersyn-invert-sign"] = setting
|
settings.global["cybersyn-invert-sign"] = setting
|
||||||
|
|
||||||
for id, comb in pairs(map_data.to_comb) do
|
for id, comb in pairs(map_data.to_comb) do
|
||||||
local control = get_comb_control(comb)
|
if comb.valid then
|
||||||
local params = control.parameters
|
local control = get_comb_control(comb)
|
||||||
local params_old = map_data.to_comb_params[id]
|
local params = control.parameters
|
||||||
local bits = params.second_constant or 0
|
local params_old = map_data.to_comb_params[id]
|
||||||
local bits_old = params_old.second_constant or 0
|
local bits = params.second_constant or 0
|
||||||
|
local bits_old = params_old.second_constant or 0
|
||||||
|
|
||||||
bits = bit32.replace(bits, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
|
bits = bit32.replace(bits, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
|
||||||
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
||||||
bits_old = bit32.replace(bits_old, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
|
bits_old = bit32.replace(bits_old, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
|
||||||
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
||||||
params.second_constant = bits
|
params.second_constant = bits
|
||||||
params_old.second_constant = bits_old
|
params_old.second_constant = bits_old
|
||||||
|
|
||||||
control.parameters = params
|
control.parameters = params
|
||||||
map_data.to_comb_params[id] = params_old
|
map_data.to_comb_params[id] = params_old
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for _, station in pairs(map_data.stations) do
|
for _, station in pairs(map_data.stations) do
|
||||||
station.enable_inactive = true
|
station.enable_inactive = true
|
||||||
@@ -239,19 +241,21 @@ local migrations_table = {
|
|||||||
settings.global["cybersyn-invert-sign"] = setting
|
settings.global["cybersyn-invert-sign"] = setting
|
||||||
|
|
||||||
for id, comb in pairs(map_data.to_comb) do
|
for id, comb in pairs(map_data.to_comb) do
|
||||||
local control = get_comb_control(comb)
|
if comb.valid then
|
||||||
local params = control.parameters
|
local control = get_comb_control(comb)
|
||||||
local params_old = map_data.to_comb_params[id]
|
local params = control.parameters
|
||||||
local bits = params.second_constant or 0
|
local params_old = map_data.to_comb_params[id]
|
||||||
local bits_old = params_old.second_constant or 0
|
local bits = params.second_constant or 0
|
||||||
|
local bits_old = params_old.second_constant or 0
|
||||||
|
|
||||||
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
||||||
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
|
||||||
params.second_constant = bits
|
params.second_constant = bits
|
||||||
params_old.second_constant = bits_old
|
params_old.second_constant = bits_old
|
||||||
|
|
||||||
control.parameters = params
|
control.parameters = params
|
||||||
map_data.to_comb_params[id] = params_old
|
map_data.to_comb_params[id] = params_old
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for train_id, train in pairs(map_data.trains) do
|
for train_id, train in pairs(map_data.trains) do
|
||||||
train.use_any_depot = true
|
train.use_any_depot = true
|
||||||
|
|||||||
@@ -355,13 +355,14 @@ local function on_train_leaves_stop(map_data, mod_settings, train_id, train)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if best_refueler_id then
|
if best_refueler_id then
|
||||||
train.status = STATUS_TO_F
|
|
||||||
train.refueler_id = best_refueler_id
|
|
||||||
local refueler = map_data.refuelers[best_refueler_id]
|
local refueler = map_data.refuelers[best_refueler_id]
|
||||||
refueler.trains_total = refueler.trains_total + 1
|
if add_refueler_schedule(map_data, train.entity, refueler.entity_stop) then
|
||||||
add_refueler_schedule(map_data, train.entity, refueler.entity_stop)
|
train.status = STATUS_TO_F
|
||||||
interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_F)
|
train.refueler_id = best_refueler_id
|
||||||
return
|
refueler.trains_total = refueler.trains_total + 1
|
||||||
|
interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_F)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user