Skip to content

Added Landblock setting, No Ores Setting, and No Trees/Rock Setting #297

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3746937
Added a setting for Landblock mode
zerostarm Feb 23, 2023
b74d045
Added If statement for Landblock-mode
zerostarm Feb 23, 2023
1df05cb
Fixed Name of setting
zerostarm Feb 23, 2023
fd35c4e
Found last mapgen bit and updated En Locale
zerostarm Feb 23, 2023
8f7e347
Added no trees and no minerals modes
zerostarm Feb 23, 2023
2e16f34
Added more if's for No Minerals setting
zerostarm Feb 23, 2023
adb4abc
got the mineral and no trees working not landblock
zerostarm Feb 24, 2023
c0123f7
fixed Landblock mode
zerostarm Feb 24, 2023
5de1815
Rocks part of Tree setting now works
zerostarm Feb 24, 2023
b19352f
Added stuff to the minerals mode so that minerals are mineable
zerostarm Feb 24, 2023
4f20c82
Updated Locale to have mod setting descriptions
zerostarm Feb 24, 2023
d3926fb
Changing how the No minerals items were removed
zerostarm Feb 25, 2023
08c2d41
Fixed a bug
zerostarm Feb 25, 2023
d0e17cb
Fixed no minerals modes items
zerostarm Feb 25, 2023
06fa55e
Added one more recipe to no minerals mode
zerostarm Feb 25, 2023
72059cf
Changed Landblock mode to have autoplace controls for gardens and trees
zerostarm Mar 16, 2023
bf3dab5
Added CargoShips Specific Deep Oil Settings and Bugfix
zerostarm Jun 24, 2023
ee20e5a
Added Settings stuff for deep oil from Cargo Ships mod
zerostarm Jun 24, 2023
2747549
Finished Adding Pumpjacks to the Cargo Ships Setting
zerostarm Jun 24, 2023
a7efc5a
I think i fixed the naming of deep oil
zerostarm Jun 24, 2023
6b8dbb2
Added another exception for pumpjacks and deep oil
zerostarm Jun 25, 2023
08e0921
Milestones mod compatibility #292
KiwiHawk Jul 14, 2023
8dc70b6
Format Code
KiwiHawk Jul 14, 2023
6748817
Rename pack mod #306
KiwiHawk Jul 14, 2023
d2eb502
Updating mod version number and date
KiwiHawk Jul 14, 2023
e744907
Merge branch 'modded-factorio:main' into main
zerostarm Jul 15, 2023
24f558a
update to 0.5.13
zerostarm Jul 15, 2023
4395eb3
Merge branch 'LandblockMode'
zerostarm Jul 15, 2023
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
5 changes: 5 additions & 0 deletions SeaBlock/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.13
Date: 14.07.2023
Changes:
- Milestones mod compatibility #292
---------------------------------------------------------------------------------------------------
Version: 0.5.12
Date: 01.01.2023
Changes:
Expand Down
124 changes: 93 additions & 31 deletions SeaBlock/data-final-fixes/mapgen.lua
Original file line number Diff line number Diff line change
@@ -1,55 +1,117 @@
-- No resource placement
for k, v in pairs(data.raw.resource) do
v.autoplace = nil
end

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

-- No trees
for k, v in pairs(data.raw.tree) do
if
k ~= "temperate-garden"
and k ~= "desert-garden"
and k ~= "swamp-garden"
and k ~= "temperate-tree"
and k ~= "desert-tree"
and k ~= "swamp-tree"
and k ~= "puffer-nest"
then
--header

--Resource Control
if settings.startup["No-minerals-mode-setting"].value == true then
--No Resource placement execpt deep oil from cargo ships
if settings.startup["Cargo-ships-deep-oil-setting"].value == true then
for k, v in pairs(data.raw.resource) do
if k ~= "deep_oil" then
v.autoplace = nil
end
end
else -- No resource placement
for k, v in pairs(data.raw.resource) do
v.autoplace = nil
end
end
end

if settings.startup["No-trees-mode-setting"].value == true then
-- No trees
for k, v in pairs(data.raw.tree) do
if
k ~= "temperate-garden"
and k ~= "desert-garden"
and k ~= "swamp-garden"
and k ~= "temperate-tree"
and k ~= "desert-tree"
and k ~= "swamp-tree"
and k ~= "puffer-nest"
then
v.autoplace = nil
seablock.lib.add_flag("tree", v.name, "not-deconstructable")
end
end

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

if settings.startup["Landblock-mode-Seablock-setting"].value == false then
-- No spawners
for k, v in pairs(data.raw["unit-spawner"]) do
v.autoplace = nil
seablock.lib.add_flag("tree", v.name, "not-deconstructable")
v.control = nil
end
end

-- No rocks
for k, v in pairs(data.raw["simple-entity"]) do
v.autoplace = nil
seablock.lib.add_flag("simple-entity", v.name, "not-deconstructable")
end
--if settings.startup["Landblock-mode-Seablock-setting"].value == true then

--else

local keepcontrols = {}
local turrets = data.raw["turret"]
for turret_name, turret in pairs(turrets) do
if turret.autoplace and turret.autoplace.control then
keepcontrols[turret.autoplace.control] = true
end
end

if settings.startup["Landblock-mode-Seablock-setting"].value == true then
local enem = data.raw["unit-spawner"]
for enemies_name, turret in pairs(enem) do
if turret.autoplace and turret.autoplace.control then
keepcontrols[turret.autoplace.control] = true
end
end

keepcontrols["angels-biter-slider"] = true

end

if settings.startup["No-minerals-mode-setting"].value == false then
local resources = data.raw["resource"]
for resource_name, turret in pairs(resources) do
if turret.autoplace and turret.autoplace.control then
keepcontrols[turret.autoplace.control] = true
end
end
end

if settings.startup["No-trees-mode-setting"].value == false then
local trees = data.raw["tree"]
for tree_name, turret in pairs(trees) do
if turret.autoplace and turret.autoplace.control then
keepcontrols[turret.autoplace.control] = true
keepcontrols[turret.autoplace.control] = true
end
end

local trees = data.raw["simple-entity"]
for tree_name, turret in pairs(trees) do
if turret.autoplace and turret.autoplace.control then
keepcontrols[turret.autoplace.control] = true
end
end

end

local controls = data.raw["autoplace-control"]
--if settings.startup["No-minerals-mode-setting"].value == true then
--if settings.startup["No-trees-mode-setting"].value == true then
for k, v in pairs(controls) do
if k ~= "enemy-base" and not keepcontrols[k] then
controls[k] = nil
controls[k] = nil
end
end


local presets = data.raw["map-gen-presets"]["default"]
for k, v in pairs(presets) do
-- Check for order as this is a manditory property for a MapGenPreset (so we skip type and name)
if k ~= "default" and k ~= "marathon" and v.order then
data.raw["map-gen-presets"]["default"][k] = nil
end
end
end
163 changes: 158 additions & 5 deletions SeaBlock/data-final-fixes/unobtainable_items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end

-- Recipes to unconditionally remove
local removerecipes = {}
for _, v in ipairs({
local recipes_to_remove = {
"alien-artifact-blue-from-basic",
"alien-artifact-green-from-basic",
"alien-artifact-orange-from-basic",
Expand Down Expand Up @@ -94,14 +94,113 @@ for _, v in ipairs({
"thermal-water-filtering-2",
"water-thermal-lithia",
"wood-charcoal",
}) do
}
--[[
if settings.startup["No-minerals-mode-setting"].value == false then
recipes_to_remove = {
"alien-artifact-blue-from-basic",
"alien-artifact-green-from-basic",
"alien-artifact-orange-from-basic",
"alien-artifact-purple-from-basic",
"alien-artifact-red-from-basic",
"alien-artifact-yellow-from-basic",
"angels-chemical-void-gas-natural-1",
"angels-chemical-void-liquid-condensates",
"angels-water-void-crystal-matrix",
"angels-water-void-lithia-water",
"angelsore1-crushed-hand",
"angelsore3-crushed-hand",
"big-burner-generator",
"bio-tile",
"bob-coal-from-wood",
"bob-resin-wood",
"burner-generator",
-- "burner-mining-drill",
"carbon-from-charcoal",
"coal-cracking-1",
"coal-cracking-2",
"coal-cracking-3",
-- "coal-crushed",
"condensates-oil-refining",
"condensates-refining",
"diesel-fuel",
-- "electric-mining-drill",
"empty-crystal-matrix-barrel",
"empty-diesel-fuel-barrel",
"empty-gas-natural-1-barrel",
"empty-liquid-condensates-barrel",
"empty-lithia-water-barrel",
"fill-crystal-matrix-barrel",
"fill-diesel-fuel-barrel",
"fill-gas-natural-1-barrel",
"fill-liquid-condensates-barrel",
"fill-lithia-water-barrel",
"gas-fractioning-condensates",
"gas-phosgene",
"gas-separation",
"oil-steam-boiler",
"petroleum-generator",
"protection-field-goopless",
-- "pumpjack",
"slag-processing-7",
"slag-processing-8",
"slag-processing-9",
-- "solid-coke",
"solid-coke-sulfur",
"thermal-water-filtering-1",
"thermal-water-filtering-2",
"water-thermal-lithia",
"wood-charcoal",
}
end
--]]

if settings.startup["Cargo-ships-deep-oil-setting"].value == true then
--remove pumpjack from recipes_to_remove
for k, v in ipairs(recipes_to_remove) do
if v == "pumpjack" then
table.remove(recipes_to_remove, k)
end
end
elseif settings.startup["No-minerals-mode-setting"].value == false then
--[[
remove:
"burner-mining-drill",
"coal-crushed",
"electric-mining-drill",
"pumpjack",
"solid-coke",
--]]
for k, v in ipairs(recipes_to_remove) do
if v == "pumpjack" then
table.remove(recipes_to_remove, k)

elseif v == "burner-mining-drill" then
table.remove(recipes_to_remove, k)

elseif v == "coal-crushed" then
table.remove(recipes_to_remove, k)

elseif v == "electric-mining-drill" then
table.remove(recipes_to_remove, k)

elseif v == "solid-coke" then
table.remove(recipes_to_remove, k)
else
end
end
else
end


for _, v in ipairs(recipes_to_remove) do
removerecipes[v] = true
end

-- Items to remove. Recipes are checked to ensure these can't be crafted,
-- then any recipe that uses an unobtainable item is removed
local unobtainable = {}
for _, v in ipairs({
local items_to_remove = {
"big-burner-generator",
"bio-tile",
"burner-generator",
Expand All @@ -122,10 +221,64 @@ for _, v in ipairs({
"oil-steam-boiler",
"petroleum-generator",
"pumpjack",
}) do
unobtainable[v] = {}
}
if settings.startup["No-minerals-mode-setting"].value == false then
items_to_remove = {
"big-burner-generator",
"bio-tile",
"burner-generator",
-- "burner-mining-drill",
-- "coal",
-- "coal-crushed",
"diesel-fuel",
"diesel-fuel-barrel",
-- "electric-mining-drill",
"gas-natural-1",
"gas-natural-1-barrel",
"gas-phosgene",
"gas-phosgene-barrel",
"liquid-condensates",
"liquid-condensates-barrel",
"lithia-water",
"lithia-water-barrel",
"oil-steam-boiler",
"petroleum-generator",
"pumpjack",
}
end

if settings.startup["Cargo-ships-deep-oil-setting"].value == true then
--remove pumpjack from recipes_to_remove
for k, v in ipairs(items_to_remove) do
if v == "pumpjack" then
table.remove(recipes_to_remove, k)
end
end
end

for _, v in ipairs(items_to_remove) do
unobtainable[v] = {}
end
--[[
if settings.startup["No-minerals-mode-setting"].value == false then
for _, v in ipairs({
"burner-mining-drill",
"coal-crushed",
"electric-mining-drill"
}) do
removerecipes[v] = false
end

for _, v in ipairs({
"burner-mining-drill",
"coal",
"coal-crushed",
"electric-mining-drill"
}) do
unobtainable[v] = nil
end
end
--]]
-- unobtainable[key] -> { { a, and b, and .. }, or { c, ... } or, { d, and e, and f, ...}... }
-- a,b,c... are items which if craftable imply key is also craftable and should not be removed
local recipes = {}
Expand Down
1 change: 1 addition & 0 deletions SeaBlock/data-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ require("data-updates/thermal-extractor")
require("data-updates/wood")
require("data-updates/startup")
require("data-updates/landfill")
require("data-updates/mapgen")
8 changes: 5 additions & 3 deletions SeaBlock/data-updates/coal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ seablock.lib.moveeffect("pellet-coke", "angels-coal-cracking", "angels-coal-proc
data.raw.item["carbon"].fuel_emissions_multiplier = nil
data.raw.item["carbon"].fuel_value = nil
data.raw.item["carbon"].fuel_category = nil
data.raw.item["coal"].fuel_emissions_multiplier = nil
data.raw.item["coal"].fuel_value = nil
data.raw.item["coal"].fuel_category = nil
if settings.startup["No-minerals-mode-setting"].value == true then
data.raw.item["coal"].fuel_emissions_multiplier = nil
data.raw.item["coal"].fuel_value = nil
data.raw.item["coal"].fuel_category = nil
end
data.raw.item["coal-crushed"].fuel_value = nil
data.raw.item["coal-crushed"].fuel_category = nil

Expand Down
23 changes: 23 additions & 0 deletions SeaBlock/data-updates/mapgen.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Remove resources so mining recipes don't show in FNEI
-- Have to leave at least one resource or game will not load
if settings.startup["No-minerals-mode-setting"].value == true then
if settings.startup["Cargo-ships-deep-oil-setting"].value == true then
for k, v in pairs(data.raw["resource"]) do
if k == "deep_oil" or k == "deep-oil" then
--v.minable.result = nil
--v.minable.results = nil
else
data.raw["resource"][k] = nil
end
end
else
for k, v in pairs(data.raw["resource"]) do
if k == "coal" then
v.minable.result = nil
v.minable.results = nil
else
data.raw["resource"][k] = nil
end
end
end
end
Loading