From f76c01614e1e311e61ab86b7233c2b5b3c2e2cbd Mon Sep 17 00:00:00 2001 From: mamoniot Date: Mon, 12 Dec 2022 08:24:34 -0500 Subject: [PATCH 1/4] switched to linux --- .vscode/launch.json | 6 ++++-- .vscode/settings.json | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1add307..ecb900b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,7 @@ "type": "factoriomod", "request": "launch", "name": "Factorio Mod Debug", - "modsPath": "C:\\Users\\mmoni\\AppData\\Roaming\\Factorio\\mods", + "modsPath": "~/.factorio/mods/", "manageMod": true, "adjustMods": { "debugadapter": true, @@ -22,7 +22,7 @@ "type": "factoriomod", "request": "launch", "name": "Factorio Mod Debug (Modded)", - "modsPath": "C:\\Users\\mmoni\\AppData\\Roaming\\Factorio\\mods", + "modsPath": "~/.factorio/mods/", "manageMod": true, "adjustMods": { "debugadapter": true, @@ -35,6 +35,7 @@ "type": "factoriomod", "request": "launch", "name": "Factorio Mod Debug (Settings & Data)", + "modsPath": "~/.factorio/mods/", "hookSettings": true, "hookData": true, "adjustMods": { @@ -48,6 +49,7 @@ "type": "factoriomod", "request": "launch", "name": "Factorio Mod Debug (Profile)", + "modsPath": "~/.factorio/mods/", "hookMode": "profile", "adjustMods": { "debugadapter": true, diff --git a/.vscode/settings.json b/.vscode/settings.json index bdf94f1..1e378a7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "factorio.versions": [ { "name": "Steam", - "factorioPath": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Factorio\\bin\\x64\\factorio.exe", + "factorioPath": "~/.steam/steam/steamapps/common/Factorio/bin/x64/factorio", "active": true } ], @@ -19,8 +19,8 @@ ], "Lua.runtime.version": "Lua 5.2", "Lua.workspace.library": [ - "c:\\Program Files (x86)\\Steam\\steamapps\\common\\Factorio\\data", - "c:\\Program Files (x86)\\Steam\\steamapps\\common\\Factorio\\data\\core\\lualib", - ".vscode/factorio" + "~/.steam/steam/steamapps/common/Factorio/data", + "~/.steam/steam/steamapps/common/Factorio/data/core/lualib", + "./.vscode/factorio" ] } From 71b21c9b3cf218972597db0c303021b5fba531eb Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 16 Dec 2022 09:51:59 -0500 Subject: [PATCH 2/4] added nullius compat --- .vscode/settings.json | 3 + TODO | 3 +- cybersyn/changelog.txt | 6 ++ cybersyn/data-final-fixes.lua | 5 +- cybersyn/locale/en/base.cfg | 6 +- cybersyn/prototypes/tech.lua | 30 ++++----- cybersyn/scripts/central-planning.lua | 2 +- cybersyn/scripts/factorio-api.lua | 92 +++++++++++++++------------ cybersyn/scripts/gui.lua | 2 +- cybersyn/scripts/main.lua | 20 +++--- cybersyn/scripts/remote-interface.lua | 6 +- cybersyn/scripts/train-events.lua | 6 +- 12 files changed, 104 insertions(+), 77 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e378a7..f3ebc38 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,8 @@ "~/.steam/steam/steamapps/common/Factorio/data", "~/.steam/steam/steamapps/common/Factorio/data/core/lualib", "./.vscode/factorio" + ], + "Lua.workspace.userThirdParty": [ + "/home/mami/.config/Code/User/workspaceStorage/9536dbf0665a54126a4b0958ecd5829f/justarandomgeek.factoriomod-debug/sumneko-3rd" ] } diff --git a/TODO b/TODO index 253d011..16aecf9 100644 --- a/TODO +++ b/TODO @@ -2,10 +2,9 @@ bugs: request threshold is being bypassed somehow (hasn't been seen in a long time) major: - do hardcore testing models & art - add a refueling option on depots move to an event based algorithm + debug output minor: railloader compat diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index b973149..d19acad 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.5 +Date: 2022-12-16 + Changes: + - Added Nullius compat + - Replaced lost train alert with more detailed alerts +--------------------------------------------------------------------------------------------------- Version: 1.1.4 Date: 2022-12-9 Changes: diff --git a/cybersyn/data-final-fixes.lua b/cybersyn/data-final-fixes.lua index 486175d..8c16e75 100644 --- a/cybersyn/data-final-fixes.lua +++ b/cybersyn/data-final-fixes.lua @@ -1,8 +1,9 @@ + if mods["nullius"] then -- Place combinator in the same subgroup as the regular train stop data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup -- Nullius makes modded technologies part of its research tree - -- Place combinator in the same place on the research tree as LTN + -- Place combinator in the same place on the research tree as LTN table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") -end \ No newline at end of file +end diff --git a/cybersyn/locale/en/base.cfg b/cybersyn/locale/en/base.cfg index 5725f19..c076410 100644 --- a/cybersyn/locale/en/base.cfg +++ b/cybersyn/locale/en/base.cfg @@ -44,10 +44,14 @@ cybersyn-locked-slots=Locked slots per cargo wagon [cybersyn-messages] missing-trains=Could not find a train to make a delivery from __2__ to __1__ -lost-train=A train from depot __1__ has become lost nonempty-train=A train is being held in the depot because it still has cargo unexpected-train=A train has unexpectedly returned to the depot before completing its delivery stuck-train=A train from depot __1__ is stuck +cannot-path-between-surfaces=A train from depot __1__ is attempting to make a delivery between two unconnected surfaces, perhaps put them on separate networks +depot-broken=A train from depot __1__ is lost because its depot was broken. +refueler-broken=A train from depot __1__ is lost because its refueler was broken. +station-broken=A train from depot __1__ is lost because one of its delivery stations was broken. +train-at-incorrect=A train from depot __1__ is lost; it parked at a station it was not scheduled to delivered to. [cybersyn-gui] combinator-title=Cybernetic combinator diff --git a/cybersyn/prototypes/tech.lua b/cybersyn/prototypes/tech.lua index dffedec..a2776ce 100644 --- a/cybersyn/prototypes/tech.lua +++ b/cybersyn/prototypes/tech.lua @@ -5,27 +5,13 @@ combinator_recipe.ingredients = { {"electronic-circuit", 10}, } combinator_recipe.enabled = false -if (mods["nullius"]) then - -- Enable recipe and place it just after regular station - combinator_recipe.order = "nullius-eca" - -- In Nullius, most combinators are tiny crafts - combinator_recipe.category = "tiny-crafting" - combinator_recipe.always_show_made_in = true - -- Use the same costs (minus the train stop) as for LTN - combinator_recipe.energy_required = 3 - combinator_recipe.ingredients = { - {"arithmetic-combinator", 2}, - {"green-wire", 4} - } -end - cybersyn_tech = flib.copy_prototype(data.raw["technology"]["automated-rail-transportation"], "cybersyn-train-network") cybersyn_tech.icon = "__cybersyn__/graphics/icons/tech.png" cybersyn_tech.icon_size = 256 cybersyn_tech.prerequisites = { - "automated-rail-transportation", + "rail-signals", "circuit-network", } cybersyn_tech.effects = { @@ -37,14 +23,24 @@ cybersyn_tech.effects = { cybersyn_tech.unit.count = 3*cybersyn_tech.unit.count cybersyn_tech.order = "c-g-c" + if (mods["nullius"]) then + -- Enable recipe and place it just after regular station + combinator_recipe.order = "nullius-eca" + -- In Nullius, most combinators are tiny crafts + combinator_recipe.category = "tiny-crafting" + combinator_recipe.always_show_made_in = true + combinator_recipe.energy_required = 3 + combinator_recipe.ingredients = { + {"arithmetic-combinator", 2}, + {"copper-cable", 10} + } -- Enable technology cybersyn_tech.order = "nullius-" .. (cybersyn_tech.order or "") cybersyn_tech.unit = { count = 100, ingredients = { - { "nullius-geology-pack", 1 }, { "nullius-climatology-pack", 1 }, - { "nullius-mechanical-pack", 1 }, { "nullius-electrical-pack", 1 } + {"nullius-geology-pack", 1}, {"nullius-climatology-pack", 1}, {"nullius-mechanical-pack", 1}, {"nullius-electrical-pack", 1} }, time = 25 } diff --git a/cybersyn/scripts/central-planning.lua b/cybersyn/scripts/central-planning.lua index b41ece5..a8e49ec 100644 --- a/cybersyn/scripts/central-planning.lua +++ b/cybersyn/scripts/central-planning.lua @@ -533,7 +533,7 @@ local function tick_poll_comb(map_data) tick_data.last_comb = comb_id if comb and comb.valid then - combinator_update(map_data, comb) + combinator_update(map_data, comb, true) end end ---@param map_data MapData diff --git a/cybersyn/scripts/factorio-api.lua b/cybersyn/scripts/factorio-api.lua index 66c9569..21e10f7 100644 --- a/cybersyn/scripts/factorio-api.lua +++ b/cybersyn/scripts/factorio-api.lua @@ -137,7 +137,7 @@ function set_manifest_schedule(train, depot_name, d_surface_i, p_stop, r_stop, m local is_r_on_t = t_surface_i == r_surface_i local is_d_on_t = t_surface_i == d_surface_i if is_p_on_t and is_r_on_t and is_d_on_t then - train.schedule = {current = start_at_depot and 1 or 2, records = { + train.schedule = {current = start_at_depot and 1 or 2--[[@as uint]], records = { create_inactivity_order(depot_name), create_direct_to_station_order(p_stop), create_loading_order(p_stop, manifest), @@ -153,8 +153,8 @@ function set_manifest_schedule(train, depot_name, d_surface_i, p_stop, r_stop, m elseif IS_SE_PRESENT then local other_surface_i = (not is_p_on_t and p_surface_i) or (not is_r_on_t and r_surface_i) or d_surface_i if (is_p_on_t or p_surface_i == other_surface_i) and (is_r_on_t or r_surface_i == other_surface_i) and (is_d_on_t or d_surface_i == other_surface_i) then - local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i}) - local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = other_surface_i}) + 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 = other_surface_i})--[[@as {}]] local is_train_in_orbit = other_zone.orbit_index == t_zone.index if is_train_in_orbit or t_zone.orbit_index == other_zone.index then local elevator_name = se_get_space_elevator_name(t_surface) @@ -180,7 +180,7 @@ function set_manifest_schedule(train, depot_name, d_surface_i, p_stop, r_stop, m is_train_in_orbit = not is_train_in_orbit end - train.schedule = {current = start_at_depot and 1 or 2, records = records} + train.schedule = {current = start_at_depot and 1 or 2--[[@as uint]], records = records} if old_schedule and not train.has_path then train.schedule = old_schedule return false @@ -198,7 +198,7 @@ function set_manifest_schedule(train, depot_name, d_surface_i, p_stop, r_stop, m create_unloading_order(r_stop), }} lock_train(train) - send_lost_train_alert(train, depot_name) + send_cannot_path_between_surfaces_alert(train, depot_name) return true end @@ -225,8 +225,8 @@ function add_refueler_schedule(train, stop, depot_name) train.schedule = schedule return elseif IS_SE_PRESENT then - local t_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = t_surface_i}) - local other_zone = remote.call("space-exploration", "get_zone_from_surface_index", {surface_index = f_surface_i}) + 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 is_train_in_orbit = other_zone.orbit_index == t_zone.index if is_train_in_orbit or t_zone.orbit_index == other_zone.index then local elevator_name = se_get_space_elevator_name(t_surface) @@ -252,7 +252,7 @@ function add_refueler_schedule(train, stop, depot_name) --create an order that probably cannot be fulfilled and alert the player table_insert(schedule.records, i, create_inactivity_order(stop.backer_name)) lock_train(train) - send_lost_train_alert(train, depot_name) + send_cannot_path_between_surfaces_alert(train, depot_name) train.schedule = schedule end @@ -457,6 +457,22 @@ end --[[alerts]]-- ------------------------------------------------------------------------------ +---@param train LuaTrain +---@param icon {} +---@param message {} +local function send_alert_with_sound(train, icon, message) + local loco = train.front_stock or train.back_stock + if loco then + for _, player in pairs(loco.force.players) do + player.add_custom_alert( + loco, + icon, + message, + true) + player.play_sound({path = ALERT_SOUND}) + end + end +end local send_missing_train_alert_for_stop_icon = {name = MISSING_TRAIN_NAME, type = "fluid"} ---@param r_stop LuaEntity @@ -474,19 +490,36 @@ end local send_lost_train_alert_icon = {name = LOST_TRAIN_NAME, type = "fluid"} ---@param train LuaTrain ---@param depot_name string -function send_lost_train_alert(train, depot_name) - local loco = train.front_stock or train.back_stock - if loco then - for _, player in pairs(loco.force.players) do - player.add_custom_alert( - loco, - send_lost_train_alert_icon, - {"cybersyn-messages.lost-train", depot_name}, - true) - player.play_sound({path = ALERT_SOUND}) - end - end +function send_cannot_path_between_surfaces_alert(train, depot_name) + send_alert_with_sound(train, send_lost_train_alert_icon, {"cybersyn-messages.cannot-path-between-surfaces", depot_name}) end +---@param train LuaTrain +---@param depot_name string +function send_depot_of_train_broken_alert(train, depot_name) + send_alert_with_sound(train, send_lost_train_alert_icon, {"cybersyn-messages.depot-broken", depot_name}) +end +---@param train LuaTrain +---@param depot_name string +function send_refueler_of_train_broken_alert(train, depot_name) + send_alert_with_sound(train, send_lost_train_alert_icon, {"cybersyn-messages.refueler-broken", depot_name}) +end +---@param train LuaTrain +---@param depot_name string +function send_station_of_train_broken_alert(train, depot_name) + send_alert_with_sound(train, send_lost_train_alert_icon, {"cybersyn-messages.station-broken", depot_name}) +end +---@param train LuaTrain +---@param depot_name string +function send_train_at_incorrect_station_alert(train, depot_name) + send_alert_with_sound(train, send_lost_train_alert_icon, {"cybersyn-messages.train-at-incorrect", depot_name}) +end + +local send_nonempty_train_in_depot_alert_icon = {name = NONEMPTY_TRAIN_NAME, type = "fluid"} +---@param train LuaTrain +function send_nonempty_train_in_depot_alert(train) + send_alert_with_sound(train, send_nonempty_train_in_depot_alert_icon, {"cybersyn-messages.nonempty-train"}) +end + ---@param train LuaTrain function send_unexpected_train_alert(train) local loco = train.front_stock or train.back_stock @@ -500,25 +533,6 @@ function send_unexpected_train_alert(train) end end end - - -local send_nonempty_train_in_depot_alert_icon = {name = NONEMPTY_TRAIN_NAME, type = "fluid"} ----@param train LuaTrain -function send_nonempty_train_in_depot_alert(train) - local loco = train.front_stock or train.back_stock - if loco then - for _, player in pairs(loco.force.players) do - player.add_custom_alert( - loco, - send_nonempty_train_in_depot_alert_icon, - {"cybersyn-messages.nonempty-train"}, - true) - player.play_sound({path = ALERT_SOUND}) - end - end -end - - local send_stuck_train_alert_icon = {name = LOST_TRAIN_NAME, type = "fluid"} ---@param train LuaTrain ---@param depot_name string diff --git a/cybersyn/scripts/gui.lua b/cybersyn/scripts/gui.lua index 3b1e27c..58607b8 100644 --- a/cybersyn/scripts/gui.lua +++ b/cybersyn/scripts/gui.lua @@ -29,7 +29,7 @@ STATUS_NAMES_DEFAULT = "entity-status.disabled" ---@param comb LuaEntity ---@param player LuaPlayer function gui_opened(comb, player) - combinator_update(global, comb) + combinator_update(global, comb, true) local rootgui = player.gui.screen local selected_index, signal, check, switch_state = get_comb_gui_settings(comb) diff --git a/cybersyn/scripts/main.lua b/cybersyn/scripts/main.lua index cbe980d..116f7f3 100644 --- a/cybersyn/scripts/main.lua +++ b/cybersyn/scripts/main.lua @@ -27,7 +27,7 @@ local function on_depot_broken(map_data, depot_id, depot) if train_id then local train = map_data.trains[train_id] lock_train(train.entity) - send_lost_train_alert(train.entity, depot.entity_stop.backer_name) + send_depot_of_train_broken_alert(train.entity, depot.entity_stop.backer_name) remove_train(map_data, train_id, train) end map_data.depots[depot_id] = nil @@ -76,7 +76,7 @@ local function on_refueler_broken(map_data, refueler_id, refueler) if not train.se_is_being_teleported then remove_train(map_data, train_id, train) lock_train(train.entity) - send_lost_train_alert(train.entity, train.depot_name) + send_refueler_of_train_broken_alert(train.entity, train.depot_name) else train.se_awaiting_removal = train_id end @@ -151,7 +151,7 @@ local function on_station_broken(map_data, station_id, station) if not train.se_is_being_teleported then remove_train(map_data, train_id, train) lock_train(train.entity) - send_lost_train_alert(train.entity, train.depot_name) + send_station_of_train_broken_alert(train.entity, train.depot_name) else train.se_awaiting_removal = train_id end @@ -391,7 +391,8 @@ end ---@param map_data MapData ---@param comb LuaEntity -function combinator_update(map_data, comb) +---@param reset_display boolean? +function combinator_update(map_data, comb, reset_display) local unit_number = comb.unit_number--[[@as uint]] local control = get_comb_control(comb) local params = control.parameters @@ -399,7 +400,7 @@ function combinator_update(map_data, comb) local has_changed = false local stop = map_data.to_stop[comb.unit_number] - if stop then + if reset_display and stop then id = stop.unit_number station = map_data.stations[id] if station then @@ -414,7 +415,6 @@ function combinator_update(map_data, comb) control.parameters = params end end - if params.operation == MODE_PRIMARY_IO_ACTIVE or params.operation == MODE_PRIMARY_IO_FAILED_REQUEST then params.operation = MODE_PRIMARY_IO end @@ -652,7 +652,7 @@ local function on_paste(event) if not entity or not entity.valid then return end if entity.name == COMBINATOR_NAME then - combinator_update(global, entity) + combinator_update(global, entity, true) end end @@ -689,8 +689,8 @@ local function setup_se_compat() IS_SE_PRESENT = remote.interfaces["space-exploration"] ~= nil if not IS_SE_PRESENT then return end - local se_on_train_teleport_finished_event = remote.call("space-exploration", "get_on_train_teleport_finished_event") - local se_on_train_teleport_started_event = remote.call("space-exploration", "get_on_train_teleport_started_event") + local se_on_train_teleport_finished_event = remote.call("space-exploration", "get_on_train_teleport_finished_event")--[[@as string]] + local se_on_train_teleport_started_event = remote.call("space-exploration", "get_on_train_teleport_started_event")--[[@as string]] ---@param event {} script.on_event(se_on_train_teleport_started_event, function(event) @@ -742,7 +742,7 @@ local function setup_se_compat() if train.se_awaiting_removal then remove_train(map_data, train.se_awaiting_removal, train) lock_train(train.entity) - send_lost_train_alert(train.entity, train.depot_name) + send_station_of_train_broken_alert(train.entity, train.depot_name) return elseif train.se_awaiting_rename then rename_manifest_schedule(train.entity, train.se_awaiting_rename[1], train.se_awaiting_rename[2]) diff --git a/cybersyn/scripts/remote-interface.lua b/cybersyn/scripts/remote-interface.lua index f1085c5..7828d2e 100644 --- a/cybersyn/scripts/remote-interface.lua +++ b/cybersyn/scripts/remote-interface.lua @@ -348,10 +348,14 @@ interface.add_refueler_schedule = add_refueler_schedule ------------------------------------------------------------------ interface.send_missing_train_alert = send_missing_train_alert -interface.send_lost_train_alert = send_lost_train_alert interface.send_unexpected_train_alert = send_unexpected_train_alert interface.send_nonempty_train_in_depot_alert = send_nonempty_train_in_depot_alert interface.send_stuck_train_alert = send_stuck_train_alert +interface.send_cannot_path_between_surfaces_alert = send_cannot_path_between_surfaces_alert +interface.send_depot_of_train_broken_alert = send_depot_of_train_broken_alert +interface.send_refueler_of_train_broken_alert = send_refueler_of_train_broken_alert +interface.send_station_of_train_broken_alert = send_station_of_train_broken_alert +interface.send_train_at_incorrect_station_alert = send_train_at_incorrect_station_alert remote.add_interface("cybersyn", interface) diff --git a/cybersyn/scripts/train-events.lua b/cybersyn/scripts/train-events.lua index 76ceb42..815a6ef 100644 --- a/cybersyn/scripts/train-events.lua +++ b/cybersyn/scripts/train-events.lua @@ -4,7 +4,7 @@ local INF = math.huge ---@param map_data MapData ---@param station Station ----@param manifest Manifest +---@param manifest Manifest? ---@param sign int? local function set_comb1(map_data, station, manifest, sign) local comb = station.entity_comb1 @@ -238,12 +238,12 @@ local function on_train_arrives_station(map_data, station_id, train_id, train) on_failed_delivery(map_data, train_id, train) remove_train(map_data, train_id, train) lock_train(train.entity) - send_lost_train_alert(train.entity, train.depot_name) + send_train_at_incorrect_station_alert(train.entity, train.depot_name) end elseif mod_settings.react_to_train_at_incorrect_station then --train is lost somehow, probably from player intervention remove_train(map_data, train_id, train) - send_lost_train_alert(train.entity, train.depot_name) + send_train_at_incorrect_station_alert(train.entity, train.depot_name) end end From b5ff50fa54866678e072ed15b69b3aac1ec3270d Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 16 Dec 2022 12:33:10 -0500 Subject: [PATCH 3/4] improved compat --- cybersyn/changelog.txt | 3 ++- cybersyn/info.json | 6 ++++-- cybersyn/prototypes/item.lua | 7 ++++--- cybersyn/prototypes/tech.lua | 17 +++++++++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index d19acad..8d28481 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -2,8 +2,9 @@ Version: 1.1.5 Date: 2022-12-16 Changes: - - Added Nullius compat - Replaced lost train alert with more detailed alerts + - Added Nullius compat + - Added Pyanodon's compat --------------------------------------------------------------------------------------------------- Version: 1.1.4 Date: 2022-12-9 diff --git a/cybersyn/info.json b/cybersyn/info.json index ff96549..c3754a0 100644 --- a/cybersyn/info.json +++ b/cybersyn/info.json @@ -1,6 +1,6 @@ { "name": "cybersyn", - "version": "1.1.4", + "version": "1.1.5", "title": "Project Cybersyn", "author": "Mami", "factorio_version": "1.1", @@ -9,6 +9,8 @@ "base", "flib >= 0.6.0", "? space-exploration >= 0.6.90", - "? miniloader" + "? miniloader", + "? nullius", + "? pypostprocessing" ] } diff --git a/cybersyn/prototypes/item.lua b/cybersyn/prototypes/item.lua index c2bf98d..a14d55a 100644 --- a/cybersyn/prototypes/item.lua +++ b/cybersyn/prototypes/item.lua @@ -3,9 +3,10 @@ combinator_item = flib.copy_prototype(data.raw["item"]["arithmetic-combinator"], combinator_item.icon = "__cybersyn__/graphics/icons/cybernetic-combinator.png" combinator_item.icon_size = 64 combinator_item.icon_mipmaps = 4 -combinator_item.order = data.raw["item"]["decider-combinator"].order.."-b" +combinator_item.subgroup = data.raw["item"]["train-stop"].subgroup +combinator_item.order = data.raw["item"]["train-stop"].order.."-b" combinator_item.place_result = COMBINATOR_NAME -if (mods["nullius"]) then +if mods["nullius"] then -- Enable item in Nullius and place next to the regular train stop combinator_item.order = "nullius-eca" -end \ No newline at end of file +end diff --git a/cybersyn/prototypes/tech.lua b/cybersyn/prototypes/tech.lua index a2776ce..b179b28 100644 --- a/cybersyn/prototypes/tech.lua +++ b/cybersyn/prototypes/tech.lua @@ -5,6 +5,7 @@ combinator_recipe.ingredients = { {"electronic-circuit", 10}, } combinator_recipe.enabled = false +combinator_recipe.subgroup = data.raw["recipe"]["train-stop"].subgroup cybersyn_tech = flib.copy_prototype(data.raw["technology"]["automated-rail-transportation"], "cybersyn-train-network") @@ -20,11 +21,19 @@ cybersyn_tech.effects = { recipe = COMBINATOR_NAME }, } -cybersyn_tech.unit.count = 3*cybersyn_tech.unit.count +cybersyn_tech.unit.ingredients = { + { "automation-science-pack", 1, }, + { "logistic-science-pack", 1, } +} +cybersyn_tech.unit.count = 200 cybersyn_tech.order = "c-g-c" -if (mods["nullius"]) then +if mods["pypostprocessing"] then + cybersyn_tech.unit.ingredients[2] = nil +end + +if mods["nullius"] then -- Enable recipe and place it just after regular station combinator_recipe.order = "nullius-eca" -- In Nullius, most combinators are tiny crafts @@ -36,7 +45,7 @@ if (mods["nullius"]) then {"copper-cable", 10} } -- Enable technology - cybersyn_tech.order = "nullius-" .. (cybersyn_tech.order or "") + cybersyn_tech.order = "nullius-"..cybersyn_tech.order cybersyn_tech.unit = { count = 100, ingredients = { @@ -44,6 +53,6 @@ if (mods["nullius"]) then }, time = 25 } - cybersyn_tech.prerequisites = { "nullius-checkpoint-optimization", "nullius-traffic-control" } + cybersyn_tech.prerequisites = {"nullius-checkpoint-optimization", "nullius-traffic-control"} cybersyn_tech.ignore_tech_tech_cost_multiplier = true end From 32ab7af464322a5f23f88da0a56201b87e4f5ad8 Mon Sep 17 00:00:00 2001 From: mamoniot Date: Fri, 16 Dec 2022 12:33:43 -0500 Subject: [PATCH 4/4] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ddef2ec..d3272cf 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ If you like my work, consider supporting me on [ko-fi](https://ko-fi.com/lesbian ## Mod Details -This mod adds a single new entity to the game, the cybernetic combinator. This combinator can be in one of 4 different possible control modes. While each mode has a purpose, the only modes you have to use are primary station control and depot control. +This mod adds a single new entity to the game, the cybernetic combinator. This combinator can be in one of 5 different possible control modes. While each mode has a purpose, the only modes you have to use are primary station control and depot control. ### Station mode