Page 1 of 1
Getting Lua/ItemStack from inventory?
Posted: Wed Aug 12, 2015 4:18 am
by GopherAtl
I may just be missing the obvious due to lack of sleep, but I can't find any way to get the Lua/ItemStack objects from an inventory. There are a couple of specific exceptions - the player's currently held itemstack, and the item held by an inserter, but other than that, it seems like everything gives a Lua/SimpleItemStack, or gives the equivalent information in some other format like get_contents() on a Lua/Inventory object. For some items, blueprints in particular, probably modular armor as well, the Lua/ItemStack contains a lot of information that it seems there's no way to get at when they're just in a slot in an inventory.
Re: Getting Lua/ItemStack from inventory?
Posted: Wed Aug 12, 2015 6:39 am
by Rseding91
GopherAtl wrote:I may just be missing the obvious due to lack of sleep, but I can't find any way to get the Lua/ItemStack objects from an inventory. There are a couple of specific exceptions - the player's currently held itemstack, and the item held by an inserter, but other than that, it seems like everything gives a Lua/SimpleItemStack, or gives the equivalent information in some other format like get_contents() on a Lua/Inventory object. For some items, blueprints in particular, probably modular armor as well, the Lua/ItemStack contains a lot of information that it seems there's no way to get at when they're just in a slot in an inventory.
I updated the wiki for this:
https://forums.factorio.com/wiki/inde ... x_operator
Re: Getting Lua/ItemStack from inventory?
Posted: Wed Aug 12, 2015 12:09 pm
by GopherAtl
Rseding91 wrote:GopherAtl wrote:I may just be missing the obvious due to lack of sleep, but I can't find any way to get the Lua/ItemStack objects from an inventory. There are a couple of specific exceptions - the player's currently held itemstack, and the item held by an inserter, but other than that, it seems like everything gives a Lua/SimpleItemStack, or gives the equivalent information in some other format like get_contents() on a Lua/Inventory object. For some items, blueprints in particular, probably modular armor as well, the Lua/ItemStack contains a lot of information that it seems there's no way to get at when they're just in a slot in an inventory.
I updated the wiki for this:
https://forums.factorio.com/wiki/inde ... x_operator
:facepalm: yeah. I figured there had to be an obvious way I was missing XD Thankee-sai!