Page 1 of 1

Multiple questions regarding items and categories

Posted: Mon Aug 10, 2020 7:12 am
by Suf
Hi all
First question:
While i'm trying to assign an item that can be crafted via certain entity i got this message Difficulty normal: Value must be a string in property tree at ROOT
now i don't know if i misunderstood that message,but according to the recipe prototype page normal and expensive seem optional to put as a code?
even though i put them both i still got the same message.am i missing something here?

Second question:
is there a way to tell Factorio in lua that specific item can be crafted in that specific entity?
an example:can i tell Factorio that iron plate can be smelted using only stone furnace and not electric furnace?

Third question:
While i'm making category i've decided to remove any vanilla categories as well,but i don't know how to do so;i was searching for similar mods that achieved the same idea,i used the code but it seems that just added the category that i wanted but not removed every vanilla category in the process,so how to do that?

Thanks in advance :D

Re: Multiple questions regarding items and categories

Posted: Mon Aug 10, 2020 9:55 am
by DaveMcW
1. You missed the last word of this error message. It tells you which property is causing the error.

2. Yes, each machine can have its own crafting_categories. You need to put the recipe in a unique recipe-category and remove it from all the others.

3. data.raw["recipe-category"]["smelting"] = nil

Re: Multiple questions regarding items and categories

Posted: Mon Aug 10, 2020 10:46 am
by Suf
DaveMcW wrote: Mon Aug 10, 2020 9:55 am 1. You missed the last word of this error message. It tells you which property is causing the error.

2. Yes, each machine can have its own crafting_categories. You need to put the recipe in a unique recipe-category and remove it from all the others.

3. data.raw["recipe-category"]["smelting"] = nil
thanks for the information
about the 1st question it was about recipe.item name.normal.result,as i said in the question i added both normal and expensive in the item.lua file,but still the same result.

Re: Multiple questions regarding items and categories

Posted: Mon Aug 10, 2020 6:34 pm
by Suf
Problem solved,thanks for the help ;)

Re: Multiple questions regarding items and categories

Posted: Tue Aug 11, 2020 4:15 pm
by Suf
Suf wrote: Mon Aug 10, 2020 10:46 am
DaveMcW wrote: Mon Aug 10, 2020 9:55 am 1. You missed the last word of this error message. It tells you which property is causing the error.

2. Yes, each machine can have its own crafting_categories. You need to put the recipe in a unique recipe-category and remove it from all the others.

3. data.raw["recipe-category"]["smelting"] = nil
thanks for the information
about the 1st question it was about recipe.item name.normal.result,as i said in the question i added both normal and expensive in the item.lua file,but still the same result.
about the 3rd question i got this error Error in assignID: recipe-category with name 'smelting' does not exist. It was removed by my mod.

Re: Multiple questions regarding items and categories

Posted: Tue Aug 11, 2020 5:24 pm
by DaveMcW
You also have to remove it from every recipe and furnace. It might be better to just do that and let the recipe-category still exist.

Re: Multiple questions regarding items and categories

Posted: Tue Aug 11, 2020 7:44 pm
by Suf
DaveMcW wrote: Tue Aug 11, 2020 5:24 pm You also have to remove it from every recipe and furnace. It might be better to just do that and let the recipe-category still exist.
Can i void the items instead? i'm assuming it would be the same result.

Re: Multiple questions regarding items and categories

Posted: Thu Aug 13, 2020 5:31 am
by Suf
So i voided the items and that didn't work,seems you can't really remove an item but only move it from one category into another.is there a way to truly remove the category aside from using data.raw["recipe-category"]["category name"] = nil.