entity.get_inventories () -- returns a list of inventory defines valid for this entity
Usually you know what inventory you want to use, but when you do not, it is a nightmare.
Ultimately something like the above or another way to find out what items and how many you will get from deconstructing an entity (including inputs, outputs, modules, fuel etc) would be helpful as there seems to a massive gap in the capability of the API trying to do so.
entity.get_inventories()
Re: entity.get_inventories()
It seems like it's possible to do now, though there's a bit of work involved and possibly some guessing if you want the exact name. You can find a demo here.
Script result:
Script result:
Re: entity.get_inventories()
I added LuaControl::get_max_inventory_index() read for the next 1.1 release.
The way the C++ code does it is: loop from 1 to <= max and call get_inventory. If it returns non-nil you have an inventory. If it's nil you skip it and continue to the next index.
The way the C++ code does it is: loop from 1 to <= max and call get_inventory. If it returns non-nil you have an inventory. If it's nil you skip it and continue to the next index.
If you want to get ahold of me I'm almost always on Discord.
Re: entity.get_inventories()
thank you sir that will help!