Page 1 of 37 1234511 ... LastLast
Results 1 to 10 of 368

  Click here to go to the first Developer post in this thread.  

Thread: SightAdjustment (windage+elevation)

  1. #1
    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

    regards, Oliver.

    download here (v0.3).
    0.4beta

    M107, range 700m, elevation +12.25 MOA:


    Create your own range card:


    Sample range card for an M4SPR:


    key configuration
    The key assignments can be configured by editing the file "GMJ_SightAdjustment\scripts\SightAdjustme ntConfig.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/d...etEventHandler
    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&#39;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&#39;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&#39;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




  2. #2
    Hi.

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

  3. #3
    way to go gmJamez&#33;

    i made news out of this subject, and added a screenie on www.armedassault.eu

    for those who want to know how this looks ingame, i attached the image i posted on aa.eu





    ** DISCUSS THE LIMNOS INCIDENT AT OUR FORUMS! WWWHELPIVANMARTIN.ORG/FORUMS ***
    Show your support to Ivan Martin! - embed this javascript snippet on your site!
    Spoiler:

    download.armedassault.eu - The Unofficial BIS Download mirror.
    Interview with Marek Spanel (nov2012) - http://www.helpivanmartin.org/2012/1...-marek-spanel/
    SahraniRadio - Ammo for your mind!

  4. #4
    Vey nice, thank you gmJamez ***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&#39;s mildots)?
    ACE/ACE2 dev

  5. #5
    Second Lieutenant
    Join Date
    Jun 3 2003
    Location
    Hong Kong
    Posts
    4,569
    my god somebody acturally make this?&#33;?&#33;?

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

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



    I don't use a pump to scare somebody. I use a pump to shoot somebody.
    -Travis Haley - Magpul Dynamics - Art of the Dynamic Shotgun

    1911 mag, twinkie, twinkie, cupcake, primary weapon magazine... OH! There it is!
    -Christ Costa - Art of the Art of the Tactical Carbine 1

  6. #6
    Warrant Officer ck-claw's Avatar
    Join Date
    Oct 29 2005
    Location
    On The End Of A Bottle Of Cider-Somerset - UK
    Posts
    2,241
    Sniping is not my thing&#33;

    But gez think you&#39;re gonna make alot of ppl happy&#33;


    How Ppl Treat Me Is Their Path, How I Respond Is Mine...

  7. #7
    I have tested it and it&#39;s works
    I&#39;m working with some data for my M82A1A and I have set the sight leveling to 500m, and i put a soldier 1000m away... i had to add +40 mils, than i hit him.

    SightAdjustment test

  8. #8
    Very nice approach and 100% SQF , 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

    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&#39;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 :[*] 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 ).[*] 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&#91;&#34;SightAdjustment_weap_%1=%2&#34;,_w eapon,_setting&#93;;[/QUOTE]
    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&#33;



    A.C.E. Advanced Combat Environment

    Dev-Heaven.net Free Project Hosting | A2 Community Issue Tracker Help BIS, Help yourself!

  9. #9
    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.

  10. #10
    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&#39;s zeroed at zero distance, not +40 mils&#33; (That&#39;s 135 MoA&#33; ) Something around -0.0001 to -0.0002 seems better for the .50 caliber, but I can&#39;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&#39;t have different ballistic coefficients for each round? 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&#39;t. (Bah&#33; they should last 40 seconds, not 5&#33; And airFriction has no effect on flares&#33; )), but it&#39;s something.

    sideAirFriction doesn&#39;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&#39;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&#33; 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&#39;t track, maneuvrability only seems to affect weathervaning tendency.




Page 1 of 37 1234511 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •