I'll see if I can whip something up over the week-end.
Well, it's been a bit more involved than I expected, I couldn't recycle as much as I thought from previous scripts, but still I've been able to put in some good work on it Saturday afternoon, so I've
almost got something working (using FS2 retail data).
Its a script that swaps out specific weapon for a variant depending on ship class, as defined by a custom table file in the config/ folder. It would work like this :
First off, define your table:
#MyStandardGun ;; the name of the "standard" variant in the loadout screen
$Name: Cornerian
$Ships: Arwing
$Name: Venom
$Ships: Wolfen, Arwing#Venom
#End
#MyOtherStandardGun
...
#End
#SomeMissile
...
#End
...
At the start of any mission, it will lookup every ship present, if it finds - for example, one equipped with "MyStandardGun" in its primary banks, and if that ship is in the
$Ships list of a variant - say an
Arwing, it will swap "MyStandardGun" for "MyStandardGun#Cornerian". If instead that ship was a
Wolfen or
Arwing#Venom, it would swap the primary with "MyStandardGun#Venom" instead.
I've tested it with primaries, but it *should* work with secondaries as well. Now I need to make it work for fighters that aren't present at mission start, and maybe see if I can optimize the various loops. I'll upload what I've got on github this evening, so that you can check it out.