Originally I made this script for myself so I didn't have to take too long to perfect my marksmanship skills, but after posting about it in the ubisoft forums a few weeks back I had a some requests to release it.

The spotting script can be applied to any single player sniping mission to help you you nail the target by providing crucial (and some non crucial) sniping data. I don't know if it will work for multi but once I know the SP works fine I'll try to work on MP.

It requires a sniping team of more than one soldier OR you can use just one soldier if you wish to add his targets via scripting.

; SCRIPT INFO;; WIND HEADING - direction of the wind (shown in degrees and compass direction);; WIND SPEED - speed of the wind;; OVERCAST - displays how much cloud cover is obscuring the sunlight;; PECIPITATION - displays how much rain is in the air;; VISIBILITY - visibility detemines at what distance the ability to cleary see objects degrades, NOT the distance it can be seen from. this measurement is fairly accurate.;; RANGED@ - the distance which a weapon is ranged at. if the rifle is ranged at 300m then the bullet will hit the center of the crosshairs at this range. any further and ; the bullet will drop below the center, any closer and ythe bullet will hit above the center.;; EFFECTIVE - the effective range of the weapon. accuracy is reduced substantially beyond this range.;; TGTDIST - distance to the target;; TGTSPEED - speed the target is moving at;; TGTHEADING - the heading of the target (shown in degrees and compass direction);; TARGETDIR - the direction to the target (shown in degrees and compass direction);; TARGETANG - the angle to the target from the player;; BALLISTIC LAG - an approximation of how long it will take your bullet to hit it's assigned target, very useful for moving targets. should be accurate down to 1/10 sec.;

Works for rifles and smg's only.

I'm not sure if the wind/weather actually has an effect on the bullets but it adds a degree of realism since real snipers use this stuff.

More information on it's usage can be found when you open up sniperspotter.sqs in notepad.

I have two archives here, one is just the main script plus the scripts that go with it. The second is a Paraiso airport converted to a targetting range, not really demo missions but they do showcase what the script does. One example has pop-up targets, the other has live ones. I find the live targets are more illustrative of how the script can be used in missions while the pop-up are excellent for testing your skills and gives you an idea of how well you are doing.

- It seems to me that you are using absolute dirs instead of relative ones. What about using relative ones? I mean, the direction of the wind is relative to the direction of the current weapon, so what you get is a deviation in degrees where 0 means the wind is aligned with the weapon. For example, -10 means the wind is traveling 10 degress to the left of where my weapon is pointing. Same for target. A target going west, north or whatever is important only if you know which is the direction, at least, of your weapon, else what you want is the relative heading with the heading of the weapon (target closing, moving to left, right, etc, but not North, Weast, etc).

- About weapons info, how about reading the config to get the values?

- Would you like to get rid of the hint box and use a detailed display instead?

If you were willing to incorportate any of these and you need any help with it, just tell us

Thank you Mandoble for reviewing my work. I never played ofp and this was my first attempt to create something for arma that can be shared with others, truth be told, the first piece of code I've written since the commodore 64 was in style! So I hope I can be forgiven if the structure is a bit crude.

To address your first point: If you looked over the script you can probably see I like having different options, so this is a no brainer. I didn't fathom giving relative degrees, but I like the idea of it. I'll add this.

Second point: This seems like a good idea since addon weapons would be auto recognized, BUT I'm not sure that the config file shows the effective range of a weapon (my values for effective range came from weapon websites etc). Perhaps we can have it read the config and then afterwards check to see if the weapon is in the predefined list in the script, if so it could also show the effective range, if not in the predefined list we could have it simply omit the effective range and carry on as usual.

So sounds good, I just need a piece of code as an example of the best way to check the weapon configs and convert the info for display.

Lastly: The hint box I never liked, but I only have so much time and being a novice at this it was all I really could do. I'd like something fancier and I'm sure anyone else interested in using it will appreciate not having half of their screen eaten up by that ugly monster of a box!

I have no clue how to do this one, so I'll need a bit of help with this as well.

About the way you get wind information, you might simplify it a lot while making it way more accurate using the wind command. It returns the current velocity vector of the wind, so you have immediately the direction and speed without needing any particle.

Okay, I've been doing some work and the script now uses the wind command to detemine wind conditions. I've also retooled some of the math so that the script no longer needs functions and can stand on it's own.

Now, what I'm looking for at the moment is a calculation to detemine the relative degrees. Any suggestions on the best way to do this?

I think what Mandoble was asking for when he asked for relative direction was "I am facing 170 degrees and the target is facing 180 degrees, so they are travelling +10 degrees relative to me (so, slightly to the right of the direction I'm looking)". You could use two techniques to give that info to the player:- show the difference between target's heading (getDir) and the player's weaponDirection (aiming direction), rather than the target's absolute heading. Only thing to remember is that 350 to 0 degrees is +10, not -350 degrees.- additionally show the player's absolute weaponDirection angle, so they can compare that with the target's absolute direction themselves.

As well as calculating the bullet lag time, you could show the bullet lag distance (based on current target heading and speed) in absolute or relative metres (or mils and direction within the scope). If you went crazy, it would even be possible to show a "shoot here" marker on the screen, but that takes all the fun out of it OFPEC ILS does some work to do something like this, in showing the position on the airport on the HUD.