Now I'm no scripter, but is there some code to give units a certain weapon through scripts rather than through troop.txt? Similar to the arena? So they don't have the guarantee range flag, but are still armed with ranged weapons.
It might be worth trying though, and I think that will work. Using Mirathei's formation codes, I had troops who had ranged weapons but did not have the guarantee ranged flag, and they formed up with the infantry.
Look in header operations, there's several inventory related operations. I suspect whatever you come up with will have to go into mission_templates for each of the battle types.
Ok, since I'm asking about scripting possibilities with regards to this sort of mod, would it be possible to have a player purchase a musket, and automatically have the melee component placed in his inventory?