Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting modules as ingredients #136

Open
SWeini opened this issue Feb 16, 2023 · 0 comments
Open

Inserting modules as ingredients #136

SWeini opened this issue Feb 16, 2023 · 0 comments
Labels

Comments

@SWeini
Copy link

SWeini commented Feb 16, 2023

Describe the Bug

Some buildings/recipes take modules as recipe ingredient. Vanilla construction bots fill the modules of the item request proxy to the module slots first, then to the ingredient inventory. I expect nanobots to have the same behavior as construction bots.

To Reproduce

Build this vanilla blueprint and observe the difference between construction bots and nanobots.

0eNp9j80OgjAQhN9lzq1RFMS+ijGGnw1uQhdCi5GQvrstXjh53J+Z+WZF3c80TiweZgU3gziY+wrHnVR92vllJBiwJwsFqWyaKufI1j1Lp23VvFhInxEUWFr6wJzCQ4HEs2f6+W3D8pTZ1jTFh/9OCuPgoniQRBAN9fGQKywwl0MeYyZqeKNyI1Gr7dDOPeks6hKmS6L9BSYPiWjrYHaVFd40uS0mK0+X6y27FkVeFmUZwhcQpl1b

Construction bots:
image

Nanobots:
image

Implications

This might not sound relevant for vanilla, but PyAlienLife has lots of recipes/buildings with the same modules as ingredients, which you need to build on a large scale.

Technical Details

Nanobots fill the modules to the ingredient inventory first, using the https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.insert method in https://github.com/Nexela/Nanobots/blob/master/scripts/nanobots.lua#L339

I have also opened a bug report for vanilla, because I believe that the current behavior of click-inserting is not what people expect or would ever need in this case.

In the meantime maybe the solution is to "insert" into https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_module_inventory first, "insert"ing only those that didn't fit directly into the entity.

@SWeini SWeini added the bug label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant