Page 1 of 1

How do I have a recipe have a "made in" field?

Posted: Mon Sep 05, 2016 12:27 pm
by Datsyuk
Hey guys!

I have a recipe called Tree Farming, which is used in a Farm entity - which is based on an assembling machine. It works, but doesn't look like I want. I would like the recipe to look like Basic Oil Processing (see screenshot below). Notice that the oil processing recipe has a "made in" field, which shows in what building it can be made. I've looked at the prototype definitions in the base mod, but could not find where that is defined. My aim is to have the recipe have an abstract name (Tree Farming instead of 5x Tree Farming), a "Products" field and a "made in" field...

Image

Recipe category:

Code: Select all

data:extend({
    {
        type = "recipe-category",
        name = "farming"
    }
})
Recipe:

Code: Select all

data:extend({

    {
        type = "recipe",
        name = "tree-farming",
        category = "farming",
        energy_required = 1,
        enabled = true,
        ingredients =
        {
            {type="fluid", name="water", amount=10}
        },
        results=
        {
            {type="item", name="raw-wood", amount=5}
        },
        subgroup = "farming",
        enabled="false"
    },

})

Re: How do I have a recipe have a "made in" field?

Posted: Mon Sep 05, 2016 2:56 pm
by LuziferSenpai
Okay, you need to add the crafting-category farming.

Than you need to add this crafting-category to a machine. Tada, there you have your Made in!

Here is a exable!
Recipe Category
Recipe
Entity with recipe-category

Re: How do I have a recipe have a "made in" field?

Posted: Wed Sep 07, 2016 5:12 pm
by Datsyuk
I already have the crafting category in there, and it doesn't work.

Entity definition:

Code: Select all

data:extend({

    {
        type = "assembling-machine",
        name = "farm",
        icon = "__base__/graphics/icons/chemical-plant.png",
        flags = {"placeable-neutral","placeable-player", "player-creation"},
        minable = {hardness = 0.2, mining_time = 0.5, result = "farm"},
        max_health = 80,
        corpse = "big-remnants",
        dying_explosion = "explosion",
        collision_box = {{-1.4, -1.4}, {1.4, 1.4}},
        selection_box = {{-1.5, -1.5}, {1.5, 1.5}},
        module_specification =
        {
            module_slots = 0
        },
        --allowed_effects = {"consumption", "speed", "productivity", "pollution"},
        animation =
        {
            north =
            {
                filename = "__Biomass__/graphics/entity/farm.png",
                width = 156,
                height = 141,
                frame_count = 1,
                shift = {0.5, -0.078125}
            },
            west =
            {
                filename = "__Biomass__/graphics/entity/farm.png",
                x = 468,
                width = 156,
                height = 141,
                frame_count = 1,
                shift = {0.5, -0.078125}
            },
            south =
            {
                filename = "__Biomass__/graphics/entity/farm.png",
                x = 312,
                width = 156,
                height = 141,
                frame_count = 1,
                shift = {0.5, -0.078125}
            },
            east =
            {
                filename = "__Biomass__/graphics/entity/farm.png",
                x = 156,
                width = 156,
                height = 141,
                frame_count = 1,
                shift = {0.5, -0.078125}
            }
        },
        vehicle_impact_sound =  { filename = "__base__/sound/car-wood-impact.ogg", volume = 0.65 },
        working_sound =
        {
            sound =
            {
                {
                    filename = "__base__/sound/chemical-plant.ogg",
                    volume = 0.8
                }
            },
            idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 },
            apparent_volume = 1.5,
        },
        crafting_speed = 0.2,
        energy_source =
        {
            type = "electric",
            usage_priority = "secondary-input",
            emissions = - 0.03 / 3.5
        },
        energy_usage = "80kW",
        ingredient_count = 2,
        crafting_categories = {"farming"},
        fluid_boxes =
        {
            {
                production_type = "input",
                pipe_covers = pipecoverspictures(),
                base_area = 10,
                base_level = -1,
                pipe_connections = {{ type="input", position = {-1,-2} }}
            }
        }
    }

})

Re: How do I have a recipe have a "made in" field?

Posted: Tue Sep 13, 2016 4:45 pm
by Datsyuk
*Bump* in the hopes someone can help me. Still didn't figure it out.

Re: How do I have a recipe have a "made in" field?

Posted: Tue Sep 13, 2016 6:31 pm
by LuziferSenpai
Datsyuk wrote:*Bump* in the hopes someone can help me. Still didn't figure it out.
You need to add this crafting-categorie ;)

Re: How do I have a recipe have a "made in" field?

Posted: Mon Sep 19, 2016 5:47 pm
by Datsyuk
I guess I'm missing something, but as far as I can see, I already have the crafting category everywhere.

In the recipe:

Code: Select all

category = "farming"
In the entity definition:

Code: Select all

crafting_categories = {"farming"}

Re: How do I have a recipe have a "made in" field?

Posted: Mon Sep 19, 2016 6:55 pm
by DedlySpyder
Do you want to just post the whole mod so someone can flip through it then (or at least the prototypes)? That's probably better than just posting snippets

Re: How do I have a recipe have a "made in" field?

Posted: Mon Sep 19, 2016 7:11 pm
by Adil
There's also crafting category on its own:

Code: Select all

  {
    type = "recipe-category",
    name = "farming"
  }