Home   Help Search Login Register  

Author Topic: the inclinaison of a tank's canon  (Read 771 times)

0 Members and 1 Guest are viewing this topic.

FRR_RAPTOR

  • Guest
the inclinaison of a tank's canon
« on: 03 Aug 2003, 10:23:59 »
helo all :)

How can I make for recover the inclinaison of a tank's canon. Not its position or its direction but its inclinaison :-\

Unnamed

  • Guest
Re:the inclinaison of a tank's canon
« Reply #1 on: 05 Aug 2003, 01:06:09 »
Hmm....I dont think you can?

You can "kind of" set a guns inclination using, do watch. And you can get a guns inclination when it fires. But other than that, I'm not sure.

I know it's crazy but.....if tanks had an invisible guns that made no sound. You could fire the invisible gun every time you need to find it's inclination  ::)

FRR_RAPTOR

  • Guest
Re:the inclinaison of a tank's canon
« Reply #2 on: 05 Aug 2003, 03:41:07 »
Maybe if i create a fake weapon whit fake ammunition, it should be good?

And what is the command for get a guns inclination when firing?

Unnamed

  • Guest
Re:the inclinaison of a tank's canon
« Reply #3 on: 05 Aug 2003, 07:48:44 »
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:

Code: [Select]

_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:

Code: [Select]

_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:

Code: [Select]

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.
« Last Edit: 05 Aug 2003, 07:51:54 by Unnamed »

FRR_RAPTOR

  • Guest
Re:the inclinaison of a tank's canon
« Reply #4 on: 08 Aug 2003, 08:13:22 »
oki  :)

thx for your help  ;)