Add fluidbox capacity

Post Reply
devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Add fluidbox capacity

Post 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).
Last edited by devilwarriors on Wed Apr 12, 2017 12:13 am, edited 1 time in total.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add fluidbox capacity

Post by Rseding91 »

Already added for 0.15.
If you want to get ahold of me I'm almost always on Discord.

devilwarriors
Filter Inserter
Filter Inserter
Posts: 311
Joined: Sat Jan 09, 2016 1:11 am
Contact:

Re: Add fluidbox capacity

Post by devilwarriors »

Sweet thanks !

Post Reply

Return to “Implemented mod requests”