Page 1 of 1

Equipment items using ammo

Posted: Mon Jul 01, 2024 10:34 am
by Pi-C
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?

Re: Equipment items using ammo

Posted: Mon Jul 01, 2024 6:20 pm
by Bilka
I see no inventory related methods on the ActiveDefenseEquipment class, so I doubt that it can have an ammo inventory.

Re: Equipment items using ammo

Posted: Wed Jul 03, 2024 3:41 pm
by Pi-C
Thank you, that sounds reasonable! So I can save myself the trouble to add reloading of equipment. :-)