Page 1 of 1
LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name
Posted: Sun Feb 16, 2025 8:20 pm
by Quezler
On the discord Wiwiweb was wondering if the method could return multiple fluids, since with the current fluid mechanics mixing is just not possible:
https://discord.com/channels/1396775903 ... 0454679623
After some investigating it indeed seems impossible for this method to ever return more than 1 fluid name, and it should probably be mentioned:
Re: LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name
Posted: Sun Feb 16, 2025 8:54 pm
by Wiwiweb
A couple related changes:
https://lua-api.factorio.com/latest/types/FluidBox.html
"a fluid system (ie. multiple connected fluid boxes) can contain multiple different fluids, see Fluid mixing."
No such things as fluid systems anymore, and segments can only contain 1 fluid.
https://lua-api.factorio.com/latest/cla ... t_capacity
"The capacity of the given fluidbox index."
Actually this returns the capacity of the entire fluid segment (which is great). For the capacity of a specific entity or fluidbox, there's
https://lua-api.factorio.com/latest/cla ... d_capacity, or
https://lua-api.factorio.com/latest/cla ... prototypes
Re: LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name
Posted: Thu May 08, 2025 7:59 am
by Therenas
Thanks for the detailed report, fixed the things you mentioned. We'll consider changing the get_fluid_segment_contents method to only return a single value instead of a table.