Can't change pipe recipe?

Place to get help with not working mods / modding interface.
Post Reply
Doctor_Willis
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Sep 26, 2023 11:45 am
Contact:

Can't change pipe recipe?

Post by Doctor_Willis »

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?

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
}

Bilka
Factorio Staff
Factorio Staff
Posts: 3140
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Can't change pipe recipe?

Post by Bilka »

The pipe recipe has recipe difficulty, meaning that you need to change the ingredients and enabled status inside "normal" (and "expensive" if you want to affect expensive mode).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Doctor_Willis
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Sep 26, 2023 11:45 am
Contact:

Re: Can't change pipe recipe?

Post by Doctor_Willis »

Thanks Bilka. I knew I was missing something!

Post Reply

Return to “Modding help”