I've integrated the countermeasure and weapons code so that weapons may act as countermeasures, and vice versa.
Briefly, it involved adding some new features (which work for weapons as well). "$Lifetime Min:" and "$Lifetime Max:" fields before "$Lifetime:", as well as a "$Model:" field after "$FlyByEngineSnd:".
In ships.tbl, I added a "$Countermeasure type:" option just above "$countermeasures", so you can set which countermeasure a ship will use.
As a result of the change, all you need to do to make a weapon a countermeasure (theoretically) is to add the flag "countermeasure" to the $Flags: list in weapons.tbl, or put it in the #Countermeasures section. It should be fully backwards compatible.
What needs to be tested is whether or not countermeasures are still being deployed properly, both in single player and in multiplayer. I've done a little testing and while they seem to be deployed at the same speed, I didn't seem to dodge any missile in the training level. I can't tell if that's because I'm crap at dodging missiles or if it's because something is wrong...missiles may not be homing, or counteremasures may not be deployed at the same speed, I'm not sure.
Here is the exe:
http://fs2source.warpcore.org/exes/latest/fs2_open_Ccm.zipEdit: And no, beams will not shoot from the countermeasure slot

, although I accidentally set a piranha baby weapon as a countermeasure during testing, and it made a nice boom.
