How to tell where a stack of ammo is?
Posted: Mon Apr 18, 2016 5:00 pm
I am looking for some help on how to tell if a stack of ammo is in an inventory, or in the weapon quickbar, and also if it is in the weapon quickbar what the prototype of the weapon it is attached to is. An example example of what I would like to be able to achieve is that I would like to be able to tell if a stack of shotgun shells is attached to a weapon, and if it is if that weapon is a standard shotgun or a combat shotgun.
I know that the LuaEntity class has the property selected_gun_index (http://lua-api.factorio.com/0.12.29/Lua ... _gun_index), Which allows you to find which gun is currently in use, but I do not know how to access the ammo it is using, or how to extend this idea for any ammo not attached to the weapon currently in use.
Any help would be much appreciated
I know that the LuaEntity class has the property selected_gun_index (http://lua-api.factorio.com/0.12.29/Lua ... _gun_index), Which allows you to find which gun is currently in use, but I do not know how to access the ammo it is using, or how to extend this idea for any ammo not attached to the weapon currently in use.
Any help would be much appreciated