Easy ability to detect whether crafting machine can use fluids
Posted: Wed May 20, 2020 2:44 pm
I was looking for a way to detect whether a machine can use fluids in its crafting, and it turns out this is not easy, if possible at all, to know.
One way is to look at fluidbox_prototypes, but since those also include sources for fuel and such, it's super convoluted to find out from there, if you even can.
Now I also saw the fluid_capacity field, which seemed to be perfect for my use case. It does however show 0 for every crafting machine. This is noted upon in the documentation, but it's not very helpful. What would make more sense is to have it show 0 for machines that can use fluids, and nil for those that can't, like assembling-machine-1.
Alternatively, one could also add a new flag or attribute that just tells me whether it can use fluids. I need this for Factory Planner so I can detect which machines should be offered for which recipes.
One way is to look at fluidbox_prototypes, but since those also include sources for fuel and such, it's super convoluted to find out from there, if you even can.
Now I also saw the fluid_capacity field, which seemed to be perfect for my use case. It does however show 0 for every crafting machine. This is noted upon in the documentation, but it's not very helpful. What would make more sense is to have it show 0 for machines that can use fluids, and nil for those that can't, like assembling-machine-1.
Alternatively, one could also add a new flag or attribute that just tells me whether it can use fluids. I need this for Factory Planner so I can detect which machines should be offered for which recipes.