Try the "missile protect ship"-flag under "Misc" in the ships editor.I was thinking whether to write that I tried that. But then I was like "nah, other people are more attentive than I am and realize/know that this is only for turrets". :p
Try the "missile protect ship"-flag under "Misc" in the ships editor.I was thinking whether to write that I tried that. But then I was like "nah, other people are more attentive than I am and realize/know that this is only for turrets". :p
Just as a hack, could you lock the bombers' secondary banks for as long as necessary?
That seems a lot more complicated.
The actual mission is a little different from the test scenario described in the op. The player's squadron attacks an enemy half-stealthed frigate to disarm its main beams. The ship is escorted by fighters and a cruiser which are fully targetable. This makes working with lock-secondaries and manipulating ammunition difficult.
What I have in mind is that the player can make the target targetable by using TAG missiles. Of course I could introduce a "fire at tagged ships only" version of every secondary weapon available to the player squad (which is pretty much every secondary weapon in the game) and permanently tag all other hostiles in the mission via SEXP. But that's a lot of effort for only one mission...
While I'm writing this the idea comes to my mind that I could combine object-facing-object with lock-secondaries: Whenever an friendly fighter/bomber faces that frigate, it's secondaries are locked.
Now this is much more information which makes this much easier to workshop...Yeah, I should've provided more info in the first place.
Eureka?no-secondary-lock-on means that ship can't lock secondaries, not that secondaries can't achieve aspect lock on it; in this scenario, it's no more helpful than lock-secondaries.
EDIT: Oh right, can't see attachments - found this while checking if the "ignore-for-count-goals"-ship flag could be used as dummy status effect tracker (should I ever have the tagged status not avalible): It appears there is a "no secondary lock on"-flag in the list of flag for the alter-ship-flag SEXP but its not in the list of the Ships Editior ... which might be an indication that it doesn't work, but at least it is there.
no-secondary-lock-on means that ship can't lock secondaries, not that secondaries can't achieve aspect lock on it; in this scenario, it's no more helpful than lock-secondaries.
My best idea is some combo of is-facing and distance-to-ship check -> lock-secondaries, else unlock. I don't think there's a sexp to check what ship the AI is targeting.
Is Facing (Boolean training operator)emphasis mine
Is true as long as the second object is within the first ship's specified forward cone. A forward cone is defined as any point that the angle between the vector of the ship and point, and the forward facing vector is within the given angle. If the distance between the two is greater than the fourthparameter, this will return false.