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

Place to get help with not working mods / modding interface.
Post Reply
Datsyuk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Sep 05, 2016 12:06 pm
Contact:

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

Post 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"
    },

})

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 341
Joined: Tue Jul 08, 2014 10:06 am
Contact:

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

Post 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
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Datsyuk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Sep 05, 2016 12:06 pm
Contact:

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

Post 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} }}
            }
        }
    }

})

Datsyuk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Sep 05, 2016 12:06 pm
Contact:

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

Post by Datsyuk »

*Bump* in the hopes someone can help me. Still didn't figure it out.

User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 341
Joined: Tue Jul 08, 2014 10:06 am
Contact:

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

Post 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 ;)
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai

Datsyuk
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Sep 05, 2016 12:06 pm
Contact:

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

Post 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"}

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

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

Post 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

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

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

Post by Adil »

There's also crafting category on its own:

Code: Select all

  {
    type = "recipe-category",
    name = "farming"
  }
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Post Reply

Return to “Modding help”