Code: Select all
fluid_wagon.get_fluid(1)
Code: Select all
fluid_wagon.set_fluid(1,fluid)
Code: Select all
fluid_wagon.get_fluid(1)
Code: Select all
fluid_wagon.set_fluid(1,fluid)
I didn't see that connection at all because I thought fluids_count was the total size of the fluid storage in the entity, not the number fluid containers in it that can be indexed by get_fluid. This connection definitely needs to be documented in get_fluid and set_fluid for the limits of the 'index' parameter, especially since they are far apart in the docums listing.Osmo wrote: Tue Sep 02, 2025 1:33 pm It is documented on https://lua-api.factorio.com/latest/cla ... uids_count which get_fluid indirectly links to, but that's not very noticeable
...but it is documented. https://lua-api.factorio.com/latest/cla ... #get_fluid says explicitly what the valid range is and links to fluids_count. And the description mentions "fluid storage", which is suspicious if you expect it to just be fluidboxes.robot256 wrote: Tue Sep 02, 2025 1:55 pm This connection definitely needs to be documented in get_fluid and set_fluid for the limits of the 'index' parameter, especially since they are far apart in the docums listing.
Thank you, apparently I can't read. The other thing that threw me off was the declaration "ged_fluid(index)" and the description "gets the i-th fluid". No, it gets the "index-th" fluid ...curiosity wrote: Tue Sep 02, 2025 4:00 pm...but it is documented. https://lua-api.factorio.com/latest/cla ... #get_fluid says explicitly what the valid range is and links to fluids_count. And the description mentions "fluid storage", which is suspicious if you expect it to just be fluidboxes.robot256 wrote: Tue Sep 02, 2025 1:55 pm This connection definitely needs to be documented in get_fluid and set_fluid for the limits of the 'index' parameter, especially since they are far apart in the docums listing.