Use multiple tags in the model.
You need 3 models: the base, the rotating gun mount, the elevating gun
On the base you have “tag_azimuth” at the azimuth rotation point.
On the mount you have “tag_azimuth” at the azimuth rotation point, AND “tag_elevation” at the gun elevation point. This model is exported with the azimuth tag at 0,0,0.
On the Gun you have “tag_elevation”, exported with tag elevation at the 0,0,0 point.
You then place all the parts in radiant as script_movers (clipped with origin brushes at the appropriate tags).
Give then scriptnames like “88base”, “88turret”, and “88gun”.
Then in your script (using the suggested names):
88base
{
spawn
{
// Do stuff, maybe
}
}
88turret
{
spawn
{
wait 200
attachtotag 88base tag_azimuth
}
//Add turret turning stuff here
}
88gun
{
spawn
{
wait 200
attachtotag 88turret tag_elevation
}
//Add gun elevating stuff here
}
Then, when you move the base, the turret follows, and the gun follows the turret. All faceangles are relative to the tag the mover is attached to. So, you only need to adjust the pitch angle of the gun. No matter which way the turret turns, the gun will elevate properly without you resorting to complex trigonometry to get the pitch, yaw, and roll angles right.
HTH