My mod Autodrive allows to automatically refuel vehicles and refill their ammo slots. When it is refueling vehicles, it also tries to refuel equipment items in the vehicle grid.
I know that LuaEquipmentPrototype can have attack_parameters if the equipment is an ActiveDefenseEquipmentPrototype. I suppose it would be possible to create an ActiveDefenseEquipmentPrototype that consumes ammo. Therefore, it seems I should also try to refill the ammo slots of equipment items.
However, this comes with some overhead (keeping track of what ammo items can be used with equipment, checking whether its ammo inventory is empty, looking for usable items in the trunk inventory, and actually refilling the ammo inventory) which I'd like to avoid if it isn't really needed. While there is precedence for equipment running on fuel (e.g. from IR3), I haven't seen yet any mods that create ammo-consuming ActiveDefenseEquipment. But if no such equipment items exist, running the code for refilling the ammo of equipment items is unnecessary.
Do you know any mods that provide equipment items which need ammo?
Equipment items using ammo
Equipment items using ammo
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Equipment items using ammo
I see no inventory related methods on the ActiveDefenseEquipment class, so I doubt that it can have an ammo inventory.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Equipment items using ammo
Thank you, that sounds reasonable! So I can save myself the trouble to add reloading of equipment.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!