[2.0.x] recipes making and/or using item-with-tags

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Anonymous Monkey
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Nov 13, 2017 10:04 pm
Contact:

[2.0.x] recipes making and/or using item-with-tags

Post by Anonymous Monkey »

This is a 2-part request:

1) Recipe that results in an item-with-tags:

Extend the results table to include type="item-with-tags" that includes a tags field that will generate the given tags when the item is manufactured in an assembler.
item-with-tags would be an ItemWithTagsProductPrototype

Code: Select all

{
    type = "recipe",
    ...
    results = {
                   { 
                       type = "item-with-tags",
                       name = "mod-item-w-tags",
                       amount = 1,
                       tags = { resource = { name="coal", amount ="25" } }
                   }
              },
    ...
}
The ItemWithTagsProductPrototype could have the ItemProductPrototype as a base class.


2) Collate tags from ingredients into result (if result is "item-with-tags"):

This one may be a bit more to implement.
An assembly-machine using an "item-with-tags" (1 or more) that results in an "item-with-tags" collects the tags from the input and puts them all into the result's tags. This would likely include merging tables.

"another-item-w-tags".tags = { another_tag = "some data" }

Code: Select all

{
    type = "recipe",
    ingredients = {
        {name = "steel", amount = 20},
        {name = "iron-plate", amount = 50},
        {name = "mod-item-w-tags", amount = 1},
        {name = "another-item-w-tags", amount = 1}
    },
    results = {
        { type = "item-with-tags", name = "mod-item-with-tags2", amount = 1 }
    },
    ...
}
mod-item-with-tags2 would have the tags = { resource = {name = "coal", amount = 25 }, another_tag = "some data" }

I've only seen item-with-tags being used in mods ( I just have the base game ), so this would only affect mods (I think), but would simplify some recipe configurations that could use "generic" items with their manufacture/building. (like this sample which would be a fuel pack that would be a part of an automated train manufacture mod (the fuel would be unpacked into 25 coal, put into the locomotive fuel tank)).

This would help me a lot, and open up a few possibilities for others!

Thanks
Post Reply

Return to “Modding interface requests”