Recipe Override not working

Place to get help with not working mods / modding interface.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Recipe Override not working

Post by Ranakastrasz »

I've been using a mod to alter some recipes for a while all of it worked fine. However, for some reason, when I tried to chance the recipe for electric poles and substation, those specific recipes were uneffected.

The file runs, so it isn't like I didnt call it from data.lua

Code: Select all

--Iron Gear
--[[data.raw["recipe"]["iron-gear-wheel"].ingredients = 
{
	{"iron-plate",1} -- 2
}]]--
--Chest
--[[data.raw["item"]["copper-cable"].subgroup = "intermediate-product"]]--
data.raw["recipe"]["inserter"].ingredients = 
{
  {"electronic-circuit", 1},
  {"burner-inserter", 1}
}

--data.raw["recipe"]["electronic-circuit"].energy_required = 1.0 -- 0.5
--data.raw["recipe"]["electronic-circuit"].ingredients = 
--{
--	{"iron-plate", 1},
--	{"copper-cable", 6} -- 3
--}
--[[data.raw["recipe"]["advanced-oil-processing"].results=
    {
      {type="fluid", name="heavy-oil", amount=4},
      {type="fluid", name="light-oil", amount=4},
      {type="fluid", name="petroleum-gas", amount=7}
    }]]--
--[[data.raw["recipe"]["basic-oil-processing"].subgroup = "fluid"
data.raw["recipe"]["advanced-oil-processing"].subgroup = "fluid"
data.raw["recipe"]["heavy-oil-cracking"].subgroup = "fluid"
data.raw["recipe"]["light-oil-cracking"].subgroup = "fluid"
data.raw["recipe"]["lubricant"].subgroup = "fluid"
data.raw["recipe"]["sulfuric-acid"].subgroup = "fluid"]]--

--[[data.raw["recipe"]["advanced-circuit"].energy_required = 8 -- 8
data.raw["recipe"]["advanced-circuit"].result_count = 1
data.raw["recipe"]["advanced-circuit"].ingredients = 
{
  {"electronic-circuit", 1}, -- 2
  {"plastic-bar"       , 2}, -- 2
  {"copper-cable"      , 3}  -- 4
}]]--


--[[data.raw["recipe"]["processing-unit"].energy_required = 15 -- 15
data.raw["recipe"]["processing-unit"].result_count = 1
data.raw["recipe"]["processing-unit"].ingredients = 
{
  {"red-wire", 2},
  {"green-wire", 2},
  --{"electronic-circuit", 5}, -- 20
  {"advanced-circuit"  , 1}, -- 2
  {type="fluid", name = "sulfuric-acid", amount = 0.5} -- 0.5
}]]--
	-- Poles
data.raw["electric-pole"]["medium-electric-pole"].ingredients =
    {
      {"steel-plate", 2},
      {"copper-cable", 4}
    }
data.raw["electric-pole"]["big-electric-pole"].ingredients =
    {
      {"steel-plate", 5},
      {"copper-cable", 10}
    }

data.raw["electric-pole"]["substation"].ingredients =
    {
      {"steel-plate", 10},
      {"advanced-circuit", 5},
      {"copper-cable", 20}
    }
    
	-- Furnaces
data.raw["recipe"]["steel-furnace"].ingredients = 
{
	{"stone-furnace",1},
	{"steel-plate", 8},
	{"stone-brick", 8} -- 10
}
    
data.raw["recipe"]["electric-furnace"].ingredients = 
{
	{"steel-furnace",1}, -- 10 stone brick
	{"steel-plate", 8}, -- 15
	{"advanced-circuit", 5} -- 5
}

if data.raw["recipe"]["double-furnace"] then
data.raw["recipe"]["double-furnace"].ingredients =
    {
	  {"steel-furnace",1},
      {"steel-plate", 8},
      {"advanced-circuit", 2},
      {"stone-brick", 2}
    }
end

--Belts
--[[data.raw["recipe"]["fast-transport-belt-to-ground"].ingredients = 
{
	{"fast-transport-belt", 4}, -- 0
	{"iron-gear-wheel", 2}, -- 20
	{"basic-transport-belt-to-ground", 2} -- 2
}
	
data.raw["recipe"]["express-transport-belt-to-ground"].category = "crafting-with-fluid"
data.raw["recipe"]["express-transport-belt-to-ground"].ingredients = 
{
	{"express-transport-belt", 4}, -- 0
	{"iron-gear-wheel", 4}, -- 40
	{"fast-transport-belt-to-ground", 2}, -- 2
	{type="fluid", name="lubricant", amount=4} -- 0
}

data.raw["recipe"]["fast-splitter"].ingredients = 
{
	{"basic-splitter", 1}, -- 1
	{"fast-transport-belt", 2}, -- 0
	{"iron-gear-wheel", 2}, -- 10
	{"electronic-circuit", 10} -- 10
}

data.raw["recipe"]["express-splitter"].category = "crafting-with-fluid"
data.raw["recipe"]["express-splitter"].ingredients = 
{
	{"fast-splitter", 1}, -- 1
	{"express-transport-belt", 2}, -- 0
	{"iron-gear-wheel", 4}, -- 10
	{"advanced-circuit", 10}, -- 10
	{type="fluid", name="lubricant", amount=8} -- 8
}
data.raw["recipe"]["concrete"].ingredients =
{
    {"stone-brick", 5},
    {"iron-stick", 1},
    {type="fluid", name="water", amount=10}
}
data.raw["recipe"]["green-wire"].ingredients = {}
data.raw["recipe"]["red-wire"].ingredients = {}
]]--
--[[
Speed -> Overclock, Lubricant
Efficiency -> Superconducting, Artifact.
Productivity -> Miniaturization, Smart Inverters
]]--
--[[
data.raw["recipe"]["speed-module"].ingredients =
    {
      {"advanced-circuit", 5},
      {"electronic-circuit", 5}
    }
data.raw["recipe"]["speed-module-2"].ingredients =
    {
      {"speed-module", 4},
      {"processing-unit", 5},
      {"advanced-circuit", 5}
    }
data.raw["recipe"]["speed-module-3"].ingredients =
    {
      {"speed-module-2", 4},
      {"advanced-circuit", 5},
      {"processing-unit", 5},
      {"alien-artifact", 1}
    }

data.raw["recipe"]["productivity-module"].ingredients =
    {
      {"advanced-circuit", 5},
      {"electronic-circuit", 5}
    }
data.raw["recipe"]["productivity-module-2"].ingredients =
    {
      {"productivity-module", 4},
      {"processing-unit", 5},
      {"advanced-circuit", 5}
    }
data.raw["recipe"]["productivity-module-3"].ingredients =
    {
      {"productivity-module-2", 4},
      {"advanced-circuit", 5},
      {"processing-unit", 5},
      {"alien-artifact", 1}
    }

data.raw["recipe"]["effectivity-module"].ingredients =
    {
      {"advanced-circuit", 5},
      {"electronic-circuit", 5}
    }
data.raw["recipe"]["effectivity-module-2"].ingredients =
    {
      {"effectivity-module", 4},
      {"processing-unit", 5},
      {"advanced-circuit", 5}
    }
data.raw["recipe"]["effectivity-module-3"].ingredients =
    {
      {"effectivity-module-2", 4},
      {"advanced-circuit", 5},
      {"processing-unit", 5},
      {"alien-artifact", 1}
    }]]--
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Recipe Override not working

Post by DaveMcW »

If you remove the mess of comments, it's easier to see what you did wrong.
Ranakastrasz wrote:data.raw["recipe"]["iron-gear-wheel"].ingredients =
data.raw["recipe"]["electronic-circuit"].ingredients =
data.raw["recipe"]["advanced-circuit"].ingredients =
data.raw["recipe"]["processing-unit"].ingredients =
data.raw["electric-pole"]["medium-electric-pole"].ingredients =
data.raw["electric-pole"]["big-electric-pole"].ingredients =
data.raw["electric-pole"]["substation"].ingredients =
data.raw["recipe"]["steel-furnace"].ingredients =
data.raw["recipe"]["electric-furnace"].ingredients =
data.raw["recipe"]["double-furnace"].ingredients =
data.raw["recipe"]["fast-transport-belt-to-ground"].ingredients =
data.raw["recipe"]["express-transport-belt-to-ground"].ingredients =
data.raw["recipe"]["fast-splitter"].ingredients =
data.raw["recipe"]["express-splitter"].ingredients =
data.raw["recipe"]["concrete"].ingredients =
data.raw["recipe"]["green-wire"].ingredients = {}
data.raw["recipe"]["red-wire"].ingredients = {}
data.raw["recipe"]["speed-module"].ingredients =
data.raw["recipe"]["speed-module-2"].ingredients =
data.raw["recipe"]["speed-module-3"].ingredients =
data.raw["recipe"]["productivity-module"].ingredients =
data.raw["recipe"]["productivity-module-2"].ingredients =
data.raw["recipe"]["productivity-module-3"].ingredients =
data.raw["recipe"]["effectivity-module"].ingredients =
data.raw["recipe"]["effectivity-module-2"].ingredients =
data.raw["recipe"]["effectivity-module-3"].ingredients =
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Recipe Override not working

Post by aubergine18 »

If you're updating that many recipes, it might be worth creating a helper function to make your code more readable:

Code: Select all

local function recipe( name )
  return data.raw.recipe[name]
end

-- then use it like this:

recipe("inserter").ingredients = {
  {"electronic-circuit", 1},
  {"burner-inserter", 1}
}

recipe("advanced-oil-processing").subgroup = "fluid"

-- or if making multiple changes to a recipe

local r = recipe("advanced-circuit")

r.result_count = 1
r.ingredients = {
  {"electronic-circuit", 1},
  {"plastic-bar"       , 2},
  {"copper-cable"      , 3}
}
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Recipe Override not working

Post by Ranakastrasz »

Ouch.

That explains SOOOO Much.


Thanks.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Post Reply

Return to “Modding help”