Page 1 of 1

How to add crafting categories to recipes that can be crafted by hand.

Posted: Sat Oct 01, 2022 8:09 pm
by yaim904
Hello,

I hope you are well,

I need help with the following:
Create a few categories for the mod recipes, and all is well.
I want players to be able to craft the recipes of a category, but I can't find a way to do it.
The following code worked but not well

Code: Select all

local CharacterCategories = data.raw[ 'character' ][ 'character' ]
CharacterCategories = CharacterCategories[ 'crafting_categories' ]
table.insert( CharacterCategories, 1, 'xXx' )

local GodCategories = data.raw[ 'god-controller' ][ 'default' ]
GodCategories = GodCategories[ 'crafting_categories' ]
table.insert( GodCategories, 1, 'xXx' )
In the red circle you can see an object that is equivalent to 1K iron plate, in the yellow circle you can see the recipe that does the conversion.
Captura de pantalla (216).png
Captura de pantalla (216).png (136.96 KiB) Viewed 1735 times

The iron chests that can be created with the materials that you have, are calculated including my recipe, but you can see in the blue circle, the recipes of my category are not included in the calculations.

And in the green circle the calculations ignore my recipes again.
Captura de pantalla (218).png
Captura de pantalla (218).png (152.89 KiB) Viewed 1735 times

And even if I use the recipe and increase iron plate the recipes are not updated.
Captura de pantalla (219).png
Captura de pantalla (219).png (131.16 KiB) Viewed 1735 times

The following is the result when the above code is not executed.
Captura de pantalla (220).png
Captura de pantalla (220).png (131.91 KiB) Viewed 1735 times

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sat Oct 08, 2022 2:05 am
by yaim904
Hello, there is no way to do what I want?

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sat Oct 08, 2022 12:26 pm
by Bilka
Make sure that the recipes that should be queued automatically have https://wiki.factorio.com/Prototype/Rec ... termediate set to true.

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sun Oct 09, 2022 1:22 pm
by yaim904
Bilka wrote: Sat Oct 08, 2022 12:26 pm
Thanks for your answer.
I tried with that property and it didn't work.
Captura de pantalla (281).png
Captura de pantalla (281).png (248.58 KiB) Viewed 1613 times

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sun Oct 09, 2022 4:10 pm
by Bilka
yaim904 wrote: Sun Oct 09, 2022 1:22 pm
Bilka wrote: Sat Oct 08, 2022 12:26 pm
Thanks for your answer.
I tried with that property and it didn't work.

Captura de pantalla (281).png
In that screenshot your character doesnt seem to have the crafting categories. You need that and the other property.

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sun Oct 09, 2022 8:40 pm
by yaim904
Bilka wrote: Sun Oct 09, 2022 4:10 pm
What you say is true.
I created the category is for specific machines.

In this example the category I created is xXx
yaim904 wrote: Sat Oct 01, 2022 8:09 pm

Code: Select all

local CharacterCategories = data.raw[ 'character' ][ 'character' ]
CharacterCategories = CharacterCategories[ 'crafting_categories' ]
table.insert( CharacterCategories, 1, 'xXx' )

local GodCategories = data.raw[ 'god-controller' ][ 'default' ]
GodCategories = GodCategories[ 'crafting_categories' ]
table.insert( GodCategories, 1, 'xXx' )

But I want some of those recipes to be able to be made by hand, but not on other machines.

I know that if I remove the "category" property, the recipes can be made by hand, but they can also be made on machines other than the ones I want.

If I am not making myself understood, please ask the questions you need to understand.

Re: How to add crafting categories to recipes that can be crafted by hand.

Posted: Sun Feb 02, 2025 10:20 pm
by yaim904
Bilka wrote: Sun Oct 09, 2022 4:10 pm
It's been a long time since the last comment, but now I understand what you told me, thanks for the help.

Update: 2025 02 03
Today I tried to update my MOD following the directions you gave me and it doesn't work.
I have version 2.0.32, here is the code I'm using and the images

I am creating alternative recipes and have created the recipes for the other objects, but only with this one the problem occurs.

Code: Select all

data:extend({ {
    ['type'] = 'recipe',
    ['name'] = 'zzzYAIM904-9000-u-iron-gear-wheel',
    ['icon'] = '__base__/graphics/icons/iron-gear-wheel.png',
    ['ingredients'] = {
        [1] = {
            ['type'] = 'item',
            ['name'] = 'wood',
            ['amount'] = 1
        }
    },
    ['results'] = {
        [1] = {
            ['type'] = 'item',
            ['name'] = 'iron-gear-wheel',
            ['amount'] = 10
        }
    },
    ['localised_name'] = {
        [1] = '',
        [2] = {
            [1] = 'item-name.iron-gear-wheel'
        }
    },
} })
Without the alternative recipe
I have enough iron plates to build conveyor belts and burner inserter.
Captura de pantalla (744).png
Captura de pantalla (744).png (1.11 MiB) Viewed 39 times
Captura de pantalla (745).png
Captura de pantalla (745).png (1.1 MiB) Viewed 39 times
With the alternative recipe
inserters what?
Captura de pantalla (746).png
Captura de pantalla (746).png (1.11 MiB) Viewed 39 times
Captura de pantalla (747).png
Captura de pantalla (747).png (1.11 MiB) Viewed 39 times
How fixed??
It's a bug??