Can't change pipe recipe?
Posted: Sat Sep 30, 2023 6:59 am
I'm making a mod that changes the recipes for several items to require coins instead of the default ingredients.
So far I've successfully changed 7 recipes, but I can't get the new pipe recipe to work.
As far as I can tell, I've done it the same way I've done the other 7, and the game recognises that it's from my mod (tooltip says: Base mod > My mod), but the recipe still requires Iron plates.
I tried with different amounts of coins, different ingredients, declaring the result/results, but I still can't figure it out.
Any suggestions?
So far I've successfully changed 7 recipes, but I can't get the new pipe recipe to work.
As far as I can tell, I've done it the same way I've done the other 7, and the game recognises that it's from my mod (tooltip says: Base mod > My mod), but the recipe still requires Iron plates.
I tried with different amounts of coins, different ingredients, declaring the result/results, but I still can't figure it out.
Any suggestions?
Code: Select all
local transportBeltRecipe = table.deepcopy(data.raw.recipe["transport-belt"])
transportBeltRecipe.enabled = true
transportBeltRecipe.ingredients = {{"coin", 5}}
local undergroundBeltRecipe = table.deepcopy(data.raw.recipe["underground-belt"])
undergroundBeltRecipe.enabled = true
undergroundBeltRecipe.ingredients = {{"coin", 5}}
local splitterRecipe = table.deepcopy(data.raw.recipe["splitter"])
splitterRecipe.enabled = true
splitterRecipe.ingredients = {{"coin", 5}}
local inserterRecipe = table.deepcopy(data.raw.recipe["inserter"])
inserterRecipe.enabled = true
inserterRecipe.ingredients = {{"coin", 5}}
-- Not working?
local pipeRecipe = table.deepcopy(data.raw.recipe["pipe"])
pipeRecipe.enabled = true
pipeRecipe.ingredients = {{"coin", 1}}
local pipeToGroundRecipe = table.deepcopy(data.raw.recipe["pipe-to-ground"])
pipeToGroundRecipe.enabled = true
pipeToGroundRecipe.ingredients = {{"coin", 5}}
local electricFurnaceRecipe = table.deepcopy(data.raw.recipe["electric-furnace"])
electricFurnaceRecipe.enabled = true
electricFurnaceRecipe.ingredients = {{"coin", 5}}
local steelChestRecipe = table.deepcopy(data.raw.recipe["steel-chest"])
steelChestRecipe.enabled = true
steelChestRecipe.ingredients = {{"coin", 5}}
data:extend{
transportBeltRecipe,
undergroundBeltRecipe,
splitterRecipe,
inserterRecipe,
pipeRecipe,
pipeToGroundRecipe,
electricFurnaceRecipe,
steelChestRecipe
}