Skip to content

update for Factorio 2.0 #29

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 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
212 changes: 65 additions & 147 deletions CircuitProcessing/bobelectronics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ else
{
type = 'item-subgroup',
name = 'sb-circuit-board',
group = 'bob-intermediate-products',
group = 'intermediate-products',
order = 'e-a4'
}
})
Expand All @@ -36,38 +36,22 @@ data.raw.item['electronic-circuit'] =
local cpelectroniccircuitboardrecipe = data.raw.recipe['electronic-circuit']
data.raw.recipe['cp-electronic-circuit-board'] = cpelectroniccircuitboardrecipe
cpelectroniccircuitboardrecipe.name = 'cp-electronic-circuit-board'
bobmods.lib.recipe.remove_result('cp-electronic-circuit-board', 'electronic-circuit')
bobmods.lib.recipe.add_result('cp-electronic-circuit-board', 'cp-electronic-circuit-board')
lib.set_recipe_result('cp-electronic-circuit-board', {type = 'item', name = 'cp-electronic-circuit-board', amount = 1})
lib.set_main_product('cp-electronic-circuit-board', 'cp-electronic-circuit-board')
data.raw.recipe['electronic-circuit'] =
{
type = "recipe",
name = "electronic-circuit",
category = "electronics",
normal =
category = "bob-electronics",
ingredients =
{
ingredients =
{
{"cp-electronic-circuit-board", 1},
{"iron-plate", 2}
},
result = "electronic-circuit",
requester_paste_multiplier = 50,
enabled = false,
allow_decomposition = false
},
expensive =
{
ingredients =
{
{"cp-electronic-circuit-board", 1},
{"iron-plate", 4}
},
result = "electronic-circuit",
requester_paste_multiplier = 50,
enabled = false,
allow_decomposition = false
{type="item", name="cp-electronic-circuit-board", amount=1},
{type="item", name="iron-plate", amount=2}
},
results = {{type="item", name="electronic-circuit", amount=1}},
requester_paste_multiplier = 50,
enabled = false,
allow_decomposition = false
}

local cpadvancedcircuitboard = data.raw.item['advanced-circuit']
Expand All @@ -87,45 +71,26 @@ data.raw.item['advanced-circuit'] =
local cpadvancedcircuitboardrecipe = data.raw.recipe['advanced-circuit']
data.raw.recipe['cp-advanced-circuit-board'] = cpadvancedcircuitboardrecipe
cpadvancedcircuitboardrecipe.name = 'cp-advanced-circuit-board'
bobmods.lib.recipe.remove_result('cp-advanced-circuit-board', 'advanced-circuit')
bobmods.lib.recipe.add_result('cp-advanced-circuit-board', 'cp-advanced-circuit-board')
lib.set_recipe_result('cp-advanced-circuit-board', {type = 'item', name = 'cp-advanced-circuit-board', amount = 1})
lib.set_main_product('cp-advanced-circuit-board', 'cp-advanced-circuit-board')

data.raw.recipe['advanced-circuit'] =
{
type = "recipe",
name = "advanced-circuit",
category = "electronics",
normal =
category = "bob-electronics",
enabled = false,
energy_required = 6,
ingredients = lib.ingredient_exists_add(
{type="item", name="aluminium-plate", amount=4},
{
enabled = false,
energy_required = 6,
ingredients = lib.checkplate(
{"aluminium-plate", 4},
{
{"electronic-circuit", 2},
{"cp-advanced-circuit-board", 2},
{"copper-cable", 4}
}),
result = "advanced-circuit",
requester_paste_multiplier = 5,
allow_decomposition = false
},
expensive =
{
enabled = false,
energy_required = 6,
ingredients = lib.checkplate(
{"aluminium-plate", 4},
{
{"electronic-circuit", 2},
{"cp-advanced-circuit-board", 4},
{"copper-cable", 8}
}),
result = "advanced-circuit",
requester_paste_multiplier = 5,
allow_decomposition = false
}
{type="item", name="electronic-circuit", amount=2},
{type="item", name="cp-advanced-circuit-board", amount=2},
{type="item", name="copper-cable", amount=4}
}),
results = {{type="item", name="advanced-circuit", amount=1}},
requester_paste_multiplier = 5,
allow_decomposition = false
}

local cpprocessingboard = data.raw.item['processing-unit']
Expand All @@ -145,53 +110,35 @@ data.raw.item['processing-unit'] =
local cpprocessingboardrecipe = data.raw.recipe['processing-unit']
data.raw.recipe['cp-processing-board'] = cpprocessingboardrecipe
cpprocessingboardrecipe.name = 'cp-processing-board'
bobmods.lib.recipe.remove_result('cp-processing-board', 'processing-unit')
bobmods.lib.recipe.add_result('cp-processing-board', 'cp-processing-board')
lib.set_recipe_result('cp-processing-board', {type = 'item', name = 'cp-processing-board', amount = 1})
lib.set_main_product('cp-processing-board', 'cp-processing-board')
data.raw.recipe['processing-unit'] =
{
type = "recipe",
name = "processing-unit",
category = "electronics-machine",
normal =
category = "bob-electronics-machine",
enabled = false,
energy_required = 10,
ingredients = lib.ingredient_exists_add(
{type="item", name="titanium-plate", amount=8},
{
enabled = false,
energy_required = 10,
ingredients = lib.checkplate(
{"titanium-plate", 8},
{
{"advanced-circuit", 4},
{"cp-processing-board", 4},
{type = "fluid", name = "sulfuric-acid", amount = 5}
}),
result = "processing-unit",
allow_decomposition = false
},
expensive =
{
enabled = false,
energy_required = 10,
ingredients = lib.checkplate(
{"titanium-plate", 8},
{
{"advanced-circuit", 4},
{"cp-processing-board", 4},
{type = "fluid", name = "sulfuric-acid", amount = 10}
}),
result = "processing-unit",
allow_decomposition = false
}
{type="item", name="advanced-circuit", amount=4},
{type="item", name="cp-processing-board", amount=4},
{type = "fluid", name = "sulfuric-acid", amount = 5}
}),
results = {{type="item", name="processing-unit", amount=1}},
allow_decomposition = false
}
bobmods.lib.recipe.set_energy_required('cp-processing-board', 5)
bobmods.lib.recipe.set_energy_required('superior-circuit-board', 5)
lib.set_energy_required('cp-processing-board', 5)
lib.set_energy_required('bob-superior-circuit-board', 5)

local cpadvancedprocessingboard = data.raw.item['advanced-processing-unit']
local cpadvancedprocessingboard = data.raw.item['bob-advanced-processing-unit']
data.raw.item['cp-advanced-processing-board'] = cpadvancedprocessingboard
cpadvancedprocessingboard.name = 'cp-advanced-processing-board'
data.raw.item['advanced-processing-unit'] =
data.raw.item['bob-advanced-processing-unit'] =
{
type = "item",
name = "advanced-processing-unit",
name = "bob-advanced-processing-unit",
icon = "__CircuitProcessing__/graphics/icons/advanced-processing-unit.png",
icon_size = 64, icon_mipmaps = 4,
subgroup = "sb-circuit-board",
Expand All @@ -210,49 +157,30 @@ if data.raw.fluid["nitric-acid"] then
advancedacid = "nitric-acid"
end

local cpadvancedprocessingboardrecipe = data.raw.recipe['advanced-processing-unit']
local cpadvancedprocessingboardrecipe = data.raw.recipe['bob-advanced-processing-unit']
data.raw.recipe['cp-advanced-processing-board'] = cpadvancedprocessingboardrecipe
cpadvancedprocessingboardrecipe.name = 'cp-advanced-processing-board'
bobmods.lib.recipe.remove_result('cp-advanced-processing-board', 'advanced-processing-unit')
bobmods.lib.recipe.add_result('cp-advanced-processing-board', 'cp-advanced-processing-board')
lib.set_recipe_result('cp-advanced-processing-board', {type = 'item', name = 'cp-advanced-processing-board', amount = 1})
lib.set_main_product('cp-advanced-processing-board', 'cp-advanced-processing-board')
bobmods.lib.recipe.set_energy_required('cp-advanced-processing-board', 5)
bobmods.lib.recipe.set_energy_required('multi-layer-circuit-board', 5)
data.raw.recipe['advanced-processing-unit'] =
lib.set_energy_required('cp-advanced-processing-board', 5)
lib.set_energy_required('bob-multi-layer-circuit-board', 5)
data.raw.recipe['bob-advanced-processing-unit'] =
{
type = "recipe",
name = "advanced-processing-unit",
category = "electronics-machine",
normal =
{
enabled = false,
energy_required = 15,
ingredients = lib.checkplate(
{advancedplate, 10},
{
{"processing-unit", 3},
{"electronic-circuit", 20},
{"cp-advanced-processing-board", 9},
{type = "fluid", name = advancedacid, amount = 5}
}),
result = "advanced-processing-unit",
allow_decomposition = false
},
expensive =
name = "bob-advanced-processing-unit",
category = "bob-electronics-machine",
enabled = false,
energy_required = 15,
ingredients = lib.ingredient_exists_add(
{advancedplate, 10},
{
enabled = false,
energy_required = 15,
ingredients = lib.checkplate(
{advancedplate, 10},
{
{"processing-unit", 3},
{"electronic-circuit", 20},
{"cp-advanced-processing-board", 9},
{type = "fluid", name = advancedacid, amount = 10}
}),
result = "advanced-processing-unit",
allow_decomposition = false
}
{type="item", name="processing-unit", amount=3},
{type="item", name="electronic-circuit", amount=20},
{type="item", name="cp-advanced-processing-board", amount=9},
{type = "fluid", name = advancedacid, amount = 5}
}),
results = {{type="item", name="bob-advanced-processing-unit", amount=1}},
allow_decomposition = false
}

local cable = {
Expand All @@ -270,8 +198,8 @@ local components = {

local function doublecable(ingredients)
for k,v in pairs(ingredients) do
local idx = 1
local amt = 2
local idx = ""
local amt = ""
if v.name then
idx = 'name'
amt = 'amount'
Expand All @@ -284,24 +212,14 @@ end

for _,v in pairs(components) do
if data.raw.recipe[v] then
bobmods.lib.recipe.difficulty_split(v)
doublecable(data.raw.recipe[v].normal.ingredients)
doublecable(data.raw.recipe[v].expensive.ingredients)
doublecable(data.raw.recipe[v].ingredients)
end
end

data.raw.recipe['basic-electronic-components'].normal.result_count = 10
data.raw.recipe['basic-electronic-components'].expensive.result_count = 6
bobmods.lib.recipe.set_difficulty_energy_required('basic-electronic-components', 'normal', 4)
bobmods.lib.recipe.set_difficulty_energy_required('basic-electronic-components', 'expensive', 6)
data.raw.recipe['bob-basic-electronic-components'].results[1].amount = 10
lib.set_energy_required('bob-basic-electronic-components', 4)

local circuits = {
'cp-advanced-processing-board',
'cp-processing-board',
'cp-advanced-circuit-board',
'cp-electronic-circuit-board'
}
bobmods.lib.module.add_productivity_limitations(circuits)
-- bobmods.lib.module.add_productivity_limitations(circuits)

for k,v in pairs(data.raw.technology) do
for ek,ev in pairs(v.effects or {}) do
Expand All @@ -320,7 +238,7 @@ for k,v in pairs(data.raw.technology) do
bobmods.lib.tech.add_prerequisite(k, 'angels-titanium-smelting-1')
end
break
elseif ev.type == 'unlock-recipe' and ev.recipe == 'advanced-processing-unit' then
elseif ev.type == 'unlock-recipe' and ev.recipe == 'bob-advanced-processing-unit' then
table.insert(v.effects, ek, {type = 'unlock-recipe', recipe = 'cp-advanced-processing-board'})
if data.raw.technology['angels-chrome-smelting-1'] then
bobmods.lib.tech.add_prerequisite(k, 'angels-chrome-smelting-1')
Expand Down
6 changes: 6 additions & 0 deletions CircuitProcessing/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.0
Date: 31.03.2025
Changes:
- Update for Factorio 2.0
- Removed module changes, bobsmodules now handles this
---------------------------------------------------------------------------------------------------
Version: 0.4.5
Date: 01.01.2023
Changes:
Expand Down
20 changes: 2 additions & 18 deletions CircuitProcessing/data-updates.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
require "bobelectronics"
require "bobmodules"

data.raw.recipe['rocket-control-unit'].normal = nil
data.raw.recipe['rocket-control-unit'].expensive = nil
local module = 'speed-module'
if data.raw.module['speed-module-8'] then
module = 'speed-module-2'
end
data.raw.recipe['rocket-control-unit'].ingredients = {
{"advanced-processing-unit", 1},
{module, 1}
}
data.raw.recipe['rocket-control-unit'].result = 'rocket-control-unit'
data.raw.recipe['rocket-control-unit'].energy_required = 30
bobmods.lib.tech.add_prerequisite('rocket-control-unit', 'speed-module')
bobmods.lib.tech.add_prerequisite("rocket-control-unit", "advanced-electronics-3")
bobmods.lib.tech.add_science_pack("rocket-control-unit", "production-science-pack", 1)
-- require "bobmodules"

-- Hide Agriculture Modules. Revisit later, once Angel's devs have finished their changes
local function disable(name)
Expand All @@ -27,7 +11,7 @@ local function disable(name)
data.raw.recipe[name].hidden = true
end
if data.raw.module[name] then
data.raw.module[name].flags = {'hidden'}
data.raw.module[name].hidden = true
end
end
for _,v in pairs({
Expand Down
10 changes: 5 additions & 5 deletions CircuitProcessing/info.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "CircuitProcessing",
"version": "0.4.5",
"factorio_version": "1.1",
"version": "0.5.0",
"factorio_version": "2.0",
"title": "Circuit Processing",
"author": "Trainwreck",
"contact": "",
"homepage": "",
"description": "A mod for Bob's mods. Reintroduces green to red to blue circuit progression. New circuits result in overall increased resource usage. Reduces module count and types.",
"dependencies": [
"base",
"bobelectronics >= 1.1.6",
"? bobmodules >= 1.1.6",
"? bobrevamp >= 1.1.6",
"bobelectronics >= 2.0.0",
"? bobmodules >= 2.0.0",
"? bobrevamp >= 2.0.0",
"? angelssmelting",
"? angelsbioprocessing"
]
Expand Down
Loading