Page 1 of 1

[2.0.60] LuaLogisticNetwork documentation for logistic_robots

Posted: Wed Jul 23, 2025 10:32 pm
by Farzag
In the documentation for LuaLogisticNetwork, it is not clear that logistic_robots is a list of those robots that are active, and does not include robots inside the roboport. I expected that the number of items in that array would be the same as all_logistic_robots, but I guess those inside the roboport are not considered part of the network.

I suggest amending the documentation to make it clear that logistic_robots and construction_robots refer to "All robots in this logistic network, and therefore does not include those that are idle inside the roboport". It would have saved me a few hours at least :)

Re: [2.0.60] LuaLogisticNetwork documentation for logistic_robots

Posted: Wed Jul 23, 2025 10:41 pm
by boskid
There is some amount of prior knowledge when working with factorio lua api, one of the most important ones you seem to be missing is what an Entity is and what an Item is: Entity is an object that is on the surface (this also includes blueprints), while an Item is an object that is inside of item stack (this includes inventories). Robots that are flying are in their Entity form, while robots inside of a roboport are in their Item form. Given that LuaLogisticNetwork::logistic_robots is documented as returning array of entities, it is already described enough that it only contains robots that are flying and not those that are inside of a roboport because it is not possible to obtain entity reference for an item. Because of that i am considering this part of docs to be correct and as such i am not considering this topic to be bug report worthy.

Re: [2.0.60] LuaLogisticNetwork documentation for logistic_robots

Posted: Wed Jul 23, 2025 11:00 pm
by Farzag
Thank you, with that reminder it is indeed clearer. Appreciate it!