How to add resource to new resource category?

Place to get help with not working mods / modding interface.
Amidamaru4433
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Sep 23, 2017 1:00 pm
Contact:

How to add resource to new resource category?

Post by Amidamaru4433 »

How I can to add resource to new resource category? For example, I have ore, which is can mineable only with special expensive mining drill.
I create new category:

Code: Select all

data:extend({
{
    type = "resource-category",
    name = "new_ore"
  },
})

and adding to my mining drill this property

Code: Select all

resource_categories = {"new_ore"},
But I don't understand, how to add my resource to this category, resources haven't properties, associated with categories. Pls, help me solve this problem :cry:
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: How to add resource to new resource category?

Post by daniel34 »

Moved from Modding interface requests to Modding help.

crude-oil has this in the resources.lua:

Code: Select all

    category = "basic-fluid",
The other resources don't have such a line, so I assume the default value is basic-solid, since the vanilla game only has basic-solid and basic-fluid as resource categories.

Have you tried setting the category that way?

Another approach you could take is setting the mining hardness of your new ore a little bit higher, and give your new mining drill a little bit more mining power, so the ore can only be mined with your mining drill. I'm not sure how that mining drill would interact with existing ores though.
quick links: log file | graphical issues | wiki
Amidamaru4433
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Sep 23, 2017 1:00 pm
Contact:

Re: How to add resource to new resource category?

Post by Amidamaru4433 »

daniel34 wrote: crude-oil has this in the resources.lua:

Code: Select all

    category = "basic-fluid",
wow, [category = "new_ore",] is really work! Now my miner can be placed only on my ore, which is what I wanted! how could I not notice such an easy decision... I checked everything, but I always ignored the oil.
Big thanks for fast and useful help!
Post Reply

Return to “Modding help”