Jump to content
Sign in to follow this  
gmJamez

SightAdjustment (windage+elevation)

Recommended Posts

Hi,

I've created a little addon that allows for windage and elevation adjustments.

[*] Just 'install' the addon and it's active within every game.

[*] Adjust windage by using the left and right cursor keys, elevation by using the up and down cursor keys (= default configuration). The key assignments can be configured by editing a file - explanation below.

[*] Current windage and elevation settings are stored by unit and by weapon, ie. if you switch to another unit, different settings can be used for each weapon ever used by this unit within a mission.

[*] Adjustments can be stored as range cards to files within the mod's directory and viewed ingame.

[*] Only works for primary weapons and only for a weapons first muzzle (both by design), ie. when using e.g. M4GL the mod will only affect the 5.56 rounds, not the grenades.

[*] The following parameters can be configured for each weapon by changing the weapon classes:

- Use mils or MOA as adjustment unit.

- Adjustment steps.

- Adjustment limits.

- Disable any adjustments.

This allows other modders to create weapons that behave differently than others when used with the SightAdjustment mod (see config.cpp).

caveats:

[*] The mil-dot size of the ArmA weapons does not match those used by this addon.

[*] It overrides defined actions for the cursor key, ie. whatever command you assigned to those keys won't get executed - you can configure the mod to use different keys though.

[*] I wanted to enable the windage and elevation configuration mode only when in optics-mode, but unfortunately I found no way of detecting when it is enabled.

A brief explanation on how to use mils can be found at the end of this post.

Feedback and help with the current issues is quite welcome wink_o.gif

regards, Oliver.

download here (v0.3).

0.4beta

M107, range 700m, elevation +12.25 MOA:

sightadjustment_01.jpg

Create your own range card:

rangecard_01.jpg

Sample range card for an M4SPR:

rangecard_02.jpg

key configuration

The key assignments can be configured by editing the file "GMJ_SightAdjustment\scripts\SightAdjustmentConfig.h". To do that, you have to unpbo the mod, edit the file and pbo it once again.

Two setups are already included - using the cursor keys and using WASD. If you want a different set up use the key values found here: http://community.bistudio.com/wiki/displaySetEventHandler

Simply comment lines by adding // at the beginning. Commented lines will be ignored by the game.

e.g.

#define GMJ_SA_KEY_Einc 200 // increase elevation adjustment

#define GMJ_SA_KEY_Edec 208 // decrease elevation adjustment

#define GMJ_SA_KEY_Winc 205 // increase windage adjustment

#define GMJ_SA_KEY_Wdec 203 // decrease windage adjustment

range card configuration

The range cards are stored within the mod's directory. Unfortunately I can't determine the mod's directory or read the files by using relative paths, so the mod assumes that the range card files are found here "your ArmA directory\@GMJ_SightAdjustment\Addons". If you want to store them somewhere else, change the following line within SightAdjustmentConfig.h:

#define GMJ_SA_RANGECARDPATH "@GMJ_SightAdjustment\Addons"

To create your custom range card:

1) Aim at a target and adjust the elevation until the rounds hit exactly where you aim at.

2) Select the "New" link within the range card.

3) Enter the distance into the edit control next to the "enter distance:" line.

4) Select the "New" link within the range card and push the "add" button. Your current configuration will be added to the range card.

5) Repeat steps 1-4 for all distances you wish to show on the range card.

6) Select the entire text within the text control below the "copy range card data here:" line and copy the text to your clipboard.

7) Create a new text file within the directory where the range cards are stored (default "your ArmA directory\@GMJ_SightAdjustment\Addons").

8) Paste the text and save the file as "rangecard_XXX.txt" where XXX can be anything you choose (for example indicate the gun, ammo, ...).

e.g. for an M24 range card you could save it as: rangecard_M24.txt

9) Open the file "rangecard_list.txt" within the directory where the range cards are stored (default "your ArmA directory\@GMJ_SightAdjustment\Addons") and add...

, "XXX"

... at the end without adding new lines. XXX is of course whatever you chose when saving the file just before.

10) Within the range card push the "reload" button - the new range card can be selected (no need to restart the game).

weapon configuration

The weapons can be configured by changing a few parameters within the weapon's class by editing the file "config.cpp" of this mod ("GMJ_SightAdjustment\config.cpp") or any other mod. To do that, you have to unpbo the mod, edit the file and pbo it once again.

Two setups are included - using mil mode (= mil dots) and MOA mode (= minute of angle).

[*] Enable/disable adjustments by changing the GMJ_SA_enabled parameter. Adjustments will be enabled if it equals 1 and disabled for any other values or if the parameter is missing.

e.g. GMJ_SA_enabled = 1;

[*] Switch between mil and MOA mode by changing the GMJ_SA_mode parameter. Supported values are "MIL" and "MOA".

e.g. GMJ_SA_mode = "MOA";

[*] Set minimum and maximum value of windage/elevation adjustments by changing the GMJ_SA_adjrange array. Values are in degrees. Due to rounding errors you need to set them a tiny bit beyond the desired limit.

GMJ_SA_adjrange[] = { 2.33335, 1.66667 };

-> sight will adjust from elevation -1.166675° to 1.166675° and windage -0.833335° to 0.833335°

[*] Set the adjustment steps by changing the GMJ_SA_adj array. Values are in degrees.

e.g. GMJ_SA_adj[] = { 0.00416667, 0.00833333 };

-> sight will be adjusted by 0.001° for elevation and 0.00833333° for windage

whish list

[*] Enable adjustments only when using optics/sights.

[*] Demo mission.

things to check/fix

[*] XAM incompatibility

version history

0.4beta - 05.08.2007

- Added range card (to samples are included - M24 and M4SPR).

0.3 - 29.07.2007

- Fixed elevation/windage calculation (thank you NonWonderDog).

- Fixed clicking sound even when adjustment limit has been reached.

- Weapon configuration is read from weapon class (mode, adjustment range, adjustment steps and enabled flag).

- Removed mode and adjustment range definition from SightAdjustmentConfig.h.

- Added muzzle class to weapon config to enable check for e.g. grenade launcher usage.

- Added enabled flag which allows for disabling the mod for certain weapons.

- Added debug mode by defining GMJ_SA_DEBUG as true which disables dispersion effects.

0.2 - 18.07.2007

- Added MOA mode.

- Adjustments are as of now stored by unit and by weapon, ie. each unit can have different settings for each weapon ever used within a mission.

- Since setDir is apparently not mp compatible -> added setPos to fired event handler, which should sync the adjustments during mp games.

- Moved the definition for the keys used when adjusting windage/elevation to config file.

- Added upper and lower limit of windage/elevation adjustments.

- Reduced number of global variables to one (GMJ_SA).

- Added registered tag GMJ to addon, variables, etc.

- Cleaned up config.cpp.

0.1 - 14.07.2007

- Original release.

thanks

NonWonderDog, sickboy, Maximus-Sniper

And everyone who posted this addon on his site!

<span style='font-size:9pt;line-height:100%'>How to use mil-dot reticles</span>.

Either read this article on snipercountry.com or use these approximations (best do both though):

1 mil = 1m@1000m

or for our imperial friends...

1 mil = 3.6in@100yd

When using mil-dots it really helps to think in metric units.

Examples:

- So let's say you know that your shots hit about half a meter low at a distance of 500m. Easiest way to get the mil-adjustment is to think "0.5m / 0.5km" -> set elevation to 1mil.

- Your shots hit 0.3m low at 600m? Think "0.3m / 0.6km" -> set elevation to 0.5mil.

- On to a more complicated example: Let's say you wish to adjust windage for a vehicle moving in a perpendicular direction to you at about 50km/h and the distance is 300m. First of all keep in mind that 100km/h = 27.7˙m/s, so 50km/h equals roughly 14m/s. We're shooting a 7.62 NATO round so v0 ought to be about 840m/s with an m24 -> it will take the round about 0.35s to reach the target. During those 0.35s the vehicle will have moved about 5m (0.35s * 14m/s). To get the mil adjustment think "5m / 0.3km" -> set windage to about +/-17mil (+ or - depending on whether the vehicle moves from left to right or vice versa). This approximation should be good enough to get a good second hit probability. Want a first hit? Bring a calculator or a range card wink_o.gif

Share this post


Link to post
Share on other sites

Hi.

Woowwww... this is so perfect for me tounge2.giftounge2.giftounge2.gif Very nice and good work. Perfect for my Sniper Pack tounge2.gif New world for us snipers. Thank you soooooo much gmJamez smile_o.gif

Share this post


Link to post
Share on other sites

Vey nice, thank you gmJamez notworthy.gif  Is there any relation between your mildots and the distance? How can we ajust the scope if we managed to estimate the distance (using scope's mildots)?

Share this post


Link to post
Share on other sites

my god somebody acturally make this?!?!?

i will wait till somemore ppl test it, but with the love of god, you save our days notworthy.gif

p.s. with your words, wouldnt it be better and is it possible to only give this function to sniper/ scoped rifles?

Share this post


Link to post
Share on other sites

Sniping is not my thing! wink_o.gif

But gez think you're gonna make alot of ppl happy! smile_o.gif

Share this post


Link to post
Share on other sites

Very nice approach and 100% SQF inlove.gif, though if it could be accomplished through config instead of scripts controlling every bullet fired it would even be better IMHO.

But im afraid that just like the Tracers, this will be impossible or at least we need some docs/examples for it smile_o.gif

An option can be to add multiple muzzles/firemodes with different config settings.

We for instance use this on our Scoped M14 Sopmods and M249's while giving the ability to look over the sights for CQB action.

This can be used for zooms but also zeroing/elevation. Windage however probably not.

Some tips for your config and scripts, though what you do with it is of course up to you smile_o.gif:

[*] Exchange: class Man: Land {}; with class Man; and remove the class Land; as it will be unneeded. The method is the preferred method since ArmA to inherit classes.

[*] You might want to consider using a prefix like most Addon Creators use. Even though the possibility is low that anyone else will use your Variable or class names, it still is the recommended approach. You can even register your own prefix tag at ofpec.com

[*] 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).

[*] AFAIK one can not determine a weapon as a seperate object in the game. A weapon is always attached to a player or to a (in)visible weapon holster/carrier. As such you can not find them with nearestObject or whatever function.

[*] You can save multiple weapon settings by using for instance:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">call compile format["SightAdjustment_weap_%1=%2",_weapon,_setting];

or for instance you could use 2 arrays, an index array and a data array.

The index array can contain the weapon names, the data array can contain the settings for the weapons.

If you add to both arrays at the same time, the weapon as index, and the setting in the data array, you can use the find function on the index array to find the weapontype, then use that id to get the setting from the data array.

Arrays are preferred over using multiple global variables, esp with the current ArmA savegame bug that crashes when loading savegames with over 240 (IIRC) global variables.

Another possibility is saving the weapon settings in seperate variables contained in the player or another object (e.g Game Logic), you can use the setVariable and getVariable functions to save and load variables from an object.

AFAIK these variables can be numerous without activating the save game bug.

I hope it helps! xmas_o.gif

Share this post


Link to post
Share on other sites

I was jus thinking, to make this more rifle friendly (m16, m4 etc), if instead of the mil dot system, you cud use a distance system, so instead of setting your sight to one mil, you would set it to 100m or something, i think this would be more realistic and useful for assault rifles.

Share this post


Link to post
Share on other sites

OOOooooh....

I have to agree that it should be in yards or meters for rifles without optics. It should probably be in minute of angle for the sniper rifles, too, rather than milliradians.

The problem with switching to MoA, though, is that the default airFriction (-0.0005) is way too high for heavy rifle rounds. The M107 should need no more than +32 MoA to hit at 1000 yards even if it's zeroed at zero distance, not +40 mils! (That's 135 MoA! ) Something around -0.0001 to -0.0002 seems better for the .50 caliber, but I can't get it accurate (if accuracy is even possible with ArmA) without some range/drop data. (Hmm... this might work.)

airFriction can be set per bullet, of course. Who said ArmA couldn't have different ballistic coefficients for each round? biggrin_o.gif Granted, the units make no sense and the behavior is a bit weird (bullets fired into the air seem to sprout parachutes on their way down -- even though the m203 parachute flares don't. (Bah! they should last 40 seconds, not 5! And airFriction has no effect on flares! )), but it's something.

sideAirFriction doesn't do anything for bullets, by the way. sideAirFriction seems to be a multiplier of airFriction for rockets and missiles only. Setting "airFriction = -0.0001" (default/5) seems to have the same effect as setting "sideAirFriction = 0.2" (default/5). Weird.

Random observation #3: the z component of air friction seems to be applied opposite the direction a rocket is pointed, not opposite the direction it's moving. Since rockets have "maneuvrability = 0", they are always pointed in the same direction as when they are fired. If fired into the sky, they will end up travelling backwards! Setting "maneuvrability" to any whole number seems to fix this, and makes the RPG-7 trajectory very slightly more realistic as a bonus. Since rockets don't track, maneuvrability only seems to affect weathervaning tendency. crazy_o.gif

Share this post


Link to post
Share on other sites

thats just freaking awsome we need more shit like this good job works nice i can hit everything miles away smile_o.gif nice! you should do it for tanks and arty peaces smile_o.gif like you get in the arty peace and then click on the map and it sets the tregectorie for it and then u can fire!

Share this post


Link to post
Share on other sites
OOOooooh....

I have to agree that it should be in yards or meters for rifles without optics. It should probably be in minute of angle for the sniper rifles, too, rather than milliradians.

The problem with switching to MoA, though, is that the default airFriction (-0.0005) is way too high for heavy rifle rounds. The M107 should need no more than +32 MoA to hit at 1000 yards even if it's zeroed at zero distance, not +40 mils! (That's 135 MoA! ) Something around -0.0001 to -0.0002 seems better for the .50 caliber, but I can't get it accurate (if accuracy is even possible with ArmA) without some range/drop data. (Hmm... this might work.)

airFriction can be set per bullet, of course. Who said ArmA couldn't have different ballistic coefficients for each round? biggrin_o.gif Granted, the units make no sense and the behavior is a bit weird (bullets fired into the air seem to sprout parachutes on their way down -- even though the m203 parachute flares don't. (Bah! they should last 40 seconds, not 5! And airFriction has no effect on flares! )), but it's something.

sideAirFriction doesn't do anything for bullets, by the way. sideAirFriction seems to be a multiplier of airFriction for rockets and missiles only. Setting "airFriction = -0.0001" (default/5) seems to have the same effect as setting "sideAirFriction = 0.2" (default/5). Weird.

Random observation #3: the z component of air friction seems to be applied opposite the direction a rocket is pointed, not opposite the direction it's moving. Since rockets have "maneuvrability = 0", they are always pointed in the same direction as when they are fired. If fired into the sky, they will end up travelling backwards! Setting "maneuvrability" to any whole number seems to fix this, and makes the RPG-7 trajectory very slightly more realistic as a bonus. Since rockets don't track, maneuvrability only seems to affect weathervaning tendency. crazy_o.gif

Hi smile_o.gif

Really interesting info. So if i use a M2 ball ammo with Muzzle velocity 853 m/s and I have an Leupold mark 4 6.5-20X50mm LR/T Rifle scope, same zoom i used in my test video. How many "clicks" do i have need to hit a target at 1000 meter when my scope are zeroed at 500 meter? Maybe something need to be changed in that script? I need to make it most realistic, he he I'm working on a addon project wink_o.gif

I see in ArmA weapon addon, they have zeroed at 500m, it's that normal? What are they doing in real life? biggrin_o.gif

Share this post


Link to post
Share on other sites

I found this ballistics calculator, seems pretty decent and lines up with the data I have:

http://www.ballistics-software.com/shoot.htm

It only works to 1000 meters, though.

Using what data I have on the M2 Ball, a rifle zeroed at 500 meters would need +21 MoA to hit a target at 1000 meters. That's 6.1 mils.

The airFriction is too high for all the rifle rounds, but it's probably way too low for pistol rounds. They use the same default value. D'oh. I'm an incessant tweaker, so I'll probably fix all of these eventually. I might even release something, if I'm ever happy with it.

I don't really know what standard zero is on the M107, but I'd guess either 500 yards or 1000 yards, leaning towards 500 yards. It's a "Long Range Sniper System," after all.

This mod is absolutely essential to get the behavior right, though. Thanks to the original poster!

Share this post


Link to post
Share on other sites
I found this ballistics calculator, seems pretty decent and lines up with the data I have:

http://www.ballistics-software.com/shoot.htm

It only works to 1000 meters, though.

Using what data I have on the M2 Ball, a rifle zeroed at 500 meters would need +21 MoA to hit a target at 1000 meters. That's 6.1 mils.

The airFriction is too high for all the rifle rounds, but it's probably way too low for pistol rounds. They use the same default value. D'oh. I'm an incessant tweaker, so I'll probably fix all of these eventually. I might even release something, if I'm ever happy with it.

This mod is absolutely essential to get the behavior right, though. Thanks to the original poster!

Hi.

Thanks smile_o.gif Nice program tounge2.gif

I found another nice little toy too smile_o.gifMilDot

Nice little handy tool smile_o.gif

Share this post


Link to post
Share on other sites

Random fact, just learned: M2 ball hasn't been produced for years, and it's never used in sniper rifles. It was designed as a ballistic match to M2 armor piercing, which hasn't been produced since WWII. The new match to the new M8 armor piercing round is the M33 ball round, at 661 grains and 2910 fps. That's what the M82/M107 fires. The Ma Deuce fires whatever's in stock, which is usually... M2 ball.

Using M33 ball, you would only need +19.5 MoA to hit that 1000 yard target. tounge2.gif

Share this post


Link to post
Share on other sites
Random fact, just learned: M2 ball hasn't been produced for years, and it's never used in sniper rifles. It was designed as a ballistic match to M2 armor piercing, which hasn't been produced since WWII. The new match to the new M8 armor piercing round is the M33 ball round, at 661 grains and 2910 fps. That's what the M82/M107 fires. The Ma Deuce fires whatever's in stock, which is usually... M2 ball.

Using M33 ball, you would only need +19.5 MoA to hit that 1000 yard target. tounge2.gif

Thanks smile_o.gif

Config.cpp updated tounge2.gifrofl.gif

Share this post


Link to post
Share on other sites

Siiiiiiiiiiiick!! pistols.gif ! Take that Ivan! I'll have to do some reading about how to use mildots (how many for, say 1000m), but having just had a quick plink at a few badies, this is indeed a fine piece of work!

notworthy.gif

Share this post


Link to post
Share on other sites

After some strenuous testing, it seems that the airFriction value is actually set pretty well for the .50 caliber rounds. It's pretty much spot on for the high BC commercial rounds, and could actually stand to be a bit higher for military ammo. That means all the other airFriction values are too low. In some instances WAY too low. No wonder it took so long for people to confirm that ArmA even had real ballistics.

I had been underestimating the range to my target before, and the "mil" settings in this mod really threw me off. Now that I'm using Kronzky's targetrange script to calibrate it, it's going much easier.

To gmJamez: There seems to be some confusion in your code, as it has sight adjustments in approximately milliradians/8. It really should be in minutes of angle for American scopes, adjusted in 1/4 intervals (a spectacularly small angle, but whatcha gonna do). The PSO-1 scope on the SVD should have elevation adjustment in hundreds of meters, oddly enough, as should the PSOP scope (?) on the KSVK. And even then, the Russian "mil" is not a milliradian but 1/6000 of a circle. crazy_o.gif

The trigonometry in the scripting engine is in degrees, so to make the adjustments in 1/4 MoA (like American sniper scopes), it's best just to set "_adj = 1/60/4". The PKS-07 should have "_adj = 360/6000".

Then, in sightAdjustmentGetText for MoA:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_val = round(_v0 * 6000) / 100;

_text = format ["%1%2 MoA", if (_val >= 0) then { "+" } else { "" }, _val];

One thing to keep in mind is that vectorDir returns a projection of heading on a unit sphere. That means 45 degrees = 0.707, not 0.5. (This is so you can just say "setDir velocity" to make something point forwards.) This is a good thing here; we can just use sin x = x for small changes of angle, assuming we convert to radians first:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_w = SightAdjustmentWindage * pi/180;

_e = SightAdjustmentElevation * pi/180;

Then just add that to direction like your code already does.

Those changes should make the adjustment much more accurate.

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. That would be a major undertaking, but it's definitely doable. The easiest way to get the offsets would be to use that ballistics calculator I linked to: it will tell you what elevation setting is needed for each range. 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.

Of course, the built-in "distanceZoomMin" and "distanceZoomMax" values in the config files seems to zero the weapons pretty well no matter how much drag I put on the bullet. I think all that means is that it would be really easy for BIS to implement adjustable sights, though, since I don't think we can get at the bit of code that uses those values. Meh.

Share this post


Link to post
Share on other sites
After some strenuous testing, it seems that the airFriction value is actually set pretty well for the .50 caliber rounds. It's pretty much spot on for the high BC commercial rounds, and could actually stand to be a bit higher for military ammo. That means all the other airFriction values are too low. In some instances WAY too low. No wonder it took so long for people to confirm that ArmA even had real ballistics.

I had been underestimating the range to my target before, and the "mil" settings in this mod really threw me off. Now that I'm using Kronzky's targetrange script to calibrate it, it's going much easier.

To gmJamez: There seems to be some confusion in your code, as it has sight adjustments in approximately milliradians/8. It really should be in minutes of angle for American scopes, adjusted in 1/4 intervals (a spectacularly small angle, but whatcha gonna do). The PSO-1 scope on the SVD should have elevation adjustment in hundreds of meters, oddly enough, while the PKS-07 scope on the KSVK is probably the only weapon in the game that should be adjusted in mils. And even then, the Russian "mil" is not a milliradian but 1/6000 of a circle. crazy_o.gif

The trigonometry in the scripting engine is in degrees, so to make the adjustments in 1/4 MoA (like American sniper scopes), it's best just to set "_adj = 1/60/4". The PKS-07 should have "_adj = 360/6000".

Then, in sightAdjustmentGetText for MoA:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_val = round(_v0 * 6000) / 100;

_text = format ["%1%2 MoA", if (_val >= 0) then { "+" } else { "" }, _val];

One thing to keep in mind is that vectorDir returns a projection of heading on a unit circle. That means 45 degrees = 0.707, not 0.5. (This is so you can just say "setDir velocity" to make something point forwards.) This is a good thing here; we can just use sin x = x for small changes of angle, assuming we convert to radians first:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_w = SightAdjustmentWindage * pi/180;

_e = SightAdjustmentElevation * pi/180;

Then just add that to direction like your code already does.

Those changes should make the adjustment much more accurate.

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. That would be a major undertaking, but it's definitely doable. The easiest way to get the offsets would be to use that ballistics calculator I linked to: it will tell you what elevation setting is needed for each range. 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.

Of course, the built-in "distanceZoomMin" and "distanceZoomMax" values in the config files seems to zero the weapons pretty well no matter how much drag I put on the bullet. I think all that means is that it would be really easy for BIS to implement adjustable sights, though, since I don't think we can get at the bit of code that uses those values. Meh.

Good morning NonWonderDog smile_o.gif

I'm gonna give it a try. Thanks again for your info. smile_o.gif

So this should work "perfectly" for my M82A1A (SASR) w/ LEUPOLD MARK 4 6.5-20X50MM LR/T RIFLE SCOPE? wink_o.gif

EDIT:

Ok i change to:

SightAdjustmentOnFired:

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

_w = SightAdjustmentWindage * 3.14/180;

_e = SightAdjustmentElevation * 3.14/180;

and SightAdjustmentGetText:

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

_val = round(_v0 * 6000) / 100;

SightAdjustmentGetText give me an adjustment in MoA +6 + 12 and so on. Maybe better with +1 adjustment ? smile_o.gif

EDIT:

Ok... It was just me, I did some wrong scripting here. Now it's work perfect. The sight adjustment are now +0.25 for one click, Nice one wink_o.gif I forgot to change set "_adj = 1/60/4". rofl.gif

I run my 1000 m test again and now i just needed +18.5 MoA to hit the target at 1000 m... sounds correct? smile_o.gif

Share this post


Link to post
Share on other sites

Sounds quite good. smile_o.gif

You can use "pi" in the script instead of 3.14. You probably should, too, since were talking about very precise angles here.

If you really want it good, add "airFriction = -0.0005500;" to class B_127x99_Ball in your config. That value is 99.9% accurate to the real M33 ball ballistics out to at least 1000 meters. biggrin_o.gif

That is:

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

class CfgAmmo

{

class BulletCore;

class BulletBase : BulletCore

{

};

class B_127x99_Ball : BulletBase

{

airFriction = -0.0005500;

};

};

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sounds quite good. smile_o.gif

You can use "pi" in the script instead of 3.14. You probably should, too, since were talking about very precise angles here.

If you really want it good, add "airFriction = -0.0005500;" to class B_127x99_Ball in your config. That value is 99.9% accurate to the real M33 ball ballistics out to at least 1000 meters. biggrin_o.gif

That is:

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

class CfgAmmo

{

class BulletCore;

class BulletBase : BulletCore

{

};

class B_127x99_Ball : BulletBase

{

airFriction = -0.0005500;

};

};

Thanks smile_o.gif

And he he how do you found that value "airFriction" for M33 Ball? Some table or site somewhere, he he biggrin_o.gif

EDIT:

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

Things have change since OFP, he he

My class CfgAmmo look like this:

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

class CfgAmmo

{

class Default; // External class reference

class BulletCore; // External class reference

class RAST_Bullet: BulletCore

{

.

.

.

Can i remove class Default?

Share this post


Link to post
Share on other sites
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

Hi Bob smile_o.gif

Yes, i love this addon. And with some more help from NonWonderDog it's been more realistic. Bob, maybe we can practice on MP some day rofl.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 with whatever name you want. Add a patch class to that config.cpp first, 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.

Or, of course, you could just add the airFriction line to the B_127x99_Ball class and be done with it. You really should make a patch instead of changing everything, though.

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  

×