SPON Rangefinder v0.3.0
Copyright (C) 2007-8 Bil Bas (bil dot bagpuss at gmail dot com / a.k.a. Spooner)
License: GNU Lesser General Public License, version 3
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.
Background Information
Mils
A radian is a measure of an angle, such that there are 2π radians in a circle (360°). A milliradian is defined as being 1/1000th of a radian or 1/2000π of a circle. That is, there are
~6283.185 miliradians in 360°. The military, wanting to keep things simple,
use an approximate value for a milliradian, since that is adequate for most purposes (this is called a Mil). Unfortunately, the exact approximation each army uses is different to the rest:
Organisation | Mils in a revolution |
ELM (The Evil League of Mathematicians) | 2000π |
NATO (including US Army) | 6400 |
Soviet Union/Warsaw Pact | 6000 |
Sweden | 6300 |
USMC (Most accurate military approximation) | 6283 |
References
Installation (addon version)
- Install the XEH (Extended event handlers) addon by Solus. (Included)
- Install the SPON Core addon.
- Copy the "Addon Version/@SPON_Rangefinder" directory into your ArmA directory.
- Add " -mod=@XEH;@SPON_Core;@SPON_Rangefinder" to your ArmA shortcut target.
- SPON Rangefinder will then be available in any mission where a LaserDesignator is used, with default settings.
Installation (mission-script version)
- Ensure that you have the latest version of SPON Core installed in your
mission (see the README.txt within that package for full installation
instructions).
- Copy the "Scripts\SPON" directory into your mission folder.
- Add the following lines to your mission's "stringtable.csv" file
(only #include the file from Core once, regardless of how many SPON
components are used):
LANGUAGE, "English"
#include "SPON\Core\stringtable.csv"
#include "SPON\Rangefinder\stringtable.csv"
- Add the following lines to your mission's "description.ext" file:
#include "SPON\Core\ui\core.hpp"
class RscTitles
{
#include "SPON\Rangefinder\ui\rangefinder.hpp"
};
Note that you may need to merge the RscTitles class with another RscTitles class if you
have other scripts, that use this kind of resource, in your mission. For example:
#include "SPON\Core\ui\core.hpp"
class RscTitles
{
#include "SPON\Rangefinder\ui\rangefinder.hpp"
#include "SPON\Status\ui\status.hpp"
class CheeseDisplayRsc
{
//config for this display type...
};
};
- In your init.sqf (or init.sqs) file, include the following line (you may need to change the
parameters to suit your mission):
[] call compile preprocessFileLineNumbers "SPON\Rangefinder\initRangefinder.sqf";
Configuration
In your mission, whether you are using the mission-script or addon version,
you can configure a few things using these functions (If using the mission-script version, this should be done in init.sqf, after"SPON\Core\initRangefinder.sqf" is run):
Limitations
- While looking through a range-finder, with the laser off,
there is a hit to frames-per-second. This is in order to
ensure that range-finder users will have a responsive system when they turn the laser on and off.
When the laser is on, or the range-finder 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 ground position"
and it can still be targetted by bombers (BLAME BIS!).
- AI soldier do not use the SPON_rangefinder any differently than a regular LaserDesignator.
Known Issues
- When a player joins in progress, he will only be aware of the last
laser marker to be turned on (not all, if several are on at once).
WORKAROUND: Turning a laser off and on again, will correctly inform
JIP players of the laser's existance.
Plans
None.
Design Aims
- Add functionality that is present in the real SOFLAM, but which is missing from
the ArmA simulation.
- Avoid addons, in favour of scripting, as far as possible. 100% mission-scripts version available!
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.
v0.2.0
Added
- Global SPON_laserTargetFound event (parameters are: _target, _firer, _targetPositon)
when someone turns on their rangefinder. See SPON Core, or look in the
"init.sqf" file for details on how to capture SPON events.
- Variable, "SPON_laserTargetOwner", added to each laser target
(on ALL machines) to show who created and controls it.
Modified
- Demo moved to Sahrani, since Rahmadi is too small to test 10km
range-finding.
- Search for the rangefinder in a narrow corridor ahead of the player,
instead of all around the player. Since this will significanly
reduce the area in which to search, it will reduce game slowdowns (which
actually only occur when you are looking through a SOFLAM that isn't turned on).
Removed
- Due to optimisation in the target searching pattern, there is no need
to set the maximum range any more. Targets will always be found, up to
10km away from the player (the maximum view distance in ArmA).
Fixed
- There can only be a single rangefinder (SOFLAM) per SIDE in the mission
otherwise the distance readings can be faulty.
- If the maximum range of the rangefinder is less than the player's
view-distance, the player can paint targets that the rangefinder won't
v0.1.1
Added
- Demo soldier now has launcher, rifle and pistol to check that overlay
is seen regardless of current weapon.
Fixed
- Rangefinder overlay does not appear if you are unarmed or currently
wielding a pistol or launcher (only works if you switch to SOFLAM from a rifle).
v0.1.0
Added
- Configuration of maximum range to look for the laser
marker (which is the maximum range value that can be displayed).
- Configuration of angular unit-size to allow user to pick which
mils size to use (or, in fact, to use degrees or some other unit of measurement).
Modified
- Changed from displaying angles (azimuth/elevation) in degrees to displaying
them in user-configuable angular units. Configuration sets number of units,
ideally mils, in 360 degrees.
- Overlay is now always shown when looking though SOFLAM, even when the laser
is not on. While the laser is on, a laser-on LED is lit. If laser is turned
off, the last values continue to be shown.
v0.0.21
- Original release as part of SPON Scripts