Page 1 of 1

[2.x] Storage Chest API support for getting/setting quality on its filter

Posted: Fri Oct 25, 2024 12:55 pm
by billbo99
I've been working on some code to set the filter on storage chests and found no option to set the quality setting of the item in the filter.

https://lua-api.factorio.com/latest/cla ... age_filter

Before 2.0, I would set the filter using the item prototype. However, the 2.x API doc does not hint at how to set the quality.

Code: Select all

storage_chest.storage_filter = item_prototype
The same applies to reading the current filter. You can see the current LuaObject, but no quality information is provided.

Re: [2.x] Storage Chest API support for getting/setting quality on its filter

Posted: Fri Oct 25, 2024 11:13 pm
by ahicks
Another Factorio Access relevant request just wrt registering interest for some of these interface requests. Maybe we can work around this one with bleuprints. (I am assuming it's something one can do in vanilla, which I can't personally check). In general "if the frontend can do it and a mod can't, our players can't do it" is what we kinda have in our situation.

Re: [2.x] Storage Chest API support for getting/setting quality on its filter

Posted: Sat Nov 16, 2024 11:24 pm
by LCStark
Use the `set_filter` method:

Code: Select all

entity.set_filter(1, { type="item", name="iron-plate", quality="rare"})
11-17-2024, 00-24-40.png
11-17-2024, 00-24-40.png (33.62 KiB) Viewed 122 times
Edit
This works too:

Code: Select all

entity.storage_filter = { type="item", name="iron-plate", quality="rare"}
And I'm guessing here now, but I'd check if places where you've used ItemPrototype before aren't accepting ItemWithQualityID now.