Skip to content

Seablock compatiblity for factorio 2.0 #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c406eb2
Changed factorio version and added migration for stone-crushed
elvanaud May 4, 2025
f5230d6
Replaced 'hidden' flag by property hidden and added some warning mess…
elvanaud May 4, 2025
02dc91d
data - Fixed ScienceCostTweaker compatiblity
elvanaud May 4, 2025
71f12c4
data - Renamed base game techs and bob-stuff
elvanaud May 4, 2025
8469418
data - Renamed technologies and fixed some changes in the tech tree
elvanaud May 4, 2025
df2f5d3
Fixed new ingredient format and renamed bob-stuff
elvanaud May 4, 2025
56e63b3
prototypes - technology: fixed 2.0 tech and renamed bob-stuff
elvanaud May 4, 2025
5876ae1
Renamed bob-stuff for starting items
elvanaud May 4, 2025
688570e
data-updates - fixed compatibility for mods: SpaceMod, clowns, Companion
elvanaud May 4, 2025
0d36b27
data-updates - fixed compatibility for science cost tweaker
elvanaud May 4, 2025
5cb7e0e
data-updates - renamed bob stuff
elvanaud May 4, 2025
5a0e33a
data-updates - military.lua - renamed bob-stuff
elvanaud May 4, 2025
ca7de07
data-updates - misc.lua - renamed bob-stuff
elvanaud May 4, 2025
c3458dd
data-updates - fixed fluid boxes
elvanaud May 4, 2025
1202908
data-updates - renamed bob stuff
elvanaud May 4, 2025
543934f
data-final-fixes - SpaceMod compatibility
elvanaud May 4, 2025
31dc169
data-final-fixes - renamed bob-stuff
elvanaud May 4, 2025
899b2bf
Fixed control.lua and remote.lua
elvanaud May 4, 2025
581f59e
Basic mapgen for 2.0
elvanaud May 4, 2025
6a01ce4
Fixed spacemod integration and missing bob-prefix
elvanaud May 4, 2025
5d81e2f
Fixed thermal extractor fluid box and locale
elvanaud May 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions SeaBlock/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ end
function seablock.create_rock_chest(surface, pos)
local has_items = false

if global.starting_items and (not game.is_multiplayer()) then
for item, quantity in pairs(global.starting_items) do
if storage.starting_items and (not game.is_multiplayer()) then
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
has_items = true
break
Expand All @@ -23,7 +23,7 @@ function seablock.create_rock_chest(surface, pos)

if has_items then
local chest = surface.create_entity({ name = "rock-chest", position = pos, force = game.forces.neutral })
for item, quantity in pairs(global.starting_items) do
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
chest.insert({ name = item, count = quantity })
end
Expand All @@ -32,9 +32,9 @@ function seablock.create_rock_chest(surface, pos)
end

function seablock.have_item(player, itemname, crafted)
local unlock = global.unlocks[itemname]
local unlock = storage.unlocks[itemname]
-- Special case for basic-circuit because it is part of starting equipment
if unlock and (itemname ~= "basic-circuit-board" or crafted) then
if unlock and (itemname ~= "bob-basic-circuit-board" or crafted) then
for _, v in ipairs(unlock) do
if player.force.technologies[v] then
player.force.technologies[v].researched = true
Expand All @@ -51,20 +51,20 @@ end

local function init()
set_pvp()
global.starting_items = seablock.populate_starting_items(game.item_prototypes)
storage.starting_items = seablock.populate_starting_items(prototypes.item)
if remote.interfaces.freeplay then
if remote.interfaces.freeplay.set_disable_crashsite then
remote.call("freeplay", "set_disable_crashsite", true)
end
end
global.unlocks = {
storage.unlocks = {
["angels-ore3-crushed"] = { "sb-startup1", "bio-wood-processing" },
["basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
["bob-basic-circuit-board"] = { "sb-startup3", "sct-lab-t1" },
}
if game.technology_prototypes["sct-automation-science-pack"] then
global.unlocks["lab"] = { "sct-automation-science-pack" }
if prototypes.technology["sct-automation-science-pack"] then
storage.unlocks["lab"] = { "sct-automation-science-pack" }
else
global.unlocks["lab"] = { "sb-startup4" }
storage.unlocks["lab"] = { "sb-startup4" }
end

if remote.interfaces["freeplay"] then
Expand Down Expand Up @@ -130,7 +130,7 @@ script.on_event(defines.events.on_player_main_inventory_changed, function(e)
if not inv then -- Compatibility with BlueprintLab_Bud17
return
end
for k, v in pairs(global.unlocks) do
for k, v in pairs(storage.unlocks) do
for _, v2 in ipairs(v) do
if
player.force.technologies[v2]
Expand All @@ -153,13 +153,13 @@ script.on_configuration_changed(function(cfg)
force.reset_recipes()
for tech_name, tech in pairs(force.technologies) do
if tech.researched then
for tech_name, effect in pairs(tech.effects) do
for tech_name, effect in pairs(tech.prototype.effects) do
if effect.type == "unlock-recipe" then
force.recipes[effect.recipe].enabled = true
end
end
end
if game.technology_prototypes[tech_name].enabled then
if prototypes.technology[tech_name].enabled then
force.technologies[tech_name].enabled = true
end
end
Expand All @@ -183,9 +183,9 @@ script.on_load(function()
end)

script.on_event(defines.events.on_player_created, function(e)
if global.starting_items and game.is_multiplayer() then
if storage.starting_items and game.is_multiplayer() then
local inv = game.players[e.player_index].get_main_inventory()
for item, quantity in pairs(global.starting_items) do
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
inv.insert({ name = item, count = quantity })
end
Expand Down Expand Up @@ -222,9 +222,9 @@ script.on_load(function()
end)

script.on_event(defines.events.on_player_created, function(e)
if global.starting_items and game.is_multiplayer() then
if storage.starting_items and game.is_multiplayer() then
local inv = game.players[e.player_index].get_main_inventory()
for item, quantity in pairs(global.starting_items) do
for item, quantity in pairs(storage.starting_items) do
if quantity > 0 then
inv.insert({ name = item, count = quantity })
end
Expand Down
9 changes: 5 additions & 4 deletions SeaBlock/data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ for _, v in pairs(reactors) do
end

-- Refresh circuit board icon as it may have been overwritten
if data.raw.tool["sb-basic-circuit-board-tool"] and data.raw.item["basic-circuit-board"] then
seablock.lib.copy_icon(data.raw.tool["sb-basic-circuit-board-tool"], data.raw.item["basic-circuit-board"])
end
-- if data.raw.tool["sb-basic-circuit-board-tool"] and data.raw.item["bob-basic-circuit-board"] then
-- seablock.lib.copy_icon(data.raw.tool["sb-basic-circuit-board-tool"], data.raw.item["bob-basic-circuit-board"])
-- end

require("data-final-fixes/logistics")
require("data-final-fixes/icons")
Expand All @@ -30,6 +30,7 @@ require("data-final-fixes/unobtainable_items")
require("data-final-fixes/mapgen")
require("data-final-fixes/SpaceMod")


data.raw.recipe["copper-cable"].allow_decomposition = true
data.raw.recipe["paper-bleaching-1"].allow_decomposition = true

Expand All @@ -39,4 +40,4 @@ for _, v in pairs(data.raw.character) do
end
end

bobmods.lib.tech.prerequisite_cleanup()
seablock.lib.removeingredient("automation-science-pack", "bob-glass") -- For some reason it isn't removed earlier
12 changes: 6 additions & 6 deletions SeaBlock/data-final-fixes/SpaceMod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ local upgrades = {
["bob-construction-robot-4"] = "bob-construction-robot-5",
-- CircuitProcessing replaces module-3 with module-4, so SpaceMod data-final-fixes
-- doesn't find the modules it's expecting.
["speed-module-4"] = "speed-module-8",
["effectivity-module-4"] = "effectivity-module-8",
["productivity-module-4"] = "productivity-module-8",
["fusion-reactor-equipment-4"] = "fusion-reactor-equipment-4", -- for amount adjustment
["bob-speed-module-4"] = "bob-speed-module-5",
["bob-efficiency-module-4"] = "bob-efficiency-module-5",
["bob-productivity-module-4"] = "bob-productivity-module-5",
["bob-fission-reactor-equipment-4"] = "bob-fission-reactor-equipment-4", -- for amount adjustment
}

local function iterateingredients(recipe, func)
Expand Down Expand Up @@ -112,7 +112,7 @@ local function doupgrade(ingredients)
end
if upgrade == "bob-construction-robot-5" then
item[amountidx] = 1
elseif upgrade == "fusion-reactor-equipment-4" then
elseif upgrade == "bob-fission-reactor-equipment-4" then
item[amountidx] = item[amountidx] / 2
end
end
Expand All @@ -133,7 +133,7 @@ if data.raw.technology["ftl-theory-D"] then
end

if mods["bobtech"] then
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "advanced-logistic-science-pack", 1)
bobmods.lib.tech.add_science_pack("ftl-theory-D2", "bob-advanced-logistic-science-pack", 1)
bobmods.lib.tech.remove_prerequisite("ftl-theory-D1", "ftl-theory-D")
bobmods.lib.tech.add_prerequisite("ftl-theory-D1", "ftl-theory-C")
bobmods.lib.tech.add_prerequisite("ftl-theory-D2", "ftl-theory-D")
Expand Down
56 changes: 28 additions & 28 deletions SeaBlock/data-final-fixes/logistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ local function set_speed(type, name, speed)
end
end

set_speed("transport-belt", "basic-transport-belt", 7.5)
set_speed("underground-belt", "basic-underground-belt", 7.5)
set_speed("splitter", "basic-splitter", 7.5)
set_speed("transport-belt", "bob-basic-transport-belt", 7.5)
set_speed("underground-belt", "bob-basic-underground-belt", 7.5)
set_speed("splitter", "bob-basic-splitter", 7.5)

set_speed("transport-belt", "transport-belt", 15)
set_speed("underground-belt", "underground-belt", 15)
Expand All @@ -23,31 +23,31 @@ set_speed("transport-belt", "express-transport-belt", 45)
set_speed("underground-belt", "express-underground-belt", 45)
set_speed("splitter", "express-splitter", 45)

set_speed("transport-belt", "turbo-transport-belt", 60)
set_speed("underground-belt", "turbo-underground-belt", 60)
set_speed("splitter", "turbo-splitter", 60)
set_speed("transport-belt", "bob-turbo-transport-belt", 60)
set_speed("underground-belt", "bob-turbo-underground-belt", 60)
set_speed("splitter", "bob-turbo-splitter", 60)

set_speed("transport-belt", "ultimate-transport-belt", 75)
set_speed("underground-belt", "ultimate-underground-belt", 75)
set_speed("splitter", "ultimate-splitter", 75)
set_speed("transport-belt", "bob-ultimate-transport-belt", 75)
set_speed("underground-belt", "bob-ultimate-underground-belt", 75)
set_speed("splitter", "bob-ultimate-splitter", 75)

-- Increase energy consumption of bob's extra beacons
-- Also reduce module slots and effectivity
if data.raw.beacon["beacon-2"] then
data.raw.beacon["beacon-2"].energy_usage = "960kW"
data.raw.beacon["beacon-2"].module_specification.module_slots = 2
data.raw.beacon["beacon-2"].distribution_effectivity = 0.5
if data.raw.beacon["bob-beacon-2"] then
data.raw.beacon["bob-beacon-2"].energy_usage = "960kW"
data.raw.beacon["bob-beacon-2"].module_slots = 2
data.raw.beacon["bob-beacon-2"].distribution_effectivity = 0.5
end
if data.raw.beacon["beacon-3"] then
data.raw.beacon["beacon-3"].energy_usage = "1920kW"
data.raw.beacon["beacon-3"].module_specification.module_slots = 2
data.raw.beacon["beacon-3"].distribution_effectivity = 0.5
if data.raw.beacon["bob-beacon-3"] then
data.raw.beacon["bob-beacon-3"].energy_usage = "1920kW"
data.raw.beacon["bob-beacon-3"].module_slots = 2
data.raw.beacon["bob-beacon-3"].distribution_effectivity = 0.5
end

-- Undo boblogistcs changes to logistic system research
bobmods.lib.tech.add_new_science_pack("logistic-system", "production-science-pack", 1)
if data.raw.tool["advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack("logistic-system", "advanced-logistic-science-pack", 1)
if data.raw.tool["bob-advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack("logistic-system", "bob-advanced-logistic-science-pack", 1)
else
bobmods.lib.tech.add_new_science_pack("logistic-system", "utility-science-pack", 1)
end
Expand All @@ -66,8 +66,8 @@ for _, v in pairs(logisticstechs) do
bobmods.lib.tech.add_new_science_pack(v, "production-science-pack", 1)
bobmods.lib.tech.add_new_science_pack(v, "utility-science-pack", 1)

if data.raw.tool["advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack(v, "advanced-logistic-science-pack", 1)
if data.raw.tool["bob-advanced-logistic-science-pack"] then
bobmods.lib.tech.add_new_science_pack(v, "bob-advanced-logistic-science-pack", 1)
end
end
end
Expand All @@ -81,16 +81,16 @@ bobmods.lib.tech.add_prerequisite("logistic-system-2", "utility-science-pack")
-- No logistics chest at green science level.
local function revertchests(tech)
local neweffects = {
{ type = "unlock-recipe", recipe = "logistic-chest-passive-provider" },
{ type = "unlock-recipe", recipe = "logistic-chest-storage" },
{ type = "unlock-recipe", recipe = "passive-provider-chest" },
{ type = "unlock-recipe", recipe = "storage-chest" },
}
for k, v in pairs(tech.effects) do
if
v.type ~= "unlock-recipe"
or (
v.recipe ~= "logistic-chest-passive-provider"
and v.recipe ~= "logistic-chest-storage"
and v.recipe ~= "logistic-chest-requester"
v.recipe ~= "passive-provider-chest"
and v.recipe ~= "storage-chest"
and v.recipe ~= "requester-chest"
)
then
table.insert(neweffects, v)
Expand All @@ -102,14 +102,14 @@ revertchests(data.raw.technology["logistic-robotics"])
revertchests(data.raw.technology["construction-robotics"])
local found = false
for k, v in pairs(data.raw.technology["logistic-system"].effects) do
if v.type == "unlock-recipe" and v.recipe == "logistic-chest-requester" then
if v.type == "unlock-recipe" and v.recipe == "requester-chest" then
found = true
end
end
if not found then
table.insert(
data.raw.technology["logistic-system"].effects,
{ type = "unlock-recipe", recipe = "logistic-chest-requester" }
{ type = "unlock-recipe", recipe = "requester-chest" }
)
end

Expand Down
52 changes: 50 additions & 2 deletions SeaBlock/data-final-fixes/mapgen.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
-- No resource placement
for k, v in pairs(data.raw.resource) do
v.autoplace = nil
-- if v.autoplace then
-- data.raw.resource[k].autoplace.default_enabled = false
-- end
end

-- log("HELLO")
-- log(serpent.block(data.raw["planet"]["nauvis"].map_gen_settings))
data.raw["planet"]["nauvis"].map_gen_settings.autoplace_settings = {
tile = {
settings = {
deepwater = {},
water = {},
["sand-4"] = {},
-- ["sand-5"] = {},
}
},
entity = {
settings = {
["desert-garden"] = {},
["temperate-garden"] = {},
["swamp-garden"] = {},

["desert-tree"] = {},
["temperate-tree"] = {},
["swamp-tree"] = {},
}
}
}
data.raw["planet"]["nauvis"].map_gen_settings.autoplace_controls = nil


-- No spawners
for k, v in pairs(data.raw["unit-spawner"]) do
v.autoplace = nil
v.control = nil
-- v.control = nil
if v.autoplace then
v.autoplace.default_enabled = false
end
end

-- No trees
Expand All @@ -22,15 +54,28 @@ for k, v in pairs(data.raw.tree) do
then
v.autoplace = nil
seablock.lib.add_flag("tree", v.name, "not-deconstructable")
else
v.autoplace.control = nil
end
end

-- No rocks
for k, v in pairs(data.raw["simple-entity"]) do
v.autoplace = nil
-- if v.autoplace then
-- v.autoplace.default_enabled = false
-- end
seablock.lib.add_flag("simple-entity", v.name, "not-deconstructable")
end

for k, v in pairs(data.raw["optimized-decorative"]) do
v.autoplace = nil
-- if v.autoplace then
-- v.autoplace.default_enabled = false
-- end
seablock.lib.add_flag("optimized-decorative", v.name, "not-deconstructable")
end

local keepcontrols = {}
local turrets = data.raw["turret"]
for turret_name, turret in pairs(turrets) do
Expand All @@ -39,10 +84,13 @@ for turret_name, turret in pairs(turrets) do
end
end

--keepcontrols["angels-fissure"] = true

local controls = data.raw["autoplace-control"]
for k, v in pairs(controls) do
if k ~= "enemy-base" and not keepcontrols[k] then
controls[k] = nil
-- data.raw["autoplace-control"][k].hidden = true
data.raw["autoplace-control"][k] = nil
end
end

Expand Down
8 changes: 4 additions & 4 deletions SeaBlock/data-final-fixes/recipe.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Revert massive buff of insulated wire recipe
bobmods.lib.recipe.set_energy_required("insulated-cable", 2)
seablock.lib.substingredient("insulated-cable", "tinned-copper-cable", nil, 8)
seablock.lib.substingredient("insulated-cable", "rubber", nil, 8)
bobmods.lib.recipe.set_result("insulated-cable", { "insulated-cable", 8 })
bobmods.lib.recipe.set_energy_required("bob-insulated-cable", 2)
seablock.lib.substingredient("bob-insulated-cable", "tinned-copper-cable", nil, 8)
seablock.lib.substingredient("bob-insulated-cable", "rubber", nil, 8)
bobmods.lib.recipe.set_result("bob-insulated-cable", { type = "item", name = "insulated-cable", amount = 8 })

-- Combine Stone and Crushed Stone
local function replace_stone(recipe)
Expand Down
Loading