LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name

User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name

Post 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:
Attachments
Screenshot 2025-02-16 at 21.20.04.png
Screenshot 2025-02-16 at 21.20.04.png (37.25 KiB) Viewed 393 times
User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Sat May 08, 2021 2:36 am
Contact:

Re: LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name

Post 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
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 324
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: LuaFluidBox::get_fluid_segment_contents() can return at most 1 fluid name

Post 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.
Post Reply

Return to “Resolved Requests”