Home   Help Search Login Register  

Author Topic: SPON Rangefinder v0.3.0 (ACCEPTED)  (Read 11186 times)

0 Members and 1 Guest are viewing this topic.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
SPON Rangefinder v0.3.0 (ACCEPTED)
« on: 29 Sep 2007, 13:15:23 »
SPON Rangefinder v0.3.0
- Released: 2008-09-05
- Install size: 44k (mission scripts) / 104k (addon version)
- (mission version) 100% scripts with no addon dependencies
- (addon version) Requires XEH (1.7 or higher), but this is included in the release.
- Requires ArmA 1.09 (or higher) and SPON Core (v0.5.1 or higher).
- See attached README.html for full details

SPON Rangefinder v0.3.0 @ Xfire (Unofficial video; thanks to Delta99)

Overview
Adds an overlay to the standard ArmA SOFLAM laser designator. It will show range while the designator is turned on. Azimuth and elevation are also shown, even if the laser is turned off.

Requires that the SPON Core be installed in the mission (v0.5.1 or higher). Both SPON Rangefinder and SPON Core are available in two versions: One is a client-side addon and the other is mission-script-based, which does not require any addons to be installed on client or server. SPON Rangefinder requires ArmA 1.14 or higher.

Features
    * Rangefinder overlay shown when looking through the SOFLAM (a.k.a. Laser marker or laser designator).
    * Shows range to the laser-targetting point and, optionally, azimuth and elevation of the SOFLAM itself.
    * The display is accurate to 1m range or 1 unit (by default milliradians) for azimuth & elevation.
    * If the SOFLAM laser is turned off, then the last range value is shown for reference (only kept until the player stops looking through the SOFLAM).
    * Standard SOFLAM operation as a laser designator is completely unaffected.
    * Player can switch between showing the azimuth and elevation displays with 6000, 6283, 6300, 6400 mils, or in degrees, by pressing the reload button (defaults to 'R') when looking through the laser designator.
    * Compatible with the NWD optics addon, if it is installed. NOTE: NWD has his own rangefinder addon available. It additionally requires the Extended Init Eventhandler addon be installed and it doesn't look as good without the NWD optics addon being installed.
    * Compatibility: SP/SP teamswitch - OK; MP - OK; MP JIP - see limitations, below.

As used in
    * CO-10 Bleeding Skies by Igor Drukov.

Limitations
    * While looking through a rangefinder, with the laser off, there is a significant hit to frames-per-second. This is in order to ensure that multiple range-finder users don't pick up the wrong laser dot. When the laser is on, or the rangefinder is not being used, then the CPU load is negligible.
    * If you turn the laser on while looking at the sky (or at the ground, beyond the maximum range), then the "laser-on" LED will not light (and the target will not be visible to those that can see laser targets) until you look at the ground within range (BLAME BIS!).
    * If you turn the laser on at a viable target, then move to look at the sky (or at the ground, beyond your view range), then the "laser-on" LED will stay alight and the range will be shown to the last position the laser-marker pointed at that was viable. As far as the game is concerned, the marker is actually still in this "last position" and it can still be targetted by bombers (BLAME BIS!).

Known Bugs
    * (Very unlikely, but possible) If two players on the same side turn on their rangefinders within a fraction of a second of each other, while looking at the same target (or at least in a similar direction), then one of them could incorrectly detect the wrong target. If this happens, they would only need to turn the rangefinder off and on again to get the correct reading.

Plans
None.

Credits
    * Thanks to Blanco for pointing out the full range of binocular animations.
    * Testing by The Regiment of Grenadier Guards [RGG] squad (http://www.rggsquad.co.uk). Thanks fellas!
    * Thanks to everyone at BIS and OFPEC forums for testing, feedback and suggestions.
    * Thanks to Solus for allowing me to include the XEH addon in the release (and, of course, for making the great addon in the first place!)

Change Log
v0.3.0 - First version available as an addon.
- Added
    * SPON_RF_targets array, which contains a list of all current laser target objects.
    * Can configure the type of rangefinder class used.
    * Player can switch between showing the azimuth and elevation displays with 6000, 6283, 6300, 6400 mils, or in degrees, by pressing the reload button (defaults to 'R') when looking through the laser designator..
    * New function, SPON_RF_setMilsPer360Degrees, so that mils displayed can be altered via script if needed.
    * New function, SPON_RF_enableMapMarker, so that you can enable fire mission marker shown on map at laser position [Suggested by Sickboy].

- Modified
    * "SPON_laserTargetFound" event renamed as "SPON_RF_targetFound"
    * Variable, "SPON_laserTargetOwner", added to each laser target object, renamed to "SPON_RF_owner".
    * Azimuth and elevation are now always shown, even if laser is not on (and even without batteries).

- Fixed
    * If two players on the same side turn on their rangefinders within a fraction of a second of each other, while looking at the same target (or at least in a similar direction), then one of them could incorrectly detect the wrong target. If this happens, they would only need to turn the rangefinder off and on again to get the correct reading.
    * Battery LED is still lit if the player isn't carrying any laser batteries.

(See readme.html for full details of changes before current version).

Get SPON Rangefinder
« Last Edit: 22 Feb 2009, 17:53:01 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: SPON Rangefinder (TESTING)
« Reply #1 on: 29 Sep 2007, 22:04:15 »
Indeed, very well made script. Pretty accurate (i guess). Also the overlay is well desigend.

As you say yourself, the "only 1 Rangefinder per side" limitation might be annoying as i see it worth to be used in Sniper/Spotter Teams as in AT-Teams aswell, so more than one Rangefinder would become useful.

I would like to provide you a possible Solution but sadly i have no idea to get around this (attaching LaserTarget to Unit by variables? No idea if this can be done).

Well done readme. I like the style and the additional background informations. Well sorted. Although theres a error in the Installation instructions:
Quote
Add the following lines to your mission's "extension.ext" file:
I'm pretty sure you meant "description.ext".


If you can get around the known limitation stated above (and the correction in the readme but thats no big deal) i would state this script worth to be accepted.


Myke out

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (TESTING)
« Reply #2 on: 29 Sep 2007, 22:21:19 »
Although I appreciate you starting to test this script, I had intended that it be kept from submission until I'd dealt with the bugs/plans I'd put in the original post. I'll mark it (DO NOT SUBMIT) in a second. That doesn't mean that you can't try it out and make suggestions though :P

Thanks for pointing out the "extension.ext" error; For some reason I'm always writing the name of that file wrong. I'd better correct that, but I'll leave the uploaded files as they are until the next version because I'm lazy (I've made the same error in the Core documentation, too).

Quote from: Myke13021
I would like to provide you a possible Solution but sadly i have no idea to get around this (attaching LaserTarget to Unit by variables? No idea if this can be done).
Aye, I can do that, but first I need to work out which marker was created by which person. They are all server-local and the only difference in them is that west, east and independent each create different types of target, which is why I can say "one SOFLAM per side" works. As I said, using some sort of line-of-sight determination of which marker is likely to be made by who is the first step; using variables to record that would be the second step.
« Last Edit: 29 Sep 2007, 23:34:25 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #3 on: 30 Sep 2007, 06:32:03 »
Will it work with like binos? I saw someone asking over at the BI forums for something similar to this but for binos.
Xbox Rocks

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #4 on: 30 Sep 2007, 11:39:37 »
Well, when binoculars, or rather anything other than a SOFLAM, are used as range-finders, they are using a line-of-sight (LOS) script to work out the range. This script would manually extend a line out from the user, checking for collisions with objects or the ground and then check the distance from the observer. For the SOFLAM, I have to range to the BIS-created laser target object, just in case this isn't placed at exactly the same range as a LOS script would calculate. For example, were the laser fired at the very edge of a tank, the BIS laser might "hit" the tank, but a LOS script might "hit" the tank or "hit" the ground behind it. Obviously, it is important for a SOFLAM to display the exact range to the laser dot, otherwise it would be extremely misleading to any spotter attempting to paint a target with it.

I haven't actually looked at it properly, but I assume Mr. Peanut's BinoTarget uses a LOS script to determine the target. This is fine, but it doesn't have to operate "around" the existing behaviour of the SOFLAM.
« Last Edit: 30 Sep 2007, 11:45:58 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #5 on: 01 Oct 2007, 20:20:40 »
New version (v0.1.1) uploaded to fix an error: The rangefinder overlay wouldn't be seen if the player was wielding anything other than a rifle before looking through the SOFLAM.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #6 on: 27 Nov 2007, 16:01:02 »
New version (v0.2.0) uploaded. Mainly improving MP compatibility.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline [ LoneWolf ]

  • Members
  • *
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #7 on: 28 Nov 2007, 03:11:14 »
Great! Now the spotters are actually helpful  :P

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #8 on: 28 Nov 2007, 10:07:44 »
That would be true if all group leaders didn't already have a magical range-finder built into their heads :weeping: Can't wait for that feature to get modded out...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Zorasht

  • Members
  • *
    • 4th Perrus Squadron
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #9 on: 05 Mar 2008, 19:49:06 »
Hi.
First off, thanks for this script, is the best rangefinder out there.

However, it has a small issue.
The good thing about the rangefinders is to be able to use realistic sniper teams, with a shooter and a spotter. For that you need a great script like this to allow the spotter to tell off target's ranges.
And the other thing you need is a good addon like GMJ_SightAdjustment to allow you adjust the elevation  of the reticle based on the range to make a perfect shot. The famous quote "One Shot, One kill"  :D

And here is where the problem arise. Spoon core and GMJ_SightAdjustment use keyEventHandlers, and  as the rangefinder is loaded last, it overwrites the GMJ_SightAdjustment key settings to adjust the reticle. So if you load the script and the addon for the sight afjustments, you end up with a nice and working rangefinder and a useless GMJ_SightAdjustment addon.

I have found a "dirty" workaround, and this is to comment out the line in the initCore which initializes the keyEventHandlers

Code: (initCore.sqf) [Select]
// Init other sub-components.
call compile preprocessFileLineNumbers "SPON\Core\initEventHandlers.sqf";
//call compile preprocessFileLineNumbers "SPON\Core\initKeyEventHandlers.sqf";

As far as I tested, the rangefinder doesn't use the keyEventHandlers, so it is (or at least my test so far showed), harmless, as soon as you use ONLY the rangefinder, and do not use other script or functions that actually use the spoon core keyEventHandlers.

I don't know if you could fix this better, right now the way I fix it is enough for me, and I hope it helps others with the same problem.

PS - I posted this in the core thread by mistake, I have delete the post.
"When you're pushed, killing is as easy as breathing"
John Rambo

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #10 on: 05 Mar 2008, 20:52:51 »
You are quire right that SPON Rangefinder never needs to use keyEventHandlers, however...

SPON Core won't actually take control of the key event handler unless some script (SPON component or something else) actually creates a key event handler, so you don't actually have to comment out the running of that script as you have done. However, since you need to install SPON Core to get SPON Rangefinder to work, I assume that you have SPON Core in debug mode, which will enable the SPO N Core debug log which does use key event handlers. Just put SPON Core in "DEBUG_NONE" mode, since I assume you aren't using my trace commands yourself, and you should have no problems (i.e. key handling will be used if "DEBUG_CLIENT_SERVER" or "DEBUG_CLIENT" modes are used).

Well, the truth is that SPON keyEventHandlers (provided by SPON Core) are designed such that any number of scripts can co-exist using the same global key event handlers. I use this in SPON RearView, SPON Status, SPON Map (unrealised) and in SPON Core (specifically to bring up the debug log). Anyone else could use it to easily hook in their key event handlers without ever needing to edit SPON Core, but they choose not to, presumably because they don't want to require SPON Core for their scripts to work *shrugs* (it is quite easy though, to both be compatible with SPON keyEventHandlers and not require it's presence; should be easy to figure out, but ask if you need to know how).

If you do wish to use any of my key-handler using scripts with another person's scripts that use key handling (which doesn't include SPON Rangefinder, of course), it actually makes more sense, and would be infinitely easier, to alter the other script to be compatible with mine, since mine are designed to be easily hooked into ;P
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Zorasht

  • Members
  • *
    • 4th Perrus Squadron
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #11 on: 06 Mar 2008, 11:30:27 »
I knew it was an easy way. Thank you.  :good:
I'll try it later.

We will try the online mission  this friday, so I let you know if there is any problem with more than one spotter at the same time.

"When you're pushed, killing is as easy as breathing"
John Rambo

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder (DO NOT SUBMIT)
« Reply #12 on: 06 Mar 2008, 11:57:30 »
You shouldn't have problems with multiple spotters, but I haven't tested extensively in "real life" situations. Even if there are, I can probably fix any remaining problems in 1.09 which has better MP support. Now if only BIS would get around to releasing it properly...

Anyway, good luck with using this in your mission. Hope it turns out well!
« Last Edit: 06 Mar 2008, 11:59:31 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder v0.3.0 (READY)
« Reply #13 on: 05 Sep 2008, 16:07:19 »
v0.3.0 released!
Now available as a client-side addon
- Added
    * SPON_RF_targets array, which contains a list of all current laser target objects.
    * Can configure the type of rangefinder class used.
    * Player can switch between showing the azimuth and elevation displays with 6000, 6283, 6300, 6400 mils, or in degrees, by pressing the reload button (defaults to 'R') when looking through the laser designator..
    * New function, SPON_RF_setMilsPer360Degrees, so that mils displayed can be altered via script if needed.
    * New function, SPON_RF_enableMapMarker, so that you can enable fire mission marker shown on map at laser position [Suggested by Sickboy].

- Modified
    * "SPON_laserTargetFound" event renamed as "SPON_RF_targetFound"
    * Variable, "SPON_laserTargetOwner", added to each laser target object, renamed to "SPON_RF_owner".
    * Azimuth and elevation are now always shown, even if laser is not on (and even without batteries).

- Fixed
    * If two players on the same side turn on their rangefinders within a fraction of a second of each other, while looking at the same target (or at least in a similar direction), then one of them could incorrectly detect the wrong target. If this happens, they would only need to turn the rangefinder off and on again to get the correct reading.
    * Battery LED is still lit if the player isn't carrying any laser batteries.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: SPON Rangefinder v0.3.0 (READY)
« Reply #14 on: 07 Sep 2008, 09:50:20 »
testing  :good:

Offline etereotipo

  • Members
  • *
Re: SPON Rangefinder v0.3.0 (READY)
« Reply #15 on: 20 Sep 2008, 21:47:19 »
Hi.
First off, thanks for this script, is the best rangefinder out there.

However, it has a small issue.
The good thing about the rangefinders is to be able to use realistic sniper teams, with a shooter and a spotter. For that you need a great script like this to allow the spotter to tell off target's ranges.
And the other thing you need is a good addon like GMJ_SightAdjustment to allow you adjust the elevation  of the reticle based on the range to make a perfect shot. The famous quote "One Shot, One kill"  :D

And here is where the problem arise. Spoon core and GMJ_SightAdjustment use keyEventHandlers, and  as the rangefinder is loaded last, it overwrites the GMJ_SightAdjustment key settings to adjust the reticle. So if you load the script and the addon for the sight afjustments, you end up with a nice and working rangefinder and a useless GMJ_SightAdjustment addon.

I have found a "dirty" workaround, and this is to comment out the line in the initCore which initializes the keyEventHandlers

Code: (initCore.sqf) [Select]
// Init other sub-components.
call compile preprocessFileLineNumbers "SPON\Core\initEventHandlers.sqf";
//call compile preprocessFileLineNumbers "SPON\Core\initKeyEventHandlers.sqf";

As far as I tested, the rangefinder doesn't use the keyEventHandlers, so it is (or at least my test so far showed), harmless, as soon as you use ONLY the rangefinder, and do not use other script or functions that actually use the spoon core keyEventHandlers.

I don't know if you could fix this better, right now the way I fix it is enough for me, and I hope it helps others with the same problem.

PS - I posted this in the core thread by mistake, I have delete the post.


I have the same problem, and i don't know how i can fix it, if i put the SPON Rangefinder the addon GMJ_SightAdjustment don't work (i can't changes the MOAs) and if i comment the line "//call compile preprocessFileLineNumbers "SPON\Core\initKeyEventHandlers.sqf" i can change the MOAs and i can use the SPON Rangefinder but later i can't change the MOAs in the GMJ_SightAdjustment addon another time. Can someone help me please?

Thx

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder v0.3.0 (READY)
« Reply #16 on: 20 Sep 2008, 22:11:33 »
Rangefinder does use key events, in order to change the mils/degrees values shown (press R to cycle through them).

Sight Adjust, like most things, steals the key event handlers for itself, not allowing others to share it. To be compatible with SPON Core, use Shole's DEH, which includes a fixed version of the sight-adjustment that will be compatible with SPON. It also includes Shole's own NVG addon which is quite nice.

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline etereotipo

  • Members
  • *
Re: SPON Rangefinder v0.3.0 (READY)
« Reply #17 on: 20 Sep 2008, 22:15:08 »
Wow, ty for this rapid answer  :clap:

I will go to try this now  :good:

Thx another time ;)

EDIT: Work perfect!!!!  :yes:
« Last Edit: 20 Sep 2008, 22:27:10 by etereotipo »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: SPON Rangefinder v0.3.0 (ACCEPTED)
« Reply #18 on: 22 Feb 2009, 17:54:30 »
Found a movie for SPON Rangefinder while poking around the 'Net.

SPON Rangefinder v0.3.0 @ Xfire (Unofficial video; thanks to Delta99)
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)