Home   Help Search Login Register  

Author Topic: LGB wich hits were the laser point.  (Read 1570 times)

0 Members and 1 Guest are viewing this topic.

Viriato

  • Guest
LGB wich hits were the laser point.
« on: 20 Mar 2003, 19:16:36 »
I have created a little scrip which creates a LGB at a fixed distance of a given taget, ponting that target, and with setvelocity, gave it some thrust.

The amount of velocity is calculated (empirically) so the bomb will hit the point were the target is.

Combinig this little script with SnyPir laser traking script, we can recreate very acurately a laser guided attack from planes out of sigth anywere on the map.

Now, the problems, when the target is on the same heigth above the sea were i made the test to calculate the point of impact, the script works smoothly, but when the heigth above the sea changes, there is inacuraccy.

I cant understand why because the z pos of the bomb is related to the laser beam hit point itself, so the bomb is always at the same heigth over the target.
If some one knows what is happening here i will be grateful.
Regards.

The script is;
Code: [Select]
; Guided air attack by Viriato.

; radio chatter and comunications here

eagle sidechat "Roger, heading for target"

~15

eagle sidechat "weapon fired"

~4

;crear el misil

_missil = "laserGuidedBomb" createVehicle [(getpos Laser_obj select 0), (getpos Laser_obj select 1) -300, (getpos Laser_obj select 2) +150]
_missil setvelocity [0,50.9,0]

?called >= maxcall :exit ; 1 setradiomsg "null" ; eagle sidechat "All weapons fired, good luck"
called = called + 1

exit


I also include a working  test mission.

Viriato

  • Guest
Re:LGB wich hits were the laser point.
« Reply #1 on: 21 Mar 2003, 18:23:14 »
You are not on the collaborative mod today uh?

Ok, i have been looking by myself and finally find the problem, but still donÂ't know how to solve it.

The problem is that Getpos uses absolute heigth and setpos (or camcreate ect) uses heigth above the ground.

So, if the point were the bomb spawn has a different heigh than the place were the target is, the bomb will not fall at the same spot, because the "real" heigth is affected  with the ground level diferential.

Whats the way to solve this?
Anybody?

Viriato

  • Guest
Re:LGB wich hits were the laser point.
« Reply #2 on: 19 Apr 2003, 13:00:35 »
I finally managed to solve this, i will post the demo mission soon.