mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 13:53:28 +00:00
Added Hellanmma map support
This commit is contained in:
@@ -107,6 +107,9 @@ switch (toLower worldName) do {
|
|||||||
case "rut_mandol": {
|
case "rut_mandol": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_rut_mandol;
|
_realLocation = _position call armatak_fnc_convert_to_rut_mandol;
|
||||||
};
|
};
|
||||||
|
case "hellanmaa": {
|
||||||
|
_realLocation = _position call armatak_fnc_convert_to_hellanmaa;
|
||||||
|
};
|
||||||
default {
|
default {
|
||||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ class CfgFunctions {
|
|||||||
class convert_to_rut_mandol {
|
class convert_to_rut_mandol {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_rut_mandol.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_rut_mandol.sqf";
|
||||||
};
|
};
|
||||||
|
class convert_to_hellanmaa {
|
||||||
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_hellanmaa.sqf";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
30
addons/main/functions/map/fn_convert_to_hellanmaa.sqf
Normal file
30
addons/main/functions/map/fn_convert_to_hellanmaa.sqf
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
||||||
|
|
||||||
|
private _mapWidth = 8192;
|
||||||
|
private _mapHeight = 8192;
|
||||||
|
|
||||||
|
// SW corner (used as origin)
|
||||||
|
private _SW_lat = 63.005389;
|
||||||
|
private _SW_lon = 22.638957;
|
||||||
|
|
||||||
|
// SE corner
|
||||||
|
private _SE_lat = 63.010092;
|
||||||
|
private _SE_lon = 22.800107;
|
||||||
|
|
||||||
|
// NW corner
|
||||||
|
private _NW_lat = 63.078713;
|
||||||
|
private _NW_lon = 22.628542;
|
||||||
|
|
||||||
|
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||||
|
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||||
|
|
||||||
|
private _edgeNW_lat = _NW_lat - _SW_lat;
|
||||||
|
private _edgeNW_lon = _NW_lon - _SW_lon;
|
||||||
|
|
||||||
|
private _fx = _longitudeInGame / _mapWidth;
|
||||||
|
private _fy = _latitudeInGame / _mapHeight;
|
||||||
|
|
||||||
|
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||||
|
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||||
|
|
||||||
|
[_realLat, _realLon, _altitude]
|
||||||
Reference in New Issue
Block a user