This mod is amazing. But I think it is better to set fire mode for each weapon so no need to set each ship specifically anymore. Most of the time we just need to specify each weapon's behavior instead of a weapon group. for example, I just don't want tri-tachyon lance to fire at fighters but I don't wanna set every ship that equips tri-tachyon lance.
Thanks for the feedback! =)
This is a cool idea. However, I'm kind of unsure how I could implement this in a way that's user-friendly. Creating a usable GUI that includes all available weapons, especially when using multiple faction/content extension mods, would be nigh-impossible given how GUIs in the game work, I think...
Also, I wouldn't want to replace the ability to manually set/change firing modes per weapon group, as this mod is all about customization. And I can definitely envision cases, where you want the same weapon to behave differently on different ships (e.g. on a Scatter Amplified Sunder I might want phase lances to fire at everything, while on big ships I like using them as an anti-fighter weapon).
So I think this would have to work as an override for the default mode or something like that.
Off the top of my head, I could think of two possible ways of doing this: Adding an additional settings file where you can map weapon ids to default modes/suffixes or implementing a Web GUI that you would have to access via web browser. Both solutions don't really seem ideal (and a lot of work) and probably very few people would actually use them.
Let me know if you have a better idea.
After playing around with the mod, I've noticed there's a couple issues. PD_ALSO weapons don't function correctly using the PD (Flux>50%) suffix - they work fine until reaching 50% flux, but they don't target anything once you go over 50% flux - neither ships nor missiles.
Also, weapons set to Opportunist (and by extension Conserve Ammo) seem to ignore both the ship's set Target line of sight to whatever other target they have in mind - I've seen very often seen weapon groups set to this fire directly into destroyed ships trying to get at another ship, or more specifically the Vast Bulk central area of a station in attempts to hit another module, while weapon groups set to normal don't fire until they do have LoS. Most obvious with missiles.
Thanks for letting me know about these issue, I will look into fixing them! I'll keep you updated.
Update: I just did some testing regarding the first issue (PD_ALSO) and unfortunately I can't reproduce the issue described by you. As far as I'm aware, the only PD_ALSO weapon in vanilla is the devastator cannon, so I used that one for testing. I put two of them onto an Onslaught, gave them the DEFAULT weapon mode with the PD (Flux > 50%) suffix. They targeted anything when flux < 50% and started to only target fighters/missiles at flux > 50%.
I have two possible explanations as to why it didn't work for you:
1. You were using a weapon from a mod that behaves in a way (different from the devastator cannon) I didn't anticipate when writing the mod.
2. You were using a weapon mode that prevents targeting fighters/missiles (such as e.g. Opportunist).
If it's the second case: Unfortunately, that's just how suffixes work =/ They don't override the way the weapon mode works, they only modify it. So they are unable to change what the weapon mode considers valid targets. (It would, in theory, be possible to change how suffixes work for them to be able to do that. But that would mean doing most of the calculations twice, which would have a really bad effect on performance.) The tooltip does state "only use with [...] modes that can target missiles/fighters!", but maybe I should consider adding an additional safeguard (such as greying out the suffix button) to prevent this.
If it's the first case: Which weapon from which mod were you using? Does that weapon AI do anything special?
If it's neither: I'd be grateful for any additional info you might be able to provide to shed light onto this behaviour.
Update 2:
I believe I fixed the issues regarding weapons firing into ships that are blocked by husks/debris. As this is kind of hard to test, I'm not 100% sure if this fix works perfectly, but from my limited testing it seems to be working. Now, weapons that are set to opportunist and weapons that use ammo should be much more hesitant to fire if the path is blocked. Due to insufficient testing, I marked this as a pre-release (
https://github.com/DesperatePeter/starsector-advanced-weapon-control/releases/tag/0.10.3).
I also identified what causes weapons on Opportunist to ignore the ship's target: Internally, I use target priorities to decide which target to shoot at (low number == high priority). Marking an enemy as the target will significantly (factor 100) lower the priority number (i.e. make it a much more likely target). However, if opportunist would refuse to fire at an enemy, it sets that target's priority to infinity. I.e. if the marked ship target is not opportune, but there is an opportune target nearby, opportunist will fire at that other target instead. I could change that behaviour, but I'm afraid that would just cause other issues.
But overall I have to admit that, despite having reworked it multiple times already, Opportunist still doesn't always do the thing that feels right. Opportunist isn't really intended as a "catch-all" mode. It's intended for weapons where you'd prefer not shooting if it's uncertain if the shot will be impactful. I think in order for opportunist to always do what the player wants, I'd essentially have to implement a full weapon AI that's significantly better than the built-in starsector AI and that's probably not that realistic. So, while I will ofc keep trying to improve Opportunist (and other weapon modes), don't expect it to always do the most sensible thing

Please don't take this the wrong way, I am grateful for any feedback and will try to fix issues that are brought to my intention! Especially the issue with Opportunist firing into husks is, imho, very valid and needed to be fixed.