Changing recipes that a mod changed

Place to get help with not working mods / modding interface.
Post Reply
DJQuad
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Tue Feb 18, 2020 2:41 pm
Contact:

Changing recipes that a mod changed

Post by DJQuad »

Hey all, I'm, simply trying to change some of the recipes that Space Exploration changed. I'm not getting any errors, but I'm not seeing it in my mods list. I have control.lua, data.lua, info.json, and item.lua in C:\Users\PC\AppData\Roaming\Factorio\mods\spex-def-recipies, and below is my item.lua. I'm not quite sure where to go from here.

--item.lua

local spex-def-recipies = table.deepcopy(data.raw["item"]["electronic-circuit"])

spex-def-recipies.name = "spex-def-recipies"
spex-def-recipies.icons = {
{
icon = spex-def-recipies.icon,
tint = {r=1,g=0,b=0,a=0.3}
},
}

local recipe = table.deepcopy(data.raw["recipe"]["electronic-circuit"])
recipe.enabled = true
recipe.name = "electronic-circuit"
recipe.ingredients = {{"copper-cable",3},{"iron-plate",1}}
recipe.result = "electronic-circuit"

data:extend{electronic-circuit,recipe}

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Changing recipes that a mod changed

Post by DaveMcW »

Post your data.lua and info.json.

User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Changing recipes that a mod changed

Post by jodokus31 »

Maybe this would do it?:

Code: Select all

data.raw["recipe"]["electronic-circuit"].ingredients = {{"copper-cable",3},{"iron-plate",1}}
in file data-updates.lua (or data-final-fixes.lua)

This changes the original recipe in a later data stage to ensure you overwrite former changes (https://lua-api.factorio.com/latest/Data-Lifecycle.html)

DJQuad
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Tue Feb 18, 2020 2:41 pm
Contact:

Re: Changing recipes that a mod changed

Post by DJQuad »

data.lua -

data.raw.recipe["electronic-circuit"].ingredients =
{
{"iron-plate", 1},
{"copper-cable", 3}
}

info.json -

{
"name": "spex-def-recipes",
"version": "0.9",
"title": "Space Exploration - Vanilla Recipes",
"author": "DJQuad",
"factorio_version": "1.0",
"dependencies": ["base >= 1.0"],["space-exploration >= 0.4.26"]
"description": "Reverts recipes for green circuits, inserters, and assemblers back to their vanilla versions."
}

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Changing recipes that a mod changed

Post by DaveMcW »

You need to include item.lua from data.lua.

Code: Select all

require("item")

DJQuad
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Tue Feb 18, 2020 2:41 pm
Contact:

Re: Changing recipes that a mod changed

Post by DJQuad »

Unfortunately that didn't help - I'm still not seeing it in the mod list.

Do you think it would be easiest to just make the recipe changes in the Space Exploration mod files themselves?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Changing recipes that a mod changed

Post by DaveMcW »

Post your factorio-current.log.

It is definitely easier to copy a mod, you are making many mistakes.

DJQuad
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Tue Feb 18, 2020 2:41 pm
Contact:

Re: Changing recipes that a mod changed

Post by DJQuad »

Tell me about it. Over my head for sure :)

https://pastebin.com/hZYCZbbz

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Changing recipes that a mod changed

Post by DaveMcW »

0.839 Error ModManager.cpp:910: Mod package read error. JSON parser error in package metadata: Unexpected character ([) at C:/Users/DELLPC/AppData/Roaming/Factorio/mods/spex-def-recipes/info.json:7
The dependencies line should be:
"dependencies": ["base >= 1.0", "space-exploration >= 0.4.26"],

DJQuad
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Tue Feb 18, 2020 2:41 pm
Contact:

Re: Changing recipes that a mod changed

Post by DJQuad »

Getting closer, yet so far away. :)

https://imgur.com/a/0JnD9A6

I should probably just ask in the modding requests forum for a mod that just resets recipes to their vanilla versions. :) https://mods.factorio.com/mod/YouModRecipe did seem promising but it hasn't been updated for 1.0

Post Reply

Return to “Modding help”