Return temperature with get_fluid_contents

Things that we aren't going to implement
Honktown
Smart Inserter
Smart Inserter
Posts: 1045
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Return temperature with get_fluid_contents

Post by Honktown »

It's not uncommon for a mod to use LuaEntity.get_fluid_contents() and inadvertently need to be patched later because of temperatures. I'd like to request temperature be returned as a second argument, or at least, indicate that temperatures may matter and the function "doesn't completely describe the fluid"
I have mods! I guess!
Link
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3323
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Return temperature with get_fluid_contents

Post by boskid »

Unfortunately this interface request in current shape is a no-go. LuaEntity::get_fluid_contents does not return a per-fluidbox fluids, in some cases it is able to return amount of fluids that are not stored in a FluidBox but a regular Fluid container (FluidWagon, FluidTurret). If an entity would have 2 fluidboxes, one with steam at 165deg and second with steam at 500deg, LuaEntity::get_fluid_contents will return total amount of steam without any extra details of what those temperatures are because the temperature would have to be weighted somehow which would be useless in general when there are multiple fluid containers with same fluid inside of entity. FluidTurret has 2 fluid containers: one of a FluidBox as it behaves as a pipe, and one from internal buffer. Those 2 fluids could have a different temperature.
Post Reply

Return to “Won't implement”