Catalysts should automatically be reused
Posted: Fri Aug 09, 2019 3:35 pm
TL;DR
There is a "catalyst_amount" value for recipe ingredients/results. In the case where catalysts have some probability of being a result, the assembling-machine entity should automatically re-use the resulting catalyst, if the machine has room.What ?
I'm not entirely clear how the catalyst_amount value in the recipe ingredient and result prototype is used by the engine. I don't see it being used in any base mod prototypes. However, it is there! It can be set on items on both the ingredients and results side of the recipe prototype. One way to use this would be to say that a recipe takes iron and copper plates as catalysts, with some probability that the iron and copper plate survives the recipe as a result. For example,Code: Select all
ingredients = {{
type="fluid",
name="steam",
amount=100,
--fluidbox_index = 1
},{
type="fluid",
name="adamo-carbon-methane",
amount=100,
--fluidbox_index = 2
},{
type="item",
name="iron-plate",
amount=1,
catalyst_amount = 1
},{
type="item",
name="copper-plate",
amount=1,
catalyst_amount = 1
}},
results = {{
type="fluid",
name="heavy-oil",
amount=1,
--fluidbox_index = 1
},{
type="fluid",
name="light-oil",
amount=5,
--fluidbox_index = 2
},{
type="fluid",
name="petroleum-gas",
amount=20,
--fluidbox_index = 3
},{
type="item",
name="iron-plate",
amount=1,
catalyst_amount = 1,
probability = 0.8
},{
type="item",
name="copper-plate",
amount=1,
catalyst_amount = 1,
probability = 0.6
}}