Page 1 of 1

Need help with mod

Posted: Mon Jan 12, 2015 4:32 pm
by speedy45
I need help with this mod I download from this link:

https://forums.factorio.com/forum/vie ... =51&t=4831

So my issue is simple I trying to change the recipe to the default items in the game, and also I am asking this because I got duplicate items in the recipe, and need help please?

Re: Need help with mod

Posted: Mon Jan 12, 2015 9:18 pm
by L0771
\prototypes\recipe.lua
can change all what you want.

Re: Need help with mod

Posted: Tue Jan 13, 2015 5:05 am
by speedy45
yes I know that but my problem is this these screenshots:

Re: Need help with mod

Posted: Tue Jan 13, 2015 5:36 am
by SuperSandro2000
You have made to entires with copper(or steel).

Re: Need help with mod

Posted: Tue Jan 13, 2015 6:02 am
by speedy45
oh ok I can't figure out how to change this with no duplicates

Re: Need help with mod

Posted: Tue Jan 13, 2015 8:50 am
by ForFoxAche
speedy45 wrote:oh ok I can't figure out how to change this with no duplicates
Put your recipes file on pastebin or put the recipes here so we can see what they look like

Re: Need help with mod

Posted: Tue Jan 13, 2015 10:50 am
by speedy45
ok here is the recipe for that I edit from his mod:

Code: Select all

data:extend(
{
  {
    type = "recipe",
    name = "boiler-2",
    enabled = "false",
    ingredients =
    {
      {"boiler", 1},
    },
    result = "boiler-2",
  },

  {
    type = "recipe",
    name = "boiler-3",
    enabled = "false",
    ingredients =
    {
      {"boiler-2", 1},
    },
    result = "boiler-3",
  },

  {
    type = "recipe",
    name = "boiler-4",
    enabled = "false",
    ingredients =
    {
      {"boiler-3", 1},
    },
    result = "boiler-4",
  },
}
)


table.insert(data.raw["recipe"]["boiler-2"].ingredients,{"steel-furnace", 1})

if data.raw.item["steel-pipe"] then
  table.insert(data.raw["recipe"]["boiler-2"].ingredients,{"steel-plate", 1})
end


if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["boiler-3"].ingredients,{"copper-plate", 5})
else
  table.insert(data.raw["recipe"]["boiler-3"].ingredients,{"steel-plate", 8})
end


if data.raw.item["iron-gear-wheel"] then
  table.insert(data.raw["recipe"]["boiler-3"].ingredients,{"iron-gear-wheel", 1})
end



if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["boiler-4"].ingredients,{"copper-plate", 5})
else
  table.insert(data.raw["recipe"]["boiler-4"].ingredients,{"steel-plate", 10})
end

if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["boiler-4"].ingredients,{"electronic-circuit", 1})
end


data:extend(
{
  {
    type = "recipe",
    name = "steam-engine-2",
    enabled = "false",
    ingredients =
    {
      {"steam-engine", 1},
    },
    result = "steam-engine-2",
  },
  {
    type = "recipe",
    name = "steam-engine-3",
    enabled = "false",
    ingredients =
    {
      {"steam-engine-2", 1},
    },
    result = "steam-engine-3",
  },
}
)

local num = 5

if data.raw.item["iron-gear-wheel"] then
  table.insert(data.raw["recipe"]["steam-engine-2"].ingredients,{"iron-gear-wheel", 5})
else
  num = 7
end

table.insert(data.raw["recipe"]["steam-engine-2"].ingredients,{"steel-plate", num})

if data.raw.item["steel-gear-wheel"] then
  table.insert(data.raw["recipe"]["steam-engine-2"].ingredients,{"copper-plate", num})
else
  table.insert(data.raw["recipe"]["steam-engine-2"].ingredients,{"advanced-circuit", num * 2})
end




if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"electronic-circuit", 5})
else
  table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"advanced-circuit", 5})
end

num = 5

if data.raw.item["iron-gear-wheel"] then
  table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"iron-gear-wheel", 5})
else
  if data.raw.item["copper-plate"] then
    table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"copper-plate", 5})
  else
    num = 7
  end
end

if data.raw.item["iron-gear-wheel"] then
  table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"iron-gear-wheel", num})
else
  if data.raw.item["copper-plate"] then
    table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"copper-plate", num})
  else
    if data.raw.item["iron-gear-wheel"] then
      table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"iron-gear-wheel", num * 2})
    else
      table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"advanced-circuit", num * 3})
    end
  end
end


if data.raw.item["steel-plate"] then
  table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"steel-plate", num})
else
  if data.raw.item["advanced-circuit"] then
    table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"advanced-circuit", num})
  else
    table.insert(data.raw["recipe"]["steam-engine-3"].ingredients,{"copper-plate", num * 2})
  end
end


data:extend(
{
  {
    type = "recipe",
    name = "solar-panel-small",
    enabled = "false",
    ingredients =
    {
      {"steel-plate", 2},
      {"electronic-circuit", 7},
      {"copper-plate", 2}
    },
    result = "solar-panel-small"
  },

  {
    type = "recipe",
    name = "solar-panel-large",
    enabled = "false",
    ingredients =
    {
      {"steel-plate", 9},
      {"electronic-circuit", 27},
      {"copper-plate", 9},
    },
    result = "solar-panel-large"
  },


  {
    type = "recipe",
    name = "solar-panel-small-2",
    enabled = "false",
    ingredients =
    {
      {"solar-panel-small", 1},
    },
    result = "solar-panel-small-2"
  },

  {
    type = "recipe",
    name = "solar-panel-2",
    enabled = "false",
    ingredients =
    {
      {"solar-panel", 1},
    },
    result = "solar-panel-2"
  },

  {
    type = "recipe",
    name = "solar-panel-large-2",
    enabled = "false",
    ingredients =
    {
      {"solar-panel-large", 1},
    },
    result = "solar-panel-large-2"
  },


  {
    type = "recipe",
    name = "solar-panel-small-3",
    enabled = "false",
    ingredients =
    {
      {"solar-panel-small-2", 1},
    },
    result = "solar-panel-small-3"
  },

  {
    type = "recipe",
    name = "solar-panel-3",
    enabled = "false",
    ingredients =
    {
      {"solar-panel-2", 1},
    },
    result = "solar-panel-3"
  },

  {
    type = "recipe",
    name = "solar-panel-large-3",
    enabled = "false",
    ingredients =
    {
      {"solar-panel-large-2", 1},
    },
    result = "solar-panel-large-3"
  },
}
)


if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"electronic-circuit", 2})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"copper-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"steel-plate", 8})
else
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"iron-gear-wheel", 2})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"copper-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"steel-plate", 7})
end

if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"electronic-circuit", 4})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"copper-plate", 9})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"advanced-circuit", 16})
else
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"iron-gear-wheel", 4})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"steel-plate", 9})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"advanced-circuit", 16})
end

if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"copper-plate", 2})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"steel-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"advanced-circuit", 8})
else
  table.insert(data.raw["recipe"]["solar-panel-small-2"].ingredients,{"electronic-circuit", 2})
  table.insert(data.raw["recipe"]["solar-panel-2"].ingredients,{"copper-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-2"].ingredients,{"steel-plate", 7})
end



if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"copper-plate", 2})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"steel-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"electronic-circuit", 8})
else
  if data.raw.item["steel-plate"] then
    table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"steel-plate", 2})
    table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"advanced-circuit", 4})
    table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"copper-plate", 8})
  else
    table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"copper-plate", 4})
    table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"iron-gear-wheel", 9})
    table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"steel-plate", 16})
  end
end

if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"copper-plate", 16})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"steel-plate", 36})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"electronic-circuit", 64})
else
  if data.raw.item["steel-plate"] then
    table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"steel-plate", 2})
    table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"copper-plate", 4})
    table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"iron-plate", 8})
  end
end

if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"electronic-circuit", 4})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"copper-plate", 8})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"steel-plate", 16})
else
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"processing-unit", 2})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"processing-unit", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"processing-unit", 8})
end

if data.raw.item["advanced-circuit"] then
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"advanced-circuit", 2})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"advanced-circuit", 4})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"advanced-circuit", 8})
else
  table.insert(data.raw["recipe"]["solar-panel-small-3"].ingredients,{"copper-plate", 4})
  table.insert(data.raw["recipe"]["solar-panel-3"].ingredients,{"copper-plate", 9})
  table.insert(data.raw["recipe"]["solar-panel-large-3"].ingredients,{"copper-plate", 16})
end



data:extend(
{
  {
    type = "recipe",
    name = "fast-accumulator",
    enabled = "false",
    ingredients =
    {
      {"iron-plate", 2},
      {"battery", 5},
    },
    result = "fast-accumulator"
  },

  {
    type = "recipe",
    name = "large-accumulator",
    enabled = "false",
    ingredients =
    {
      {"iron-plate", 2},
      {"battery", 5},
    },
    result = "large-accumulator"
  },


  {
    type = "recipe",
    name = "basic-accumulator-2",
    enabled = "false",
    ingredients =
    {
      {"basic-accumulator", 1},
      {"steel-plate", 2},
      {"battery", 5},
    },
    result = "basic-accumulator-2"
  },

  {
    type = "recipe",
    name = "large-accumulator-2",
    enabled = "false",
    ingredients =
    {
      {"large-accumulator", 1},
      {"steel-plate", 2},
      {"battery", 5},
    },
    result = "large-accumulator-2"
  },

  {
    type = "recipe",
    name = "fast-accumulator-2",
    enabled = "false",
    ingredients =
    {
      {"fast-accumulator", 1},
      {"steel-plate", 2},
      {"battery", 5},
    },
    result = "fast-accumulator-2"
  },


  {
    type = "recipe",
    name = "basic-accumulator-3",
    enabled = "false",
    ingredients =
    {
      {"basic-accumulator-2", 1},
    },
    result = "basic-accumulator-3"
  },

  {
    type = "recipe",
    name = "large-accumulator-3",
    enabled = "false",
    ingredients =
    {
      {"large-accumulator-2", 1},
    },
    result = "large-accumulator-3"
  },

  {
    type = "recipe",
    name = "fast-accumulator-3",
    enabled = "false",
    ingredients =
    {
      {"fast-accumulator-2", 1},
    },
    result = "fast-accumulator-3"
  },
}
)


if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["basic-accumulator-2"].ingredients,{"electronic-circuit", 5})
  table.insert(data.raw["recipe"]["large-accumulator-2"].ingredients,{"iron-gear-wheel", 5})
  table.insert(data.raw["recipe"]["fast-accumulator-2"].ingredients,{"copper-plate", 5})
else
  table.insert(data.raw["recipe"]["basic-accumulator-2"].ingredients,{"advanced-circuit", 5})
  table.insert(data.raw["recipe"]["large-accumulator-2"].ingredients,{"advanced-circuit", 5})
  table.insert(data.raw["recipe"]["fast-accumulator-2"].ingredients,{"advanced-circuit", 5})
end



if data.raw.item["copper-plate"] then
  table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"copper-plate", 2})
  table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"steel-plate", 2})
  table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"iron-gear-wheel", 2})
else
  if data.raw.item["copper-plate"] then
    table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"copper-plate", 2})
    table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"electronic-circuit", 2})
    table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"advanced-circuit", 2})
  else
    table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"steel-plate", 4})
    table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"steel-plate", 4})
    table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"steel-plate", 4})
  end
end

if data.raw.item["battery"] then
  table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"battery", 5})
  table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"battery", 5})
  table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"battery", 5})
else
  table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"battery", 8})
  table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"battery", 8})
  table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"battery", 8})
end

if data.raw.item["electronic-circuit"] then
  table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"electronic-circuit", 5})
  table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"electronic-circuit", 5})
  table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"electronic-circuit", 5})
else
  table.insert(data.raw["recipe"]["basic-accumulator-3"].ingredients,{"processing-unit", 5})
  table.insert(data.raw["recipe"]["large-accumulator-3"].ingredients,{"processing-unit", 5})
  table.insert(data.raw["recipe"]["fast-accumulator-3"].ingredients,{"processing-unit", 5})
end

Re: Need help with mod

Posted: Tue Jan 13, 2015 2:07 pm
by Choumiko
A guess: you modified the conditions e.g. if data.raw.item["electronic-circuit"] then ? Another guess: instead of electronic circuits it had a mod item in it? Just remove all the stuff with if else and keep the recipes, e.g.

Code: Select all

{
type = "recipe",
name = "solar-panel-small-2",
enabled = "false",
ingredients =
{
{"solar-panel-small", 1},
{"electronic-circuit", 6},
{"copper-plate", 2}
},
result = "solar-panel-small-2"
},
Hope this helps
Eidt: I just glanced at the mod's original file. You shouldn't need to edit anything to get the standard items in the recipe if you don't have Bob's ores/chemicals (or how they are called) installed.

Re: Need help with mod

Posted: Tue Jan 13, 2015 2:22 pm
by speedy45
oh ok I try that and it work just fine and so thanks for your help and yes I did use the resetrecipes commands.