New version up -- I've updated the attachment at the top of this thread. See notes below:
The only issue is the neutral thing. In my case an LA sub's focus was trying attempting to ID me (Virginia). See test file.
Thanks for the save file, Mike. This is now fixed.
FYI the apparently simple solutions (changing the side postures or marking units as out of comms) did not work and I had to implement a rather elaborate workaround. All allied sides are still neutral to each other, but when a submarine gets within 3nm of a contact on an allied side, it will mark that contact as friendly and therefore drop it as a target.
As far as I can tell after a lot of testing (and someone please let me know if I've missed something), there is unfortunately no way to mark two sides as friendly (either unidirectionally, or otherwise) without getting position sharing at least. Marking units "out of comms" doesn't help because that setting apparently only applies to units within a side, not to other sides. I may report this in the Tech Support forum because I think there SHOULD be an easy way to get the desired results: sides that are friendly to each other but do not share either positions or contacts.
I would like to use a late Cold War (1970s-1980s) unit selection. Would it work to just edit the html file, or is your script looking for something specific? What would happen if I changed to the CWDB? I assume that I would have to change the unit numbers of the neutrals in the script, at least.
P.S. the time of day setting seems a little off...
As far as I know, you can't change the DB within a Quick Battle because there's no Lua function to do that. You could definitely adapt the underlying code for a standalone scenario, though. However, aren't most Cold War submarines also in the modern DB since many of them are still in use somewhere (aside from the U-Boats)? If you can find what you want in the modern DB, it would be easy enough to edit the script. (Note that the actual DBIDs are NOT defined in the HTML-- for this scenario they're in a table in the Script.lua. Look for "subDBIDs" and "factionDBIDs'.)
Fixed the time of day setting -- thanks for catching that! BTW the time of day code was originally copied from the standard Submarine 1v1 QB included with CMO, so I think that means that the setting is broken there too.
< Message edited by musurca -- 2/22/2021 7:56:30 AM >