So I want to iterate through all the barrels, which I know the game itself generates from all valid fluids, in order to create a new item based on each, and a corresponding recipe.
I found through looking at other mods that one can iterate over barrels as such in data-updates.lua:
Code: Select all
for _,r in pairs(data.raw.recipe) do
if r.subgroup=="fill-barrel" then
r.energy_required = TIME_FIL
r.ingredients[1].amount = CAP
elseif r.subgroup=="empty-barrel" then
r.energy_required = TIME_EMP
r.results[1].amount = CAP
end
end
I want to use the name of the barrel within the name of the item as well, and I am then unsure on how you'd go about generating locales for all of the items as well. In theory this should support any mod fluids as well as at this point they'll have been barrellised by the base game already.
Any ideas on how to do this? I understand you can add recipes and items with data:extend() which I've already done successfully but doing this "procedurally" is confusing.
The idea is silly and is effectively just compression, making "pallet of {barrel name}" with 1 wood and 4 barrels. Would have a reverse recipe too of course.

It's more just practice than anything else.
Thanks