Page 1 of 1

Chemical Plant crafting help [RESOLVED]

Posted: Sun May 01, 2016 11:24 am
by charga600
Hey all,
Been playing Factorio for a while and loving it but one of my biggest problems with the game is late-game power. Seems like I always en up with fields of boilers, steam engines, solar panels and accumulators. Now I know there are a few mos out there that add additional power generation but seeing as there is a portable fusion reactor already in the game, why can't we have a large, normal fusion reactor for powering our factories?
OK so you can see where this is going and what I'm going, the issue I've come across when creating the mod is that the was I want to do this is to have the player process water in a chemical plant along with a single iron plate to create deuterium (a hydrogen isotope) to be used to power the reactor. Only trouble is when launching the game with the mod in it's current state it throws an error "recipe deuterium is in crafting category but has a non-item ingredient Water."
The game then closes once I hit OK. The mod runs fine if I comment out the requirement for water as a crafting ingredient but throws that error when it is left in.

Here are the files I'd think are relevant to show you guys to help you help me :D , let me know if there are any other files you need to see

data.lua

Code: Select all

require("prototypes.item")
require("prototypes.recipe")
require("prototypes.fluid-recipe")
require("prototypes.entity")
require("prototypes.technology")
item.lua

Code: Select all

data:extend(
{
	{
    type = "item",
    name = "reactor-plate",
    icon = "__BigFusionReactor__/graphics/icons/Missing_Texture.png",
    flags = {"goes-to-quickbar"},
    subgroup = "intermediate-product",
	order = "k-[reactor-plate]",
    stack_size = 50
    },
    {
    type = "item",
    name = "deuterium",
    icon = "__BigFusionReactor__/graphics/icons/Missing_Texture.png",
    flags = {"goes-to-main-inventory"},
    subgroup = "raw-material",
    order = "h[deuterium]",
    stack_size = 10
   }
}
)
recipe.lua

Code: Select all

data:extend({
 {
    type = "recipe",
    name = "reactor-plate",
    enabled = false,
	energy_required = 3,
    ingredients = 
    {
      {"copper-plate", 5},
      {"iron-plate", 10},
	  {"plastic-bar", 2}
    },
    result = "reactor-plate"
  }
})
fluid-recipe.lua

Code: Select all

data:extend({
  {
    type = "recipe",
    name = "deuterium",
	catagory = "chemistry",
	energy_required = 10,
	enabled = false,
    ingredients = 
    {
	  {type = "item", name = "iron-plate", amount = 1},
      {type = "fluid", name = "water", amount = 10}
    },
    results = 
	{
	   {type = "item", name = "deuterium", amount = 1}
    }
  }
})
The item, deuterium, would be most similar to plastic bars, in that it is crafted in a chemical plant and require a single fluid input and a single item input to produce a single item input, but that's where something, at least I'd assume, is going wrong. Thanks in advance and let me know if there is any other information you need :)

Re: Chemical Plant crafting help

Posted: Sun May 01, 2016 12:19 pm
by Sean Mirrsen
I think you've misspelled "category" in the recipe's definition, causing the game to default to giving it the "crafting" category by default instead of the "chemistry" category as you intended, and throwing the error.

I'm actually surprised that error exists at all. It should at most be a warning.

Re: Chemical Plant crafting help

Posted: Sun May 01, 2016 12:26 pm
by charga600
Aha! It's always the simple mistakes isn't it :P
Thanks mate, would have taken me a while to notice that one :)