[2.1.8] Error requesting fluid box prototype of ghost
Posted: Fri Jun 26, 2026 12:37 pm
When I build a ghost pipe next to a real pipe, the following happens:
On the pipe entity, get_fluid_box_neighbours(1) returns a connection with target=the ghost-entity containing the ghost pipe.
On the ghost pipe entity, get_fluid_box_prototype(1) causes an error, "Unable to create LuaFluidBoxPrototype for entity-ghost from a given FluidBoxPrototype pointer 0x00000283405f24e8".
On the ghost pipe entity, ghost_prototype.fluidbox_prototypes[1] returns the LuaFluidBoxPrototype object I need.
I was expecting at least the prototype method to be redirected to the inner entity of the ghost. I'm not really surprised that a ghost does not have a full LuaFluidBox object, and there is an easy workaround.
If this behavior is intentional, then I think the error message could be improved to something like "Cannot read fluid box from ghost pipe". And I would suggest it be added to the LuaEntity page which get_fluid_box_* methods do not work on ghosts.
On the pipe entity, get_fluid_box_neighbours(1) returns a connection with target=the ghost-entity containing the ghost pipe.
On the ghost pipe entity, get_fluid_box_prototype(1) causes an error, "Unable to create LuaFluidBoxPrototype for entity-ghost from a given FluidBoxPrototype pointer 0x00000283405f24e8".
On the ghost pipe entity, ghost_prototype.fluidbox_prototypes[1] returns the LuaFluidBoxPrototype object I need.
I was expecting at least the prototype method to be redirected to the inner entity of the ghost. I'm not really surprised that a ghost does not have a full LuaFluidBox object, and there is an easy workaround.
If this behavior is intentional, then I think the error message could be improved to something like "Cannot read fluid box from ghost pipe". And I would suggest it be added to the LuaEntity page which get_fluid_box_* methods do not work on ghosts.