Page 1 of 1

[0.17.64] on_built_entity always has item_requests = nil

Posted: Sat Aug 10, 2019 6:10 am
by Optera
Problem:
When building an entity containing modules the entity returned by on_built_entity and on_robot_built_entity have item_requests = nil.

Reproduce:
Create a ghost with modules.
Build only the entity.

The entity returned in the build events does not contain item_requests.
Later in tick handler the entity again has item_requests set.

Expected:
Entity returned by build events contains the same item_requests as the ghost.

Re: [0.17.64] on_built_entity always has item_requests = nil

Posted: Sat Aug 10, 2019 4:09 pm
by Rseding91
Thanks for the report however what you describe never worked that way and doesn't actually work as you describe.

item_requests only works on ghosts and item request proxies. A normal entity will never have any value for that property. Robots do not build ghosts so there is never an event fired by a robot that would ever possibly have item_requests set. https://lua-api.factorio.com/latest/Lua ... m_requests

The only time item_requests would be set is when building ghosts through a blueprint and in that case the entity during on_built_entity *does* contain item_requests.
Capture.PNG
Capture.PNG (464.04 KiB) Viewed 1275 times

Re: [0.17.64] on_built_entity always has item_requests = nil

Posted: Sun Aug 11, 2019 4:40 pm
by Optera
In that case the bug changes to a missing API event for creation of item-request-proxy.