Page 1 of 1
How to hack fluid system? (editing LUA scripts)
Posted: Fri Sep 21, 2018 4:47 pm
by andyfth
I want unlimited pipe/pump/tank throughput. Eg. if I have 25000 oil in a tank; it's instantly available by a single pipe. No matter lenght. Also fluids in connected tanks are instantly balanced....etc.
In the past I was editing stuff like size of chest/vagons, energy comsumsion of machines, maximum number of modules per machine etc.
But I can figure out, how to hack fluids system.
Do you have ideas? I know there are mods, but I'm lazy replacing old pipes by mod pipes.
Re: How to hack fluid system? (editing LUA scripts)
Posted: Sat Sep 22, 2018 12:06 pm
by darkfrei
https://lua-api.factorio.com/latest/LuaFluidBox.html
A fluid box is represented as a table:
name :: string: Fluid prototype name of the fluid contained in this fluid box.
amount :: double: Amount of the fluid in this box.
temperature :: double (optional): The temperature. When reading from LuaFluidBox, this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid box will be set to the fluid's default temperature as specified in the fluid's prototype.
Re: How to hack fluid system? (editing LUA scripts)
Posted: Sat Sep 22, 2018 6:11 pm
by quyxkh
To make inspection easier:
Code: Select all
/c psd={comment=false,nocode=true} function gpsl(p,k) return game.print(serpent.line(p,k or psd)) end
To see what's in a fluid box:
Code: Select all
/c gpsl(game.player.selected.fluidbox[1])
To set it:
Code: Select all
/c gps=game.player.selected gps.fluidbox[1]={name='crude-oil',amount=gps.fluidbox.capacity(1)}
Some fluid boxes have multiple inventories, poke around.