Just to make sure we're clear, opening a blueprint book in character inventory is fine.
Opening a blueprint book nested *inside* another blueprint book is not.
Opening a blueprint inside a blueprint book is not.
Detailed repro:
1. Start a new freeplay game.
2. Place down the initial stone furnace.
3. Create a blueprint book, add it to the character inventory.
4. Create a blueprint of the stone furnace, and add it to the blueprint book in slot 1.
5. Close all GUIs.
6. In the console:
"/c script.on_event(defines.events.on_gui_opened, function (e) log(serpent.line(e)) end)"
"/c script.on_event(defines.events.on_gui_closed, function (e) log(serpent.line(e)) end)"
7. Open the character inventory. Open the blueprint book with RMB. Right-click the blueprint to open its GUI.
Observe the following events in the log:
Code: Select all
171.835 Script script.on_event(defines.events.on_gui_opened, function (e) log(serpent.line(e)) end):1: {gui_type = 3, name = 86, player_index = 1, tick = 9543}
174.454 Script script.on_event(defines.events.on_gui_opened, function (e) log(serpent.line(e)) end):1: {gui_type = 5, item = {__self = "userdata"}, name = 86, player_index = 1, tick = 9700}
175.954 Script script.on_event(defines.events.on_gui_opened, function (e) log(serpent.line(e)) end):1: {gui_type = 5, name = 86, player_index = 1, tick = 9790}
1st event is opening the controller GUI.
2nd event is opening the blueprint book. This event carries an "item" field.
3rd event is opening the blueprint. Note it has no "item" field.
8. Close the blueprint GUI and restore the blueprint book GUI by clicking the X. Repeat for the blueprint book, and the character inventory.
9. New events in the log:
Code: Select all
247.537 Script script.on_event(defines.events.on_gui_closed, function (e) log(serpent.line(e)) end):1: {gui_type = 5, name = 87, player_index = 1, tick = 14084}
278.100 Script script.on_event(defines.events.on_gui_closed, function (e) log(serpent.line(e)) end):1: {gui_type = 5, item = {__self = "userdata"}, name = 87, player_index = 1, tick = 15918}
279.718 Script script.on_event(defines.events.on_gui_closed, function (e) log(serpent.line(e)) end):1: {gui_type = 3, name = 87, player_index = 1, tick = 16015}
Again, note the first event (closing the blueprint GUI) has no "item" field.
0.001 2022-02-17 15:13:29; Factorio 1.1.53 (build 59373, win64, steam)
No mods enabled:
1.377 Loading mod core 0.0.0 (data.lua)
1.436 Loading mod base 1.1.53 (data.lua)
1.703 Loading mod base 1.1.53 (data-updates.lua)
1.802 Checksum for core: 1625176034
1.802 Checksum of base: 98178652
2.017 Prototype list checksum: 3034860339