Jump to content
Sign in to follow this  
chops

Artillery indirect fire script

Recommended Posts

Gday!

I found this "TUTORIAL ON HOW TO MAKE A BARREL HIT SOMETHING FAR AWAY WITH DIRECT OR INDIRECT FIRE" by nyarlatothep@aliceposta.it on my HD (originally from OFPEC) and tried to give it a go, using

this mortar addon. I think might be what General Barron based his infantry indirect fire script on...

Anyway it works by determining the elevations required to hit a target at set distances. Both values are put through a non-linear regression analysis program ( confused_o.gif ) to get the values of a,b,c,d,e you see in the script below

Quote[/b] ]tx =(getpos target) select 0;

ty =(getpos target) select 1;

ax =(getpos Artillery) select 0;

ay =(getpos Artillery) select 1;

dx=tx-ax;

dy=ty-ay;

;I calculate distance in this way instead of using distance command, 'cause in this way you can use marker positions

;or map clicks as target instead of objects

dist = sqrt((dx*dx)+(dy*dy));

;If the target isn't in the range I've selected at start I am not sure that I can hit it precisely, in my example the hits

;are precise even at 2000 meters, after that the speed of the projectile isn't enough to go farther, so I assume that if

;you gather a good amount of data the equation is precise even if you go very far beyond the range it was designed for

if (dist<200) then {Artillery sidechat "Target is under minimum range!";exit;};

if (dist>700) then {Artillery sidechat "Target is beyond maximum range!";exit;};

dostop Artillery;

Artillery setbehaviour "combat";

~2

a=64.66881

b=2.7839223

c=-252.796951

d=-341.896384

e=0.95125052

high=(((_dist^_b)*_a))+(_d*_dist)*(_dist*_e^_dist)/_c;

high=high/10000000;

Artillery dowatch[_tx,_ty,_high];

;The weapon depends on what type of vehicle used, use "weapons VehicleName" to return names of vehicle's weapons

Artillery fire "mortar2";

exit;

An error occurs saying "Artillery dowatch[_tx,_ty,_high] Error type Any , expected Number". I changed Artillery dowatch[_tx,_ty,high] no luck.

I then removed all the "_" things from the script (dunno why biggrin_o.gif ) and I now dont get the error. But the first round always impacts the minimum distance from the artillery, then subsequent rounds always impact passed the target, not really bothering anybody as much as I'd hoped confused_o.gif I noticed the values for c and d are negative, so I reversed the / and the * in the high=(((_dist^_b)*_a))+(_d*_dist)*(_dist*_e^_dist)/_c line with no luck either.

This is a very interesting tutorial with great potential. If anybody wants a copy I can email it to you.

Cheers

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×