I've been looking at adding a chaingun to the longbow that has infinite ammo in addition to its limited-ammo missiles. The aircraft will attempt to RTB when out of missiles, despite still having a functioning weapon. It will also refuse new attack orders vs valid targets until loaded.
Aircraft with multiple weapons shouldn't RTB if one weapon is still operable.
I believe a better option here would be to split the RTB code from aircraft and make it conditional, that way each modder can decide what to do on each scenario.
This should already be possible. There are some subtle details to be careful of in the yaml definitions, so I strongly suspect that this is just an oversight in your yaml. Can you please post your definitions here?
Armament@PRIMARY:
Weapon: 30mm
MuzzleSequence: muzzle
Armament@SECONDARY:
Name: secondary
Weapon: Hellfire
LocalOffset: 0,213,-85, 0,-213,-85
PauseOnCondition: !ammo
AmmoPool:
Armaments: secondary
Combined HellfireAG and HellfireAA into one weapon for this. Is Armament@TERTIARY a thing if we want to keep them separate?
That example works as expected for me, although I changed 30mm to ChainGun and Hellfire to HellfireAG to avoid changing any weapon definitions.
Can you please post the definition of your 30mm weapon?
The armament names are arbitrary. You can use tertiary if you want, or aamissile or anything else. You just need to make sure that the types match up across AmmoPool, Attack*, and Turreted.
But note that I implemented those changes directly in aircraft.yaml. If you apply them as a rule overlay in a map you will need to add -PauseOnCondition: under Armament@PRIMARY otherwise that will default through.
OK, must have been a rule overlay thing. Got it to work in dev mode.
Most helpful comment
I believe a better option here would be to split the RTB code from aircraft and make it conditional, that way each modder can decide what to do on each scenario.