[2.0.60] LuaLogisticNetwork documentation for logistic_robots

Place to report issues and suggest improvements to the API documentation.
Farzag
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Jan 20, 2018 1:59 am
Contact:

[2.0.60] LuaLogisticNetwork documentation for logistic_robots

Post 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 :)
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4050
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.60] LuaLogisticNetwork documentation for logistic_robots

Post 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.
Farzag
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sat Jan 20, 2018 1:59 am
Contact:

Re: [2.0.60] LuaLogisticNetwork documentation for logistic_robots

Post by Farzag »

Thank you, with that reminder it is indeed clearer. Appreciate it!
Post Reply

Return to “Documentation Improvement Requests”