I'm not sure how possible this is... but;
The basic idea is that guns are seperate pof files (i.e. with their own firing points probably). when a gun is selected in the loadout, the model is 'added' (i.e. stuck on) to a hardpoint on the ship, and effectively becomes part of the hull (merging firepoints so the player can fire it)
So, for example, you can strap on a Gatling type gun, or a 'cannon' like thing, or a missile rack.
I'm not 100% sure how this could be done.... I'd suggest using a 'docking' like system - i.e. the 'pylons' are specially named docks corresponding to gunpoint slots (i.e. dock name=pylonPrimary01), and the weapons models have corresponding dockpoints. The weapons.tbl has a modelname for the relevant pof (something like '$geo_object: default_laser.pof'). If the ship has the releavnt dockpoint, the game adds on the gun.
This, though is sort of where I get a bit confused on how it'd work... there obviously quite a few things that would need to be resolved, such as;
- How to actually 'merge' the objects and firepoints into each other, so that the player can fire the gun (and also so the engine doesn;t register the gun as a dockee ship and prevent the others, etc from docking)... I've no idea how this could be accomplished. Maybe merging the firepoint data of the pofs open starting the mission (I'm assuming the engine parses the firepoint data upon loading the mission, here... if models are parsed at startup, that could be a BIG problem, I guess)? Or making the gun on the mount a sort of invisible 'child' of the ship ; i.e. not regarded as a ship by game (but as a subobject of the main hull pof thing), and inheriting the ammo, and movement settings?
It's just an idea, but I'd like some feedback about whether its possible... I don't have the experience of C++ or the knowledge of the SC to know myself, unfortunately (and neither the time at the mo).