Page 1 of 1

How do I create an 'item-request-proxy' to update existing modules?

Posted: Mon Jun 27, 2022 7:16 pm
by tkausl
I'm trying to replace existing modules in a building using a 'item-request-proxy'.

I'm creating the proxy simply with

Code: Select all

surface.create_entity({
    name="item-request-proxy",
    position=other.position,
    force=other.force,
    target=other,
    modules=items
})
Where 'other' is a valid entity and 'items' is a valid module table. When the building is empty, it gets filled correctly. When it has (a different set) of modules however, nothing really changes. Using the upgrade-planner to replace modules works the way its supposed to. Looking at both 'item-request-proxy' entities (the one created by the upgrade planner and the one created by me), they seem to have the exact same properties (apart from position and target entity of course), yet the upgrade planner 'item-request-proxy' replaces the modules while mine does not.

What am I missing?