Just a few things that could help when working with equipment grids.
#1 LuaEquipmentGrid::get_contents() → dictionary string → uint similar to LuaInventory::get_contents() returns equipment_name and count
#2 LuaEquipmentGrid::shield (r) and LuaEquipmentGrid::max_shield (r) similar to same fields in LuaEquipment except totaled for all/read only
#3 LuaEntity::get_armor_grid() -> luaEquipmentGrid returns the armor grid for the entity if it has one, similar to the other get_specific_inv functions
Thanks for looking in to this!
LuaEquipmentGrid Contents/Shield
Re: LuaEquipmentGrid Contents/Shield
http://lua-api.factorio.com/latest/LuaE ... ntity.grid already exists
As for the other two: I'll add them for 0.15.
As for the other two: I'll add them for 0.15.
If you want to get ahold of me I'm almost always on Discord.
Re: LuaEquipmentGrid Contents/Shield
Thanks!
And I really wish I would have seen entity.grid before now! in fact I think I did but my brain didn't put 2 and 2 together.
And I really wish I would have seen entity.grid before now! in fact I think I did but my brain didn't put 2 and 2 together.
Re: LuaEquipmentGrid Contents/Shield
Nix that. I shouldn't respond when not fully awake.
Regarding #3
entity.grid just returns the entities grid.
entity.get_armor_grid() would get the entities armor grid if it exists (is weaing armor and armor has a grid). Similar to how the entity.get_fuel_inventory() function works
get armor_grid would be like the get_fuel_inventory() a shortcut to getting the armor grid
return entity.get_inventory(defines.inventory.armor)[1].grid returning the grid or nil if anything isn't valid inbetween
Regarding #3
entity.grid just returns the entities grid.
entity.get_armor_grid() would get the entities armor grid if it exists (is weaing armor and armor has a grid). Similar to how the entity.get_fuel_inventory() function works
get armor_grid would be like the get_fuel_inventory() a shortcut to getting the armor grid
return entity.get_inventory(defines.inventory.armor)[1].grid returning the grid or nil if anything isn't valid inbetween
Re: LuaEquipmentGrid Contents/Shield
I made entity.grid work for the character for 0.15.
If you want to get ahold of me I'm almost always on Discord.