Hi,
I have only used these methods with mortars, testing range and elevation, so how they will work with lots of tanks e.t.c I dont know.
You can point the gun using the DoWatch command:
_Tank doWatch [((GetPos _Tank) select 0)+1000,((GetPos _Tank) select 1),(sin(30) * 1000)]
This will point the gun East "((GetPos _Tank) select 0)+1000" at an elevation 0f 30 degrees.
You would need to add some more Trigonometry functions to get a more flexible system. Not to mention compensating for the height above sea level and the height of the turret above the ground and the slop of the ground. I have written a function to get the slope of the terrain, just not sure how accurate it is.
However when I tested this with mortars, the actual elevation of the shell does not correspond to the elevation of the gun barrel, so I have to make slight adjustments.
I dont know if the same will apply for other types of weapons and vehicles?
To get the elevation\direction of the turret when a gun is fired:
Elevation.sqs:
_shooter = _this Select 0
_ammoType = _this Select 4
_shell = NearestObject [_shooter,_ammoType]
_VX=(Velocity _Shell) Select 0
_VY=(Velocity _Shell) Select 1
_VZ=(Velocity _Shell) Select 2
_Elevation=ATAN(_VZ/_VX)
_Direction=ATAN(_VY/_VX)
Add this in the tanks init field:
this addeventhandler ["Fired","_this exec {Elevation.sqs}"]
Like I said this is a bit ruff and ready, I know nothing about how addons are created, so as yet I dont know if there is a better solution to some of the problems I've encountered.