Page 1 of 1

Add fluidbox capacity

Posted: Tue Apr 11, 2017 3:49 am
by devilwarriors
Hi,

it would be nice if you could add a way to get the capacity of a fluidbox in the fluidbox api.

Something like entity.fluidbox[1].capacity, that for exemple would return 2500 for storage-tank or 10 for pipe.

That would allow us to check for % filled, or know how much you can add to fill that fluid box.


Right know the way I found to do this are pretty hackish.

For assembler I can check the recipe and by luck (or design) it seem the ingredient are in the same order as the fluid box so I can multiply the ingredient amount by 2 and get the fluidbox capacity.

For storage-tank, offshore pump, pipe, boiler, generator, etc, it seem the only way is to either use a huge hack (https://mods.factorio.com/mods/Earendel ... prototypes)

or save the current amount the tank hold, add 99999 and then check how much it now contain and set the old value back (might trigger some hook in the game mecanic tho!?? havent tested yet).

Re: Add fluidbox capacity

Posted: Tue Apr 11, 2017 10:23 am
by Rseding91
Already added for 0.15.

Re: Add fluidbox capacity

Posted: Tue Apr 11, 2017 12:17 pm
by devilwarriors
Sweet thanks !