Getting Lua/ItemStack from inventory?
Getting Lua/ItemStack from inventory?
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.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Re: Getting Lua/ItemStack from inventory?
I updated the wiki for this: https://forums.factorio.com/wiki/inde ... x_operatorGopherAtl 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.
If you want to get ahold of me I'm almost always on Discord.
Re: Getting Lua/ItemStack from inventory?
:facepalm: yeah. I figured there had to be an obvious way I was missing XD Thankee-sai!Rseding91 wrote:I updated the wiki for this: https://forums.factorio.com/wiki/inde ... x_operatorGopherAtl 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.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections