Page 1 of 1

Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 8:17 pm
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}

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 8:33 pm
by DaveMcW
Post your data.lua and info.json.

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 8:39 pm
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)

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:08 pm
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."
}

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:13 pm
by DaveMcW
You need to include item.lua from data.lua.

Code: Select all

require("item")

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:32 pm
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?

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:44 pm
by DaveMcW
Post your factorio-current.log.

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

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:49 pm
by DJQuad
Tell me about it. Over my head for sure :)

https://pastebin.com/hZYCZbbz

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 9:55 pm
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"],

Re: Changing recipes that a mod changed

Posted: Thu Oct 22, 2020 10:21 pm
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