big update to 2.0/SA

This commit is contained in:
Brevven 2024-12-31 00:48:29 -08:00
parent f82dca2023
commit 01d64fea85
16 changed files with 341 additions and 78 deletions

View file

@ -1,4 +1,16 @@
---------------------------------------------------------------------------------------------------
Version: 2.0.0
Date: 2024-12-31
Changes:
- Updated to Factorio 2.0 and Space Age
Can be added to existing savegame. Will generate ore patches on newly explored chunks on Nauvis.
To add ore patches to previously explored chunks, use /bz-regenerate console command.
- bzlist chat command is now a proper console command: /bz-list
- Alternate processes for creating tin on Vulcanus and Gleba, and recycling on Fulgora
- A small number of new uses for tin in Spage Age. (More may come later)
- Confirmed compatible with many modded planets.
- Compatibility with other mods is not confirmed, but many will still work
---------------------------------------------------------------------------------------------------
Version: 0.1.13
Date: 2024-02-10
Changes:

View file

@ -1,18 +1,9 @@
local util = require("control-util")
function on_console_chat(event)
if event.message and string.lower(event.message) == "bzlist" then
local player = game.players[event.player_index]
if player and player.connected then
local list = util.get_list()
if list and #list>0 then
local filename = util.me.name..".txt"
game.write_file(filename, list, false, event.player_index)
player.print("Wrote recipes to script-output/"..filename)
end
end
end
end
script.on_event(defines.events.on_console_chat, on_console_chat)
script.on_event(defines.events.on_console_command, util.list)
script.on_configuration_changed(util.ore_fix)
util.add_regenerate_command_handler()
util.add_list_command_handler()
util.warptorio2_expansion_helper()

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
graphics/molten-tin-sa.xcf Normal file

Binary file not shown.

View file

@ -25,6 +25,6 @@
"? space-age",
"(?) RenaiTransportation"
],
"description": "Adds tin, solder and more to the base game.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods."
"description": "Adds tin, solder and more to the base game.\n\nCompatible with Space Age.\n\nA standalone piece of BZ Mods."
}

View file

@ -53,7 +53,7 @@ bztin-more-intermediates=Povolit výrobu více meziproduktů
[mod-setting-description]
bztin-recipe-bypass=Modifikace originálních receptů uvedených v seznamu nebudou povoleny. Jednotlivé recepty oddělte čárkami.
bztin-list=Pokud je povoleno, textový příkaz [color=orange]BZList[/color] vypíše soubor do adresáře s výstupem skriptu s úplným seznamem upravených receptů. Doporučuje se toto vypnout, jakmile dokončíte konfiguraci ostatních nastavení.
bztin-list=Pokud je povoleno, textový příkaz [color=orange]/bz-list[/color] vypíše soubor do adresáře s výstupem skriptu s úplným seznamem upravených receptů. Doporučuje se toto vypnout, jakmile dokončíte konfiguraci ostatních nastavení.
[string-mod-setting]
bztin-more-intermediates-no=Žádné meziprodukty

View file

@ -14,6 +14,7 @@ tinned-cable=Tinned cable
enriched-tin=Enriched tin
compressed-tin-ore=Compressed tin ore
bronze-plate=Bronze plate
jellyskin=Jellyskin
[item-description]
tin-ore=Can be smelted into tin plates
@ -22,6 +23,7 @@ enriched-tin=Can be efficiently smelted into tin plates
[fluid-name]
molten-tin=Molten tin
organotins=Organotins
tin-sulfides=Tin sulfides
[technology-name]
tinned-cable=Tinned cable
@ -42,8 +44,17 @@ smelt-compressed-tin-ore=__ITEM__tin-plate__
tin-dust=__ITEM__tin-dust__
dirty-water-filtration-tin=Filter dirty water [item=tin-ore]
bz-tin-ingot=Tin ingot
tin-sulfide-processing=Tin sulfide processing
casting-tin=Casting tin
jellyskin-processing=Jellyskin processing
tin-from-organotins=Tin from organotins
metallic-asteroid-crushing-tin=Metallic asteroid crushing for tin
[recipe-description]
tin-sulfides=Only possible on Vulcanus, extract tin from the released acidic gases.
jellyskin-processing=The skin of the jellynut is delicate, but has a coating of organotins to protect the plant from pentapods.
tin-from-organotins=A focused dose of organotins in a pentapod egg kills the egg but extracts the tin.
# Settings
@ -54,7 +65,7 @@ bztin-more-intermediates=Enable more intermediates
[mod-setting-description]
bztin-recipe-bypass=Skip modifying these recipes (comma-separated list).
bztin-list=If enabled, the text command [color=orange]BZList[/color] will dump a file to the script-output directory with a full list of recipes modified.\nRecommended to turn this off after you are done configuring your other settings.
bztin-list=If enabled, the text command [color=orange]/bz-list[/color] will dump a file to the script-output directory with a full list of recipes modified.\nRecommended to turn this off after you are done configuring your other settings.
[string-mod-setting]
bztin-more-intermediates-no=No

View file

@ -54,7 +54,7 @@ bztin-more-intermediates=中間生産物を追加
[mod-setting-description]
bztin-recipe-bypass=指定したレシピの改変を行わない。(コンマ区切り)
bztin-list=有効にすると、テキストコマンド [color=orange]BZList[/color] で script-output ディレクトリに改変されたレシピの完全なリストを出力します。\n他の設定を済ませたあとは無効にするのを推奨。
bztin-list=有効にすると、テキストコマンド [color=orange]/bz-list[/color] で script-output ディレクトリに改変されたレシピの完全なリストを出力します。\n他の設定を済ませたあとは無効にするのを推奨。
[string-mod-setting]
bztin-more-intermediates-no=いいえ

View file

@ -54,7 +54,7 @@ bztin-more-intermediates=Включить больше промежуточны
[mod-setting-description]
bztin-recipe-bypass=Пропустить изменение этих рецептов (список, разделенный запятыми).
bztin-list=Если эта функция включена, текстовая команда [color=orange]BZList[/color] будет сохранять файл в каталог script-output с полным списком измененных рецептов.\nРекомендуется выключить эту функцию после того, как вы закончите настройку других параметров.
bztin-list=Если эта функция включена, текстовая команда [color=orange]/bz-list[/color] будет сохранять файл в каталог script-output с полным списком измененных рецептов.\nРекомендуется выключить эту функцию после того, как вы закончите настройку других параметров.
[string-mod-setting]
bztin-more-intermediates-no=Нет

View file

@ -54,7 +54,7 @@ bztin-more-intermediates=启用更多的中间产品
[mod-setting-description]
bztin-recipe-bypass=跳过修改这些合成(用逗号分开)。
bztin-list=如果启用,在控制台中打[color=orange]BZList[/color]会在script-output文件夹中导出一个全部修改过的合成配方的文件。\n推荐在你调整好其他配置后关闭。
bztin-list=如果启用,在控制台中打[color=orange]/bz-list[/color]会在script-output文件夹中导出一个全部修改过的合成配方的文件。\n推荐在你调整好其他配置后关闭。
[string-mod-setting]
bztin-more-intermediates-no=不启用

1
me.lua
View file

@ -1,6 +1,7 @@
local me = {}
me.name = "bztin"
me.resources = {"tin-ore"}
me.list = {}
me.recipes = {"tin-plate", "solder", "organotins",
"enriched-tin",

View file

@ -1,20 +1,27 @@
local resource_autoplace = require('resource-autoplace');
local noise = require('noise');
local util = require("data-util");
resource_autoplace.initialize_patch_set("tin-ore", true)
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["tin-ore"] = {}
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["tin-ore"] = {}
if mods.tenebris then
data.raw.planet.tenebris.map_gen_settings.autoplace_controls["tin-ore"] = {}
data.raw.planet.tenebris.map_gen_settings.autoplace_settings.entity.settings["tin-ore"] = {}
end
data:extend({
{
type = "autoplace-control",
category = "resource",
name = "tin-ore",
richness = true,
order = "b-e"
},
{
type = "noise-layer",
name = "tin-ore"
order = "a-t"
},
-- {
-- type = "noise-layer",
-- name = "tin-ore"
-- },
{
type = "resource",
icon_size = 64, icon_mipmaps = 3,
@ -27,7 +34,7 @@ data:extend({
{
hardness = 1,
mining_particle = "copper-ore-particle",
mining_time = 1,
mining_time = .75,
result = "tin-ore"
},
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
@ -35,7 +42,7 @@ data:extend({
autoplace = resource_autoplace.resource_autoplace_settings{
name = "tin-ore",
order = "b-z",
order = "a-t",
base_density = 3,
base_spots_per_km2 = 1,
has_starting_area_placement = true,
@ -44,25 +51,15 @@ data:extend({
},
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
stages =
{
sheet =
{
filename = "__bztin__/graphics/entity/ores/tin-ore.png",
priority = "extra-high",
size = 64,
frame_count = 8,
variation_count = 8,
hr_version =
{
filename = "__bztin__/graphics/entity/ores/hr-tin-ore.png",
stages = {
sheet = {
filename = "__bztin__/graphics/entity/ores/hr-tin-ore.png",
priority = "extra-high",
size = 128,
frame_count = 8,
variation_count = 8,
scale = 0.5
}
}
},
},
{
@ -71,10 +68,10 @@ data:extend({
icon_size = 64, icon_mipmaps = 3,
icon = "__bztin__/graphics/icons/tin-ore.png",
pictures = {
{filename="__bztin__/graphics/icons/tin-ore.png", size=64, scale=0.25},
{filename="__bztin__/graphics/icons/tin-ore-1.png", size=64, scale=0.25},
{filename="__bztin__/graphics/icons/tin-ore-2.png", size=64, scale=0.25},
{filename="__bztin__/graphics/icons/tin-ore-3.png", size=64, scale=0.25},
{filename="__bztin__/graphics/icons/tin-ore.png", size=64, scale=0.5},
{filename="__bztin__/graphics/icons/tin-ore-1.png", size=64, scale=0.5},
{filename="__bztin__/graphics/icons/tin-ore-2.png", size=64, scale=0.5},
{filename="__bztin__/graphics/icons/tin-ore-3.png", size=64, scale=0.5},
},
subgroup = "raw-resource",
order = "t-c-a",

View file

@ -1,6 +1,21 @@
local util = require("data-util");
-- Space Age
if mods.bzlead and data.raw.item["lead-expansion-bolt"] then
util.replace_product("scrap-recycling", "lead-expansion-bolt", "solder")
else
util.add_product("scrap-recycling", util.item("solder", 1, .01))
end
if mods.bztitanium then
util.replace_ingredient("superconductor", "titanium-plate", "tin-plate")
else
util.add_ingredient("superconductor", "tin-plate", 1)
end
-- Main vanilla changes
local organotins_quant = mods.Krastorio2 and 10 or 5
@ -106,7 +121,7 @@ util.add_ingredient("lab", "tin-plate", 5)
if util.me.use_cable() then
util.add_prerequisite("oil-processing", "tinned-cable")
util.add_prerequisite("oil-gathering", "tinned-cable")
util.add_ingredient("pumpjack", "tinned-cable", 5)
util.remove_ingredient("se-delivery-cannon-capsule", "copper-cable") --10
@ -119,6 +134,7 @@ if util.me.use_cable() then
util.replace_ingredient("constant-combinator", "copper-cable", "tinned-cable")
util.replace_ingredient("power-switch", "copper-cable", "tinned-cable")
util.replace_ingredient("programmable-speaker", "copper-cable", "tinned-cable")
util.replace_ingredient("beacon", "copper-cable", "tinned-cable")
local modded_combinators = {"timer-combinator", "counting-combinator", "random-combinator",
"power-combinator", "max-combinator", "min-combinator", "and-gate-combinator",
@ -144,6 +160,11 @@ if util.me.use_cable() then
end
if util.me.use_bronze() then
util.add_ingredient("recycler", "bronze-plate", 10)
util.add_ingredient("maraxsis-diesel-submarine", "bronze-plate", 10)
util.add_ingredient("maraxsis-nuclear-submarine", "bronze-plate", 10)
util.add_ingredient("maraxsis-salt-reactor", "bronze-plate", 10)
util.add_ingredient("maraxsis-hydro-plant", "bronze-plate", 10)
local fast_i = mods.bzaluminum and "aluminum-plate" or "iron-plate"
util.replace_some_ingredient("fast-inserter", fast_i, 1, "bronze-plate", 1)
if mods.Krastorio2 then

View file

@ -18,35 +18,33 @@ data:extend({
{ icon = "__bztin__/graphics/icons/tin-plate.png", icon_size = 128},
}
),
normal = (mods["Krastorio2"] and
{
main_product = "tin-plate",
enabled = true,
energy_required = 12,
ingredients = {{"tin-ore", 10}},
results = {
{type="item", name = "tin-plate", amount=5}
}
} or
{
-- (mods["Krastorio2"] and
-- {
-- main_product = "tin-plate",
-- enabled = true,
-- energy_required = 12,
-- ingredients = {{"tin-ore", 10}},
-- results = {
-- {type="item", name = "tin-plate", amount=5}
-- }
-- } or
main_product = "tin-plate",
enabled = true,
energy_required = 2.4,
ingredients = {{"tin-ore", 1}},
ingredients = {util.item("tin-ore", 1)},
results = {
{type="item", name = "tin-plate", amount=1}
}
}),
expensive =
{
main_product = "tin-plate",
enabled = true,
energy_required = 4.8,
ingredients = {{"tin-ore", 1}},
results = {
{type="item", name = "tin-plate", amount=1},
}
}
},
-- expensive =
-- {
-- main_product = "tin-plate",
-- enabled = true,
-- energy_required = 4.8,
-- ingredients = {{"tin-ore", 1}},
-- results = {
-- {type="item", name = "tin-plate", amount=1},
-- }
-- }
},
{
type = "item",
@ -59,9 +57,9 @@ data:extend({
},
})
local solder_ingredients = {{"tin-plate", 4}, {"copper-plate", 1}}
local solder_ingredients = {util.item("tin-plate", 4), util.item("copper-plate", 1)}
if mods.bzlead then
solder_ingredients = {{"tin-plate", 3}, {"lead-plate", 2}}
solder_ingredients = {util.item("tin-plate", 3), util.item("lead-plate", 2)}
end
data:extend({
{
@ -81,7 +79,7 @@ data:extend({
enabled = true,
energy_required = 1,
ingredients = solder_ingredients,
results = {{"solder", 4}},
results = {util.item("solder", 4)},
}
})
@ -120,7 +118,7 @@ data:extend({
type = "fluid",
name = "organotins",
default_temperature = 25,
heat_capacity = "0.1KJ",
heat_capacity = "0.1kJ",
base_color = {r=0.75, g=0.65, b=0.1},
flow_color = {r=0.7, g=1, b=0.1},
icon = "__bztin__/graphics/icons/organotins.png",
@ -135,7 +133,7 @@ data:extend({
order = "h[organotins]",
enabled = false,
energy_required = 5,
ingredients = {{"tin-plate", 3}, {type="fluid", name="petroleum-gas", amount=20}},
ingredients = {util.item("tin-plate", 3), {type="fluid", name="petroleum-gas", amount=20}},
results = {{type="fluid", name="organotins", amount=50}},
crafting_machine_tint = {
primary = {r = 1.000, g = 0.995, b = 0.089, a = 1.000},
@ -181,8 +179,8 @@ data:extend({
order = "d[tinned-cable]",
enabled = false,
energy_required = 1.5,
ingredients = {{"tin-plate", 1}, {"copper-cable", 8}},
results = {{"tinned-cable", 8}},
ingredients = {util.item("tin-plate", 1), util.item("copper-cable", 8)},
results = {util.item("tinned-cable", 8)},
},
{
type = "technology",
@ -226,7 +224,7 @@ data:extend({
enabled = false,
energy_required = 60,
ingredients = {},
results = {{"bronze-plate", 20}},
results = {util.item("bronze-plate", 20)},
},
})
for item, count in pairs(bronze_i) do
@ -240,4 +238,236 @@ else
util.add_effect("automation", { type = "unlock-recipe", recipe = "bronze-plate" })
end
end
if mods["space-age"] then
data:extend({
{
type = "fluid",
name = "tin-sulfides",
icons = {{ icon="__base__/graphics/icons/fluid/steam.png", icon_size=64, tint={r=.9, g=.9, b=.1, a=.7}}},
subgroup = "fluid",
order = "b[new-fluid]-b[vulcanus]-t[tin-sulfides]",
default_temperature = 315,
max_temperature = 2000,
gas_temperature = 300,
heat_capacity = ".1kJ",
base_color = {1,1,0},
flow_color = {.95,.99,.1},
},
{
type = "recipe",
name = "tin-sulfides",
subgroup = "vulcanus-processes",
category = "chemistry",
main_product = "tin-sulfides",
allow_productivity = true,
energy_required = 1,
ingredients = {
util.fluid("steam", 10),
util.fluid("sulfuric-acid", 20),
},
results = {
util.fluid("tin-sulfides", 20),
util.fluid("sulfuric-acid", 10),
},
surface_conditions =
{
{
property = "pressure",
min = 4000,
max = 4000
}
},
},
{
type = "recipe",
name = "tin-sulfide-processing",
subgroup = "vulcanus-processes",
category = "chemistry",
main_product = "tin-ore",
allow_productivity = true,
energy_required = 2,
icons = {
{ icon="__bztin__/graphics/icons/tin-ore.png", icon_size=64},
{ icon="__base__/graphics/icons/fluid/steam.png", icon_size=64, tint={r=.9, g=.9, b=.1, a=.7}, scale=0.5, shift={-8,-8}},
},
ingredients = mods.bztitanium and {
util.fluid("tin-sulfides", 40),
util.fluid("vacuum", 1),
} or {
util.fluid("tin-sulfides", 40),
},
results = {
util.item("tin-ore", 2),
util.item("sulfur", 1),
}
},
{
type = "fluid",
name = "molten-tin",
icon = "__bztin__/graphics/icons/molten-tin-sa.png",
subgroup = "fluid",
order = "b[new-fluid]-b[vulcanus]-d[molten-tin]",
default_temperature = 1500,
max_temperature = 2000,
heat_capacity = "0.01kJ",
base_color = {.6, 0.4, 0.23},
flow_color = {0.6, 0.4, 0.23},
auto_barrel = false
},
{
type = "recipe",
name = "molten-tin",
category = "metallurgy",
subgroup = "vulcanus-processes",
order = "a[melting]-d[molten-tin]",
auto_recycle = false,
enabled = false,
ingredients =
{
{type = "item", name = "tin-ore", amount = 100},
{type = "item", name = "calcite", amount = 1},
},
energy_required = 48,
results = {{type = "fluid", name = "molten-tin", amount = 1000}},
allow_productivity = true,
hide_from_signal_gui = false,
main_product = "molten-tin",
},
{
type = "recipe",
name = "casting-tin",
category = "metallurgy",
subgroup = "vulcanus-processes",
order = "b[casting]-d[casting-tin]",
icons = {
{icon = "__bztin__/graphics/icons/tin-plate.png", icon_size = 128, shift={-4,4}},
{icon = "__bztin__/graphics/icons/molten-tin-sa.png", icon_size = 64, shift={4,-4}},
},
enabled = false,
ingredients =
{
{type = "fluid", name = "molten-tin", amount = 20, fluidbox_multiplier = 10},
},
energy_required = 2.4,
allow_decomposition = false,
results = {{type = "item", name = "tin-plate", amount = 2}},
allow_productivity = true
},
})
util.add_unlock("foundry", "casting-tin")
util.add_unlock("foundry", "molten-tin")
util.add_unlock("foundry", "tin-sulfides")
util.add_unlock("foundry", "tin-sulfide-processing")
local space_age_item_sounds = require("__space-age__.prototypes.item_sounds")
data:extend({
{
type = "item",
name = "jellyskin",
icon = "__bztin__/graphics/icons/jellyskin.png",
icon_size = 64,
subgroup = "agriculture-processes",
order = "b[agriulture]-d[tin]",
stack_size = util.get_stack_size(100),
spoil_result = "spoilage",
spoil_ticks = 54000,
fuel_category = "chemical",
fuel_value = "1MJ",
inventory_move_sound = space_age_item_sounds.agriculture_inventory_move,
pick_sound = space_age_item_sounds.agriculture_inventory_pickup,
drop_sound = space_age_item_sounds.agriculture_inventory_move,
stack_size = 100,
default_import_location = "gleba",
},
{
type = "recipe",
name = "jellyskin-processing",
category = "organic",
subgroup = "agriculture-processes",
order = "e[agriculture]-a[tin]",
icons = {
{icon = "__bztin__/graphics/icons/organotins.png", icon_size = 64},
{icon = "__bztin__/graphics/icons/jellyskin.png", icon_size=64, shift={0,-8}},
},
enabled = false,
allow_productivity = true,
ingredients =
{
util.item("jellyskin", 1),
},
energy_required = 8/3,
allow_decomposition = false,
results = {
util.fluid("organotins", 100),
},
main_product="organotins",
},
{
type = "recipe",
name = "tin-from-organotins",
category = "organic",
subgroup = "agriculture-processes",
order = "e[agriculture]-a[tin]",
icons = {
{icon = "__bztin__/graphics/icons/organotins.png", icon_size = 64},
{icon = "__bztin__/graphics/icons/tin-ore.png", icon_size=64, scale=0.333, shift={0,8}},
},
enabled = false,
allow_productivity = true,
ingredients =
{
util.fluid("organotins", 100),
util.item("pentapod-egg"),
},
energy_required = 16/3,
allow_decomposition = false,
results = {
util.item("tin-ore", 6),
},
main_product="tin-ore",
},
})
util.add_product("jellynut-processing", util.item("jellyskin", 1, .25))
util.add_ingredient("bioplastic", "organotins", 7.5)
util.set_icons("bioplastic", {
{icon = "__space-age__/graphics/icons/bioplastic.png", icon_size = 64},
{icon = "__bztin__/graphics/icons/organotins.png", icon_size = 64, scale=.25, shift={0,-8}},
})
util.add_unlock("biochamber", "jellyskin-processing")
util.add_unlock("biochamber", "tin-from-organotins")
end
if mods["planet-muluna"] then -- moon where you get resources from crushing on the surface
data:extend({
{
type = "recipe",
name = "metallic-asteroid-crushing-tin",
icons = {
{icon = "__space-age__/graphics/icons/metallic-asteroid-crushing.png", icon_size=64},
{icon="__bztin__/graphics/icons/tin-ore.png", icon_size=64, scale =0.25, shift = {0,4}},
},
category = "crushing",
subgroup="space-crushing",
order = "b-a-a",
auto_recycle = false,
enabled = false,
ingredients =
{
{type = "item", name = "metallic-asteroid-chunk", amount = 1},
},
energy_required = 2,
results =
{
{type = "item", name = "tin-ore", amount = 15},
{type = "item", name = "metallic-asteroid-chunk", amount = 1, probability = 0.2}
},
allow_productivity = true,
allow_decomposition = false
},
})
util.add_unlock("space-platform-thruster", "metallic-asteroid-crushing-tin")
end
end