Page 1 of 1

[0.17.3] Inconsistent behavior with blueprints in the shortcut bar (and no mod access to blueprint data)

Posted: Thu Feb 28, 2019 9:33 pm
by dewiniaid
If a blueprint created in-game as an item (not the library) is placed in a quickbar slot, but is then moved into a chest, the blueprint is no longer placeable .

If the blueprint is then destroyed, it is removed from the quickbar.

If a blueprint is moved from the library directly onto the quickbar, it appears unavailable (it is dimmed out), but can be placed anyways. There is no physical item in the inventory in this case.

If a blueprint is copied from the library to the inventory, and then from the inventory to the quickbar, and then moved to a chest, it is no longer placeable.

If the chest is then destroyed, the blueprint shows as unavailable but magically becomes placeable again.



Modding:
(Context: I want to write a mod that exports/imports quickbar presets so they can be transferred between saves using a mechanism similar to blueprint strings; it's how I found the above.)

LuaPlayer::get_quick_bar_slot() on a quickbar slot containing a reference to a blueprint in the library returns nilaa

There is no way for a mod to determine which blueprint/book/decon planner is occupying a slot.

There is no way for a mod to set a specific blueprint/book/decon planner to a quickbar slot.

Proposed fix to the last last two: Have LuaPlayer::get_quick_bar_slot() return a second 'data' argument equivalent to either LuaItemStack::export_stack() or a Lua representation thereof (prior to the base64/deflate step), and add an optional third argument LuaPlayer::set_quick_bar_slot() for this data.

Re: [0.17.3] Inconsistent behavior with blueprints in the shortcut bar (and no mod access to blueprint data)

Posted: Fri Mar 01, 2019 4:46 pm
by MightyMooquack
Confirmed that LuaPlayer::get_quick_bar_slot() returns nil when a blueprint is in the slot. This is inconvenient, since I'm trying to make a mod that adds an item to the first empty quickbar slot. As-is, it will overwrite any blueprints.

Re: [0.17.3] Inconsistent behavior with blueprints in the shortcut bar (and no mod access to blueprint data)

Posted: Thu May 09, 2019 12:15 pm
by Twinsen
The issues and inconsistencies mentioned should be fixed in Version: 0.17.38.

Regarding the modding part, unfortunately we have no API for working with the blueprint library, so unfortunately what you want can't be done yet.
We looked into the other modding issues and it's also problematic. See viewtopic.php?p=416593#p416593