Add fluid system number read to LuaFluidBox
Add fluid system number read to LuaFluidBox
The fluid system number looks very useful to tell whether two fluidboxes are connected to each other without snaking over every pipe segment in-between. The game is already keeping track of it and showing it on the debug tooltip, why not put a getter function to the Lua object? Something like LuaFluidBox.get_system_number(index).
Re: Add fluid system number read to LuaFluidBox
ID of a FluidSystem is not part of the game state, it is not save-loaded. If you build pipes, save the game and reload you will get different id of the fluid system. Because of that it cannot be given as it would desync. It is a value only for the purpose of debugging. Similar case is with rail block id's.
If anything, method that would accept 2 fluid boxes could return bool if they both belong to the same fluid system.
If anything, method that would accept 2 fluid boxes could return bool if they both belong to the same fluid system.
Re: Add fluid system number read to LuaFluidBox
That function should be enough to check for connectivity, yes. Thanks.
edit: isn't the content of a fluidbox returned from the operator [] just the fluid data? how do you get the reference for the two separate fluidboxes for the parameters, then?
edit: isn't the content of a fluidbox returned from the operator [] just the fluid data? how do you get the reference for the two separate fluidboxes for the parameters, then?
Re: Add fluid system number read to LuaFluidBox
I could like to request that this be made part of gamestate. It would SIGNIFICANTLY reduce the complexity of my Pipe Visualizer mod.
Don't forget, you're here forever.
Re: Add fluid system number read to LuaFluidBox
But a method to tell if two fluid boxes are connected won't?
Re: Add fluid system number read to LuaFluidBox
OK. It is now implemented for 1.1.54.
1.1.54's changelog wrote:Added LuaFluidBox::get_fluid_system_id() method.