Page 1 of 1

[2.1.15] get_widget_position on "quickbar-slot" type doesn't succeed when missing "quality" in filter table

Posted: Mon Aug 24, 2026 6:46 pm
by Shemp
This is a loose follow-up to 134386 and the rework of LuaSimulation::get_widget_position.

Steps to reproduce:
zzz-ShempDebug_0.2.1.zip
(2.88 KiB) Downloaded 18 times
  • Download the reproduction mod above.
  • Enter a game world and view the "Entity pipette" Tips and Tricks item.
  • The simulation will fail after placing the Stone furnaces, while attempting to access the Burner inserters from the Quickbar.
The mod contains an edited version of that Tip's simulation script, where the "filter" ItemFilter in get_widget_position's argument has had the "quality" field removed.

Go to Line 76 of data.lua, or Ctrl-F "SHEMP EDIT" to find it.

Code: Select all

local target = game.simulation.get_widget_position({type = "quickbar-slot", filter = {name="burner-inserter"}})
Expected result:

Because "quality" is documented to be optional on the ItemFilter page, I expect this call to successfully return the position of the inserters from the Quickbar, as if the string variant of ItemFilter had been used:

Code: Select all

local target = game.simulation.get_widget_position({type = "quickbar-slot", filter = "burner-inserter"})
I will also note that using an ItemFilter table without "quality" does succeed when querying the new "simple-item-with-quality-slot". (otherwise I wouldn't consider this a bug)

Re: [2.1.15] get_widget_position on "quickbar-slot" type doesn't succeed when missing "quality" in filter table

Posted: Mon Aug 24, 2026 7:08 pm
by boskid
Thanks for the report however i will have to classify this as Not a bug.

There are indeed 2 target types that accept ItemFilter, "simple-item-with-quality-slot" and "quickbar-slot", however they are using ItemFilter differently:
- in case of "simple-item-with-quality-slot" the gui slots are specified by ItemWithQualityID and as such ItemFilter is used as a "filter": if ItemWithQualityID fulfills the filter, it is a match and the widget is selected.
- in case of "quickbar-slot" the gui slots are specified by ItemFilter (https://lua-api.factorio.com/2.1.15/con ... rSlot.html "filter") and as such what you provide in as ItemFilter must be equal: same id, same quality filter, same comparison.

Because you are not providing quality nor a comparison, you are asking to find a quickbar slot that is filtered for burner inserter of any quality, and it fails because your quickbar slot has quality set and it is different.