Skip to content

Commit

Permalink
update default range
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed May 8, 2017
1 parent 3664b6c commit 8f1ca32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ The tracker will always point directly at the target, no matter the reception. I
### Reception
The reception has no influence on the tracking accuracy, but at 0 reception the tracker will show "NO SIGNAL" instead of the arrow. It can be used to give the user a rough idea about his distance to the target.

The `reception code` parameter will take a function that returns a number. 0 and below means no reception, 100 and above means full reception. The following parameters are passed to the function:
The `reception code` parameter will take any function that returns a number. 0 and below means no reception, 1 and above means full reception. The following parameters are passed to the function:

Parameter | Explanation
---------------|---------------------------------------------
unit | object - The unit that is using the tracker.
target | object or position - The current target.
updateInterval | number - The current update interval.

You can use this to create a sophisticated, nonlinear reception function. By default this function is used:
You can use this to create a sophisticated, nonlinear reception function. By default this function is used, which gives the device a maximum range of 2000m:

```sqf
params ["_unit","_target","_updateInterval"];
private _reception = 1 - (_unit distance2D _target)/100;
private _reception = 1 - (_unit distance2D _target)/2000;
_reception
```
2 changes: 1 addition & 1 deletion functions/fn_openDialog.sqf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "..\component.hpp"

params ["_target",["_updateInterval",0.5],["_size",1],["_offsetX",1],["_offsetY",1],["_receptionCode",{params ["_unit","_target","_updateInterval"]; private _reception = 1 - (_unit distance2D _target)/100; _reception}]];
params ["_target",["_updateInterval",0.5],["_size",1],["_offsetX",1],["_offsetY",1],["_receptionCode",{params ["_unit","_target","_updateInterval"]; private _reception = 1 - (_unit distance2D _target)/2000; _reception}]];

if (!isNil "_target") then {[_target] call grad_gpsTracker_fnc_setTarget};

Expand Down
2 changes: 1 addition & 1 deletion functions/fn_openTitle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"grad_gpsTracker_layer" cutRsc ["RscTitleDisplayEmpty","PLAIN",0,false];

[{!isNull (uiNamespace getVariable ["RscTitleDisplayEmpty",displayNull])}, {
params ["_target",["_updateInterval",0.5],["_size",1],["_offsetX",1],["_offsetY",1],["_receptionCode",{params ["_unit","_target","_updateInterval"]; private _reception = 1 - (_unit distance2D _target)/100; _reception}],["_duration",-1]];
params ["_target",["_updateInterval",0.5],["_size",1],["_offsetX",1],["_offsetY",1],["_receptionCode",{params ["_unit","_target","_updateInterval"]; private _reception = 1 - (_unit distance2D _target)/2000; _reception}],["_duration",-1]];

if (!isNil "_target") then {[_target] call grad_gpsTracker_fnc_setTarget};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grad-gpstracker",
"description": "GPS Tracker dialog with a basic API.",
"version": "0.0.3",
"version": "0.0.4",
"author": "McDiod"
}

0 comments on commit 8f1ca32

Please sign in to comment.