Jump to content
Sign in to follow this  
gmJamez

SightAdjustment (windage+elevation)

Recommended Posts

This is a brilliatn addon, im so glad to see something like this!!!

AddOns like these are making the game more and more realistic

THANKS!!!!!

thumbs-up.gifthumbs-up.gifthumbs-up.gif

thumbs-up.gifthumbs-up.gifthumbs-up.gif

indeed!

thanks.

i also think it should be im Meters instead, because all distance in this game is measured in Meters.

Would be easyer to use. smile_o.gif

ps- i dont know how realistic would be if it was converted in meters instead.

Good job and thanks! inlove.gif

Share this post


Link to post
Share on other sites
A bunch of searching turned up a ballistic coefficient of 0.670 for M33 ball. I plugged that and muzzle velocity and zero and a bunch of other things into that ballistics calculator, and got a curve, which I imported into Excel.

Then, I booted up Kronzky's targetrange mission in the editor and put myself on top of a cliff. I turned on the ballistics logging, and fired out to sea at as close to a zero degree angle as I could. That gave me a curve, which I imported into Excel.

Rinse, wash, repeat, until the curves lied exactly on top of each other. Which they do with airFriction = -0.00055.

I wish it was more sophisticated than that, but I have no idea what units airFriction is in. No idea at all.

Quote[/b] ]

I see we don't have the same class CfgAmmo, hmm

Things have change since OFP, he he

My class CfgAmmo look like this:

Whoa, whoa, whoa. No need for that. You don't need to edit your weapons.pbo. Just paste that code into a file called config.cpp, and pbo it. Add a patch class, and voila! Instant ballistics.

Patch class, for reference:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches

{

class MaDeuceBallistics //YourNameHere

{

units[] = { };

weapons[] = { };

requiredVersion = 0.108000;

requiredAddons[] = {

"CAweapons", "CAweapons3", "CAA10"

};

};

};

I don't know if the patch class is really necessary for it to work, but I bet it is.

Woow... tounge2.gif I'm gonna test Kronzky's targetrange mission. I really need this to be much realistic as possible tounge2.gif

I see in ArmA they use "hit = 13;" Hit damage, well that seems a bit low for me. I set it to:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

//-----------------------------------------------------//

// M33 Ball 12.7x99mm Ammo //

// Against light material targets //

// and personnel targets //

//-----------------------------------------------------//

class AMMOM82M33Ball: RAST_Bullet

{

hit = 50; //M33 Ball

indirectHit = 2;

indirectHitRange = 0.05;

airFriction = -0.0005500; // idea from NonWounderDog

tracerColor[] = {0.00000, 0.00000, 0.00000, 0.00000};

tracerColorR[] = {0.00000, 0.00000, 0.00000, 0.00000};

visibleFire = 18; // how much is visible when this weapon is fired

audibleFire = 18;

visibleFireTime = 1; // how long is it visible

timeToLive = 15;

};

Since i'm using M33 Ball ammo... please correct me if i'm wrong smile_o.gif

Share this post


Link to post
Share on other sites

Hit=13 is probably plenty. Soldiers have only three hit points, I believe, and the only reason they don't die from any shot at all is body armor. Damage depends on bullet velocity, too. I believe the way it works is that the bullet does "hit" damage at "typicalSpeed", while it's scaled somehow for any other speed. The default value for typicalSpeed is 900 m/s, and only pistols have it lower. (It amazes me that subsonic 5.56 ammo isn't completely useless in game, given these facts. And, of course, its real life performance.)

Actually, looking in my config, I've boosted it to hit=26. Was it really only 13 in the default?

Share this post


Link to post
Share on other sites
Hit=13 is probably plenty. Soldiers have only three hit points, I believe, and the only reason they don't die from any shot at all is body armor. Damage depends on bullet velocity, too. I believe the way it works is that the bullet does "hit" damage at "typicalSpeed", while it's scaled somehow for any other speed. The default value for typicalSpeed is 900 m/s, and only pistols have it lower. (It amazes me that subsonic 5.56 ammo isn't completely useless in game, given these facts. And, of course, its real life performance.)

Actually, looking in my config, I've boosted it to hit=26. Was it really only 13 in the default?

Hi.

Yes.. in ArmA they have put "hit = 13;" for M107(M82A1). For me it's to low if we are talking about M33 Ball.

M33 Ball are used against light material targets and personnel targets.

ArmA Weapons. ArmA Weapons Info

Yeah, maybe may value it's too much... not sure. I'm gonna make some more ammo for my rifle.. i have now M33 Ball, MP NM 140 and MP-T NM 160 smile_o.gif

And i'm gonna make another ammo called Raufoss Mk 211:

"The Raufoss Mk.211 is a .50 caliber BMG (12.7 mm × 99 NATO) multipurpose anti-materiel projectile originally developed by the Norwegian company NAMMO Raufoss AS under the model name NM140 MP. It is commonly referred to as simply multipurpose or Raufoss. The "Mk.211" name comes from the nomenclature "Mk.211 Mod 0" used by the U.S. military for this round.

The multipurpose name is based on the projectile having an armor-piercing (tungsten core), an explosive and an incendiary component, thus making it capable of penetrating lightly armored targets and causing damage to personnel inside the target after penetration. It is a suitable round for engaging helicopters, aircraft and lightly armored vehicles, as well as unarmored vehicles, and it has the capability of igniting jet fuel. The Mk.211 has about the same destructive power as a standard 20 mm round against such targets.

The Mk.211 has become very popular as .50 cal sniper ammunition, for use in among other the Barrett M82 rifle, and is also often used in heavy machine guns, for example the M2 Browning. Due to its popularity several U.S. arms manufacturers produce the round under license from NAMMO Raufoss AS.

The Multipurpose concept developed by Raufoss is unique in the way that instead of using a mechanical fuze it uses a pyrotechnical detonation train to ensure proper detonation of the explosive and incendiary components."

It would be nice if a such ammo can make the same damage in ArmA. If you shoot at BRDM-2, than the bullet will penetrate and explode inside and make some damage at personnel biggrin_o.gif

Share this post


Link to post
Share on other sites

<span style='font-size:8pt;line-height:100%'>Hi,

thank you all for your feedback! I'll probably release a new version later today with most of the suggested improvements.

@sickboy

Excellent comments and tips - thanks!

Exchange: class Man: Land {}; with class Man; and remove the class Land;

Done. I remember to have gotten an error message at some point (... class not defined...) and being a c++ guy I immediately thought, well that makes sense and added the Land class as well biggrin_o.gif

...consider using a prefix like most Addon Creators use

Good idea and done.

You should be able to read the weapons the player is carrying by issueing: weapons player will return an array with the weapons. Is this what you were looking for? Also the fired eventhandler contains the currently fired weapon+muzzle in the _this parameter (Though I guess you know that smile_o.gif).

Finding a units weapons is not a problem - it's finding out which weapon the unit is currently using that seems impossible! At least until it starts firing, but by then it's too late...

I'd need to know the selected weapon to store the adjustment accordingly. Imagine holding a rifle and adjusting (configuration should be stored for that weapon) and then switching to your LAW launcher and adjusting again, but for a different situation. Unless I know the selected weapon, this can't be done, since the script has no way of knowing for which weapon the configuration should be stored.

However I'm hopeful still: Since switching weapons is done via animations, it might be possible that an AnimDone event handler could catch those weapon switches...

Also originally I wanted to save the adjustments for each weapon within the game so that I could pick up an M24, zero it, pick up another M24 which ought to result in this particulars M24 settings to be loaded, adjust this one and finally pick up the original M24 and again have this particular M24's settings loaded. Would have been really fun for multiplayer games...

Quote[/b] ]Arrays are preferred over using multiple global variables... savegame bug...

Oh, didn't know about that one.

I did of course plan on combining those global variables into one global array that holds all mod-relevant data, but only once the scripts are beyond beta status, since the code get a good bit less readable. Due to the savegame bug -> working on it. Will probably be done today.

@NonWonderDog:

Great research, really well done!

There seems to be some confusion in your code, as it has sight adjustments in approximately milliradians/8.

Hmm, that's odd - I had tested it using Kronzky's target range and got a reading of about 10mil for one of those red targets at 100m. Since I estimated it to be rougly one meter high the 10mil reading seemed to fit.

I'll rerun some tests and try and sort it out...

Regarding the use of MOA instead of mils. To be honest, I can't recall ever having seen MOA used for adjusting for windage or elevation. Usually MOA seems to be used to describe the expected accuracy of a certaing gun/ammo type (in the sense that a grouping is expected to stay within 1 MOA at x meters, etc.).

However, I'll try and use #define's to include both units within the same code and release two version - one using mils, the other MOA.

Ideally, you should have separate code for each weapon, so we can switch to, say, the number 5 (500 yard) tick on the PSO-1 scope.

I'm no fan of hardcoding any assumptions such as, that e.g. only the PSO is of russian type and should therefore use different settings. I'd love to be able to use the isKindOf function to get to the base classes of the weapons (but alas, weapons are not supported banghead.gif - sometimes this engine really drives me mad) or even better, imagine we could get the optics used by a weapon and determine it's base class... but suppose I'm dreaming, eh? sad_o.gif

A few asked how to use mil-dots -> I updated the first post.

Regarding the wish to change the adjustments to meters instead of mils. Well, there's a reason why precision shooting ain't easy and in my opinion it shouldn't be either. Dialing in a certain range and have a mod automatically cancel out the games ballistics, would be way too easy and allow for perfect hits without effort. I want to give players the tools to become better sharpshooter, not make everyone a perfect sharpshooter tounge2.gif

Besides, the ballistics for the different weapons/ammo are different, so the script would have to know exactly how much the bullets rise/fall for each given distance and each ammo type used. And as soon as this mod is combined with another mod, that changes ammo settings, the values wouldn't work anymore.

What I would like to do though, is to add a range card feature, ie. I'd like to be able to start a dummy mission, create a range card for a certain gun at distances of my choosing by observing where the rounds hit and adjusting accordingly. Later I'd like to retrieve this range card from within other missions - problem is, I don't yet know how/where to save that data to persist across missions...).

First I'll try and sort out the bugs of the current version though before attempting to get a range card working. If the range card proves feasible though, this game just might become heaven for us sharphooters inlove.gif</span>

Share this post


Link to post
Share on other sites
A few asked how to use mil-dots -> I updated the first post.

<span style='font-size:8pt;line-height:100%'>Regarding the wish to change the adjustments to meters instead of mils. Well, there's a reason why precision shooting ain't easy and in my opinion it shouldn't be either. Dialing in a certain range and have a mod automatically cancel out the games ballistics, would be way too easy and allow for perfect hits without effort. I want to give players the tools to become better sharpshooter, not make everyone a perfect sharpshooter tounge2.gif

Besides, the ballistics for the different weapons/ammo are different, so the script would have to know exactly how much the bullets rise/fall for each given distance and each ammo type used. And as soon as this mod is combined with another mod, that changes ammo settings, the values wouldn't work anymore.

What I would like to do though, is to add a range card feature, ie. I'd like to be able to start a dummy mission, create a range card for a certain gun at distances of my choosing by observing where the rounds hit and adjusting accordingly. Later I'd like to retrieve this range card from within other missions - problem is, I don't yet know how/where to save that data to persist across missions...).

First I'll try and sort out the bugs of the current version though before attempting to get a range card working. If the range card proves feasible though, this game just might become heaven for us sharphooters inlove.gif</span>

we are not asking you to conver all into snipers.

we are asking you to use standard distance currency...

Share this post


Link to post
Share on other sites

Not sure I understand... When you adjust for bullet rise/drop you need to aim lower/higher. Depending on the distance to your target, that'll translate into a certain amount of meters/yards/whatever above or below the point you actually wish to hit.

Suppose the script adjusted for "+1m elevation" - at a distance of 100m, that's 0.57° above your target, but at 1000m it's only 0.057°. Since the script can't possibly know what your trying to hit it can't possibly know the distance either and wouldn't know where to send those bullets...

Both mil and MOA are angular measurements, not distance.

Share this post


Link to post
Share on other sites

somehow i think we need a training mission(better be mp one as well and find a server to host this..........advanced marksmanship school.....) tounge2.gif

p.s. i think we really need a community range card too confused_o.gif

Share this post


Link to post
Share on other sites
<span style='font-size:8pt;line-height:100%'>Regarding the use of MOA instead of mils. To be honest, I can't recall ever having seen MOA used for adjusting for windage or elevation.</span>

All three of the M24, M107, and Mark 12 Mod 0/1 SPR use Leupold Mark 4 optics, featuring

Quote[/b] ]Low-profile, finger-adjustable 1/2-MOA windage and 1-MOA elevation adjustments with audible, tactile clicks.

Honestly I thought they had 1/4-MoA adjustment like all the other scopes Leupold makes. It must be to make them a bit more rugged. The M107 seems to have the 1/4 MoA drums on it, though.

Even the 4x32 ACOG (on the M16 and M4) has windage and elevation adjustments in 1/3-MoA increments (1 MoA is almost exactly 1 inch at 100 yards): http://trijicon.com/pdfs/ACOG.pdf

The only American exception is the scope on the Marine Corps M40, which uses mils for adjustment. All the civilian and police versions of that scope use 1/4 MoA elevation adjustment, however, so the Marines special ordered one in mils just to be different. It's not in ArmA at the moment, either.

The only scope in ArmA as shipped that might possibly have adjustment in mils is the one on the KSVK, and it uses the PSO-1 reticule (which is made for preset adjustments in meters) for some reason.

But you can't get the currently selected weapon? Shouldn't it just be "_this select 1", assuming the script is initiated by the player?

Share this post


Link to post
Share on other sites
somehow i think we need a training mission(better be mp one as well and find a server to host this..........advanced marksmanship school.....) tounge2.gif

p.s. i think we really need a community range card too confused_o.gif

Hi smile_o.gif

he he biggrin_o.gif It would be nice with only an ArmA Sniper Server rofl.gif

Maybe i'm gonna do that later sometime biggrin_o.gif

Share this post


Link to post
Share on other sites
But you can't get the currently selected weapon? Shouldn't it just be "_this select 1", assuming the script is initiated by the player?

Unfortunately no. All that's contained within _this passed by the init event handler is the unit itself and no weapons.

Furthermore the primaryWeapon command always returns the primary weapon, regardless of whether the unit has selected it or not. Same goes for the weapons command which contains all weapons attached to the unit but no indicator of which one it's currently using.

Heck, even the fired event handler passes only a string with the weapon name and no reference to the actual weapon object.

Pretty unbelievable that this isn't possible and unfortunately not the only shortcoming of the ofp/arma engine...

By the way, I've rewritten quite a large portion of the code to enable the detection of primary-weapon switches so that the adjustments set for a rifle won't be used once the player switches to e.g. a SAW.

Unfortunately it's a bit buggy yet and I have to leave for a couple of days, so the next release will probably happen late next week or more likely (work's crazy right now) next weekend.

Share this post


Link to post
Share on other sites

Good news and Great job!! Do you plan to adapt this feature into other systems in the future? (Grenade launcher, MGs'wink_o.gif

Share this post


Link to post
Share on other sites
 First, of course, you'd have to get accurate ballistics for each round, but I'm plugging away at that now.  ArmA's ballistics engine really is surprisingly accurate, it just has crap data by default.

Does this mean there may be a addon one day that fixes all of ArmAs bad ballistics? wink_o.gif

Also wondering whether the adjustable sight could be incorporated directly into the config of new weapons. My thought was it would be a more effeicent way of having adjustable sights that woudld not be a "scripted bandaid"

BTW thanks gmJamez for opening such a promising can of worms

Share this post


Link to post
Share on other sites

would it best to make a mod folder for sight fix,because it messes up my multi play :ie you come in to game but cant move just some thing is in the top left telling you how much you would have moved left right or forwards.

just wondering was this ment for multi play or what ,as it was evolution that it does that on.

Here take a look.

http://s60.photobucket.com/albums....ght.jpg

Share this post


Link to post
Share on other sites
somehow i think we need a training mission(better be mp one as well and find a server to host this..........advanced marksmanship school.....) tounge2.gif

p.s. i think we really need a community range card too confused_o.gif

Hi smile_o.gif

he he biggrin_o.gif It would be nice with only an ArmA Sniper Server rofl.gif

Maybe i'm gonna do that later sometime biggrin_o.gif

That would be wicked!!!

Share this post


Link to post
Share on other sites

@G_H_Play_AKA_BOSS: you aren't using the arrow keys for movement by any chance? the mod overides the key assignment for those keys to map the windage correction on them.

have you tried it in singleplayer too?

Share this post


Link to post
Share on other sites

Bugger me.... I wrote a reply to this topic in another thread and thought that it wouldn't work. but somebody did it. Good work dude. Safe to say that you made a lot of people happy with this one.

Share this post


Link to post
Share on other sites
First, of course, you'd have to get accurate ballistics for each round, but I'm plugging away at that now. ArmA's ballistics engine really is surprisingly accurate, it just has crap data by default.

Does this mean there may be a addon one day that fixes all of ArmAs bad ballistics? wink_o.gif

Also wondering whether the adjustable sight could be incorporated directly into the config of new weapons. My thought was it would be a more effeicent way of having adjustable sights that woudld not be a "scripted bandaid"

Yep. wink_o.gif

I've actually almost finished the small arms. The only really accurate data I have is for M855 and M193 rounds from an M16, though; everything else is figured with a ballistics calculator (which is a huge leap of faith, since the ballistic coefficients of most rounds are exaggerated 5-15%) . It's still a definite improvement, so once I fix the subsonic rounds and get the TA01NSN ACOG reticle (it looks perfectly accurate EDIT: nope, too big. But that's not a problem... wink_o.gif ) and M4 ballistics to match, I'll make a release thread with lots of comparison charts.

I kind of hoped to fiddle with ballistics for the big guns too, but I can't find any data at all. The best I could find is "80-120 m/s/km deceleration" for the T72's APFSDS rounds (the muzzle velocity is accurate already). I think that implies a significantly flatter trajectory than the round has in ArmA, but I haven't really looked into it. But with the fictional reticules the tank guns have, and without laser rangefinders and automatic ballistic correction, why bother?

As to your second question, all I know is that it would have to be script based no matter what. But there's no reason, if it is possible to base the adjustments on something added to weapon configs, that it would be limited to new weapons. New classes can be added to existing weapons without a problem. The problem is reading whatever data you added to the weapon config and determining when to do so.

Share this post


Link to post
Share on other sites

NICE WORK !!! pistols.gif But I have problem. I hold mouse in left hand and I need arrow keys to move. It is possible switch to W, S, A and D ?

Share this post


Link to post
Share on other sites
Quote[/b] ] - It overrides defined actions for the cursor key, ie. whatever command you assigned to those keys won't get executed.

- The keys can only be configured by editing the file "SightAdjustment.pbo\scripts\SightAdjustmentOnKeyDown.sqf".

you can unpack the pbo file with tools from this page:

http://community.bistudio.com/wiki/ArmA:_Community_Tools

(kegetys cpbo is probably the quickest to use and mikeros elitness the most versatile)

edit the sqf file with any editor you like, for example built in notepad

and pack it again with your pbo tool.

EDIT: fixed misstyped link, sorry for the inconvenience

Share this post


Link to post
Share on other sites

1. the http dont work

2. private ["_v0", "_key", "_v2", "_v3", "_adj", "_val", "_handled"];

_v0 = _this select 0;

_key = _this select 1;

_v2 = _this select 2;

_v3 = _this select 3;

//_adj = (1 / 1600) / 10;

_adj = 0.1;

//player sideChat (format ["%1, %2, %3, %4", _v0, _key, _v2, _v3]);

_handled = false;

if(SightAdjustmentIsOpticsMode) then {

switch(_key) do {

// up: 200, down: 208, left: 203, right: 205

case 200: {

SightAdjustmentElevation = SightAdjustmentElevation + _adj;

_handled = true;

};

case 208: {

SightAdjustmentElevation = SightAdjustmentElevation - _adj;

_handled = true;

};

case 205: {

SightAdjustmentWindage = SightAdjustmentWindage + _adj;

_handled = true;

};

case 203: {

SightAdjustmentWindage = SightAdjustmentWindage - _adj;

_handled = true;

};

default {

};

};

if(_handled) then {

playSound "SightAdjustmentClick";

hint format ["%1/%2", [sightAdjustmentElevation] call SightAdjustmentGetText, [sightAdjustmentWindage] call SightAdjustmentGetText];

};

};

_handled

Where is that control arrows and where I change ?

biggrin_o.gif

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> // up: 200, down: 208, left: 203, right: 205

case 200: ...

.

.

.

case 208: ...

it should be this part, you got to find out the code for the other keys however.

Share this post


Link to post
Share on other sites

Nice work but is like a cheat

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  

×