Page 1 of 1

[2.1.8] LuaSimulation::get_widget_position cannot locate recipe items inside Factoriopedia

Posted: Fri Jun 26, 2026 6:43 pm
by Shemp
zzz-ShempDebug_0.2.1.zip
(1.67 KiB) Downloaded 46 times
zzz-ShempDebug_0.1.0.zip
(1.62 KiB) Downloaded 40 times
Version 0.1.0 of the reproduction mod runs in Factorio 2.0.77 and produces the expected behaviour. Version 0.2.1 of the mod runs in Factorio 2.1.8 and produces incorrect behaviour. The two mods are identical except for info.json.

The mods each do the following:
  • It adds a Tips and Tricks item called "Test Factoriopedia" at the top of the T&T interface.
  • In this simulation, the player opens Factoriopedia on the "Iron chest (Item/Recipe)" page.
  • The simulation attempts to locate the "Iron plate" ingredient in the recipe on the right-hand side of Factoriopedia, using get_widget_position.
  • In 2.0, it will successfully move the cursor and click to open the Iron plate page.
  • In 2.1, a MapPosition is not returned, so it instead shows a flying text to indicate the error.
  • Factoriopedia is closed, and the simulation restarts.
The important part starts at Line 41 of data.lua, where I am treating the recipe item as a "simple-item-slot" in order to locate it.

I have tested using this call with other widget types, such as "label" or "item-group-tab", and they still work from within Factoriopedia.

Re: [2.1.8] LuaSimulation::get_widget_position cannot locate recipe items inside Factoriopedia

Posted: Mon Aug 17, 2026 4:04 pm
by boskid
Thanks for the report however from a technical point of view this is Not a bug. In 2.1 factoriopedia pages for recipe no longer uses simple slots based on ItemID, as due to recipe quality control it now uses simple slots based on ItemWithQualityID so your script correctly fails. Given that this bug report revealed a loophole in the LuaSimulation api, in 2.1.15 LuaSimulation::get_widget_position will accept new type=="simple-item-with-quality-slot" which will be able to get widget position of those new ingredients and product slots inside of factoriopedia.