From 0ca25f8ebabf3746c6e40d2750e7941941eeb702 Mon Sep 17 00:00:00 2001 From: MAGGen Date: Sat, 1 Nov 2025 14:46:54 +0100 Subject: [PATCH] Returned wooden rails. (#8) Borrowed recipes from here and edited them to work with Factorio 2.0: https://github.com/TheSAguy/Bio_Industries Recipes: `wooden rails recipe`, `alternative production science pack recipe` Additional feature: added ability to replace/upgrade ralis (wood <-> iron) Note: to degrade iron rails back to wooden variant ALL variations of rails must be manualy selected in upgrade plan interface. Example: ![image](/attachments/9566fda8-d019-4e84-8304-0f5d70205261) Reviewed-on: https://git.cacklingfiend.info/cacklingfiend/Bio_Industries_2/pulls/8 Co-authored-by: MAGGen Co-committed-by: MAGGen --- .../prototypes/Bio_Tweaks/recipe.lua | 24 ++++++++++ .../prototypes/Wood_Products/rail.lua | 47 +++++++++++++++++-- 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/Bio_Industries_2/prototypes/Bio_Tweaks/recipe.lua b/Bio_Industries_2/prototypes/Bio_Tweaks/recipe.lua index bc3cef5..f0d53ea 100644 --- a/Bio_Industries_2/prototypes/Bio_Tweaks/recipe.lua +++ b/Bio_Industries_2/prototypes/Bio_Tweaks/recipe.lua @@ -132,4 +132,28 @@ log("Enabling disassemble recipes!") }, }) +end + +local KRAS = (mods["Krastorio2"] or mods["Krastorio"]) and true or false +local SET = settings.startup["BI_Game_Tweaks_Production_Science"].value +if SET and not KRAS then + data:extend({ + { + type = "recipe", + name = "bi-production-science-pack", + enabled = false, + energy_required = 21, + ingredients = { + {type = "item", name = "electric-furnace", amount = 1}, + {type = "item", name = "productivity-module", amount = 1}, + {type = "item", name = "bi-rail-wood", amount = 40} + }, + results = {{type="item", name="production-science-pack", amount=3}}, + }, + }) + --~ BI_Functions.lib.allow_productivity("bi-production-science-pack") + --~ thxbob.lib.tech.add_recipe_unlock("production-science-pack", "bi-production-science-pack") + BioInd.writeDebug("Added alternative recipe for Production science packs.") +else + BioInd.writeDebug("Didn't add alternative recipe for Production science packs! (\"Krastorio\": %s\tSetting: %s", {(KRAS and "active" or "not active"), (SET and "enabled" or "disabled")}) end \ No newline at end of file diff --git a/Bio_Industries_2/prototypes/Wood_Products/rail.lua b/Bio_Industries_2/prototypes/Wood_Products/rail.lua index 97c7da1..dceaad8 100644 --- a/Bio_Industries_2/prototypes/Wood_Products/rail.lua +++ b/Bio_Industries_2/prototypes/Wood_Products/rail.lua @@ -40,6 +40,33 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations") }, ---- Recipe + { + type = "recipe", + name = "bi-rail-wood", + localised_name = {"entity-name.bi-rail-wood"}, + localised_description = {"entity-description.bi-rail-wood"}, + icons = { { icon = ICONPATH_E .. "rail-wood.png", icon_size = 64, } }, + enabled = false, + ingredients = { + {type="item",name="wood",amount=6}, + {type="item",name="stone",amount=1}, + {type="item",name="steel-plate",amount=1}, + {type="item",name="iron-stick",amount=1}, + }, + results={{type="item",name="bi-rail-wood",amount=2}}, + main_product = "", + requester_paste_multiplier = 4, + --~ always_show_made_in = true, + --~ allow_decomposition = false, + allow_as_intermediate = false, -- Added for 0.18.34/1.1.4 + always_show_made_in = false, -- Changed for 0.18.34/1.1.4 + allow_decomposition = true, -- Changed for 0.18.34/1.1.4 + subgroup = "transport", + order = "a[train-system]-a[rail]", + -- This is a custom property for use by "Krastorio 2" (it will change + -- ingredients/results; used for wood/wood pulp) + mod = "Bio_Industries", + }, { type = "recipe", name = "bi-rail-wood-to-concrete", @@ -90,7 +117,10 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations") placeable_by = {item = "bi-rail-wood", count = 1}, walking_sound = tile_sounds.walking.rails, extra_planner_goal_penalty = -4, - factoriopedia_alternative = "straight-rail" + factoriopedia_alternative = "straight-rail", + -- for upgrade planer (fast rail change wood/iron) + next_upgrade = "straight-rail", + fast_replaceable_group = "straight-rail", }, { @@ -139,7 +169,10 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations") placeable_by = {item = "bi-rail-wood", count = 2}, walking_sound = tile_sounds.walking.rails, extra_planner_penalty = 0, - factoriopedia_alternative = "straight-rail" + factoriopedia_alternative = "straight-rail", + -- for upgrade planer (fast rail change wood/iron) + next_upgrade = "half-diagonal-rail", + fast_replaceable_group = "half-diagonal-rail", }, { type = "curved-rail-a", @@ -186,7 +219,10 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations") walking_sound = tile_sounds.walking.rails, extra_planner_penalty = 0.5, deconstruction_marker_positions = rail_8shifts_vector(-0.248, -0.533), - factoriopedia_alternative = "straight-rail" + factoriopedia_alternative = "straight-rail", + -- for upgrade planer (fast rail change wood/iron) + next_upgrade = "curved-rail-a", + fast_replaceable_group = "curved-rail-a", }, { type = "curved-rail-b", @@ -233,7 +269,10 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations") walking_sound = tile_sounds.walking.rails, extra_planner_penalty = 0.5, deconstruction_marker_positions = rail_8shifts_vector(-0.309, -0.155), - factoriopedia_alternative = "straight-rail" + factoriopedia_alternative = "straight-rail", + -- for upgrade planer (fast rail change wood/iron) + next_upgrade = "curved-rail-b", + fast_replaceable_group = "curved-rail-b", }, })