Double Assembling Machine
Double Assembling Machine
It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.
Re: Double Assembling Machine
The whole mod code:Mecejide wrote: Sat Nov 28, 2020 11:21 pm It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.
Code: Select all
data:extend({
{
type = "recipe",
name = "electronic-circuit",
energy_required = 2.5,
ingredients =
{
{"copper-plate", 3},
{"iron-plate", 2}
},
result = "electronic-circuit",
result_count = 2
}
})
Re: Double Assembling Machine
That code looks like it only adds a single recipe.darkfrei wrote: Tue Dec 01, 2020 10:00 pmThe whole mod code:Mecejide wrote: Sat Nov 28, 2020 11:21 pm It’s like https://mods.factorio.com/mod/DoubleFurnace, except it’s an assembling machine. This means it assembles one type of item, such as copper cable, and then uses that type of item to assemble another, such as electronic circuits. In the example I gave, the overall recipe would be 3 copper plate+2 iron plate+2.5 seconds->2 electronic circuit.Code: Select all
data:extend({ { type = "recipe", name = "electronic-circuit", energy_required = 2.5, ingredients = { {"copper-plate", 3}, {"iron-plate", 2} }, result = "electronic-circuit", result_count = 2 } })
Re: Double Assembling Machine
Yes, you are need to define what pairs of recipes must be compound. You cannot say: "do all recipes!"
You are need defined pairs, same as by your example. No example - no recipe.
Re: Double Assembling Machine
You could probably make a gnarly recursive algorithm to do this, but... it would be gnarly.darkfrei wrote: Wed Dec 02, 2020 8:07 amYes, you are need to define what pairs of recipes must be compound. You cannot say: "do all recipes!"
You are need defined pairs, same as by your example. No example - no recipe.
Take a given recipe, read the ingredients.
Search existing recipes for each ingredient.
If recipe exists, replace the ingredient in the first recipe with the ingredients in the second.
Repeat until you can't find a recipe.
Subject to unforseen obstacles, of course. Like when the ingredient is from multiple recipes.
Re: Double Assembling Machine
Now you build rocket parts from ore and crude oil.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Double Assembling Machine
It's the recycling/scrapping algorithm in reverse. Break all ingredients down into the ingredients from their recipes. Continue until nothing can be broken down further. Add all the constituent ingredients together. In this case you could maybe stop it after just one or two iterations so that you avoid the ore -> rockets effect, but since the original poster has a history of posting incredibly terse, vague requests and then complaining when people don't read his mind, I'm not going to try and guess what it is he wants.
Re: Double Assembling Machine
What I want is an assembling machine that crafts the equivalent of two assembling machine recipes at a time. For example, it could make an engine unit from a steel plate, iron plates, and pipes or from a steel plate, iron plates, and an iron gear wheel but not iron plates, an iron gear wheel, and pipes (because steel plates aren’t made in an assembling machine); from a steel plate and iron plates (because that would be three recipes, not two); or from a steel plate, an iron gear wheel, and pipes (because that would be one recipe, also not two, and it would be a waste of resources since the double assembling machine should be pretty expensive).
Re: Double Assembling Machine
So you'd need an algorithm that decomposes ingredients into their constituents, subject to filtering, e.g. you don't decompose a steel plate, and you'd only apply it on the ingredients of the item you're intending to make.Mecejide wrote: Wed Dec 02, 2020 6:26 pm What I want is an assembling machine that crafts the equivalent of two assembling machine recipes at a time. For example, it could make an engine unit from a steel plate, iron plates, and pipes or from a steel plate, iron plates, and an iron gear wheel but not iron plates, an iron gear wheel, and pipes (because steel plates aren’t made in an assembling machine); from a steel plate and iron plates (because that would be three recipes, not two); or from a steel plate, an iron gear wheel, and pipes (because that would be one recipe, also not two, and it would be a waste of resources since the double assembling machine should be pretty expensive).
I think trying to make an assembling machine that you pick a recipe and you can input the ingredients from one step removed would be much harder.
Re: Double Assembling Machine
You could make a whitelist of which components should not be decomposed, everything made in furnaces for example.
Re: Double Assembling Machine
Now you build rocket parts from iron plates and copper plates (and crude oil).kirazy wrote: Wed Dec 02, 2020 8:35 pm You could make a whitelist of which components should not be decomposed, everything made in furnaces for example.
Re: Double Assembling Machine
Which is where you don't apply the algorithm generally. He's not asking to make everything from their base components, only to be able to do a two-step recipe process in one-step, so rather than an assembling machine for copper cables into an assembling machine for electronic circuits, you'd have one machine for electronic circuits taking the inputs for copper cables in addition to its normal inputs.
For something like rocket parts, you'd have intermediaries at one remove, not all the way to maximum decomposed.