mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 18:13:29 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e4379ada4 | ||
|
|
572b2a360f | ||
|
|
083ccd2906 | ||
|
|
35a45d2cd4 | ||
|
|
2b241fbeaf | ||
|
|
ad9ba834cc | ||
|
|
469403d9b5 | ||
|
|
01ea754f57 | ||
|
|
fd8a25790e | ||
|
|
9ede7237b8 | ||
|
|
1242b1f79f | ||
|
|
9f8f326446 | ||
|
|
bf3b0cf0d4 | ||
|
|
ef787a6a09 |
@@ -77,6 +77,9 @@ switch (toLower worldName) do {
|
||||
case "tanoa": {
|
||||
_realLocation = _position call armatak_fnc_convert_to_tanoa;
|
||||
};
|
||||
case "zagor_zagorsk_reserved_forest": {
|
||||
_realLocation = _position call armatak_fnc_convert_to_zagor_zagorsk_reserved_forest;
|
||||
};
|
||||
default {
|
||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||
|
||||
@@ -86,6 +86,9 @@ class CfgFunctions {
|
||||
class convert_to_vr {
|
||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_vr.sqf";
|
||||
};
|
||||
class convert_to_zagor_zagorsk_reserved_forest {
|
||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_zagor_zagorsk_reserved_forest.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,12 +3,12 @@ params ["_unit"];
|
||||
_digitalPointer = laserTarget _unit;
|
||||
|
||||
if (!isNull _digitalPointer) then {
|
||||
_digitalPointerPosition = _digitalPointer call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_link_uid = [_unit] call armatak_fnc_extract_uuid;
|
||||
_contact_callsign = ([player] call armatak_fnc_extract_unit_callsign) + ".DP1";
|
||||
|
||||
_dpCot = [_link_uid, _contact_callsign, _digitalPointerPosition select 0, _digitalPointerPosition select 1, _digitalPointerPosition select 2];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:send_digital_pointer_cot", [_dpCot]];
|
||||
_digitalPointerPosition = _digitalPointer call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_link_uid = [_unit] call armatak_fnc_extract_uuid;
|
||||
_contact_callsign = ([player] call armatak_fnc_extract_unit_callsign) + ".DP1";
|
||||
|
||||
_dpCot = [_link_uid, _contact_callsign, _digitalPointerPosition select 1, _digitalPointerPosition select 2, _digitalPointerPosition select 3];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:send_digital_pointer_cot", [_dpCot]];
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// function name: armatak_fnc_extract_drone
|
||||
// function name: armatak_fnc_send_drone_cot
|
||||
// function author: Valmo
|
||||
// function description: Gets the drone information for the CoT Router
|
||||
|
||||
params["_drone"];
|
||||
|
||||
private _atak_role = "a-f-A";
|
||||
private _atak_callsign = [_unit] call armatak_fnc_extract_unit_callsign;
|
||||
private _atak_callsign = [_drone] call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
switch (side _drone) do {
|
||||
case "WEST": {
|
||||
@@ -25,4 +25,10 @@ switch (side _drone) do {
|
||||
};
|
||||
};
|
||||
|
||||
_pre_defined_role = _drone getVariable "_atak_group_role";
|
||||
|
||||
if (!isNil "_pre_defined_role") then {
|
||||
_callsign = _pre_defined_role;
|
||||
};
|
||||
|
||||
_cot = [_drone, _atak_role, _atak_callsign] call armatak_fnc_send_marker_cot;
|
||||
|
||||
15
addons/main/functions/api/fn_send_enemy_cot.sqf
Normal file
15
addons/main/functions/api/fn_send_enemy_cot.sqf
Normal file
@@ -0,0 +1,15 @@
|
||||
// function name: armatak_fnc_send_eud_cot
|
||||
// function author: Valmo
|
||||
// function description: Gets the information necessary for generating the EUD Cursor Over Time
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
_type = _unit call armatak_fnc_extract_role;
|
||||
_callsign = _unit call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:send_marker_cot", [_marker_cot]];
|
||||
@@ -1,4 +1,4 @@
|
||||
// function name: armatak_fnc_extract_eud_cot_info
|
||||
// function name: armatak_fnc_send_eud_cot
|
||||
// function author: Valmo
|
||||
// function description: Gets the information necessary for generating the EUD Cursor Over Time
|
||||
|
||||
@@ -8,6 +8,5 @@ _position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
|
||||
_eud_cot = [_uuid, _position select 0, _position select 1, _position select 2, _callsign, _group_name, _group_role, _position select 3, speed player / 3.6];
|
||||
|
||||
_eud_cot = [_uuid, _position select 1, _position select 2, _position select 3, _callsign, _group_name, _group_role, _position select 5, _position select 6];
|
||||
"armatak" callExtension ["tcp_socket:send_eud_cot", [_eud_cot]];
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
params ["_unit", "_type", "_callsign"];
|
||||
|
||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
|
||||
_marker_cot = [_uuid, _type, _unit_position select 0, _unit_position select 1, _unit_position select 2, _callsign, _unit_position select 3, speed _unit / 3.6];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:send_marker_cot", [_marker_cot]];
|
||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
|
||||
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:send_marker_cot", [_marker_cot]];
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
params["_unit"];
|
||||
|
||||
_group = group _unit;
|
||||
_group_roles = ["Team Member", "Team Lead", "HQ", "Sniper", "Medic", "Forward Observer", "RTO", "K9"];
|
||||
_group_role = "Team Member";
|
||||
|
||||
if (["SpecialOperative", (configFile >> "CfgVehicles" >> typeOf _unit >> "role") call BIS_fnc_getCfgData, false] call BIS_fnc_inString) then {
|
||||
if (["SpecialOperative", (configOf _unit >> "role") call BIS_fnc_getCfgData, false] call BIS_fnc_inString) then {
|
||||
_group_role = _group_roles select 5;
|
||||
};
|
||||
|
||||
@@ -19,7 +20,7 @@ if (((backpack _unit) isKindOf "TFAR_Bag_Base") or (["radio", typeOf _unit, fals
|
||||
_group_role = _group_roles select 6;
|
||||
};
|
||||
|
||||
if ((["sniper", typeOf _unit, false] call BIS_fnc_inString) or (["marksman", (configFile >> "CfgVehicles" >> typeOf _unit >> "role") call BIS_fnc_getCfgData, false] call BIS_fnc_inString) or (["sharpshooter", typeOf _unit, false] call BIS_fnc_inString)) then {
|
||||
if ((["sniper", typeOf _unit, false] call BIS_fnc_inString) or (["marksman", (configOf _unit >> "role") call BIS_fnc_getCfgData, false] call BIS_fnc_inString) or (["sharpshooter", typeOf _unit, false] call BIS_fnc_inString)) then {
|
||||
_group_role = _group_roles select 3;
|
||||
};
|
||||
|
||||
@@ -34,7 +35,7 @@ if (["officer", typeOf _unit, false] call BIS_fnc_inString) then {
|
||||
_pre_defined_role = _unit getVariable "_atak_group_role";
|
||||
|
||||
if (!isNil "_pre_defined_role") then {
|
||||
_callsign = _pre_defined_callsign;
|
||||
_callsign = _pre_defined_role;
|
||||
};
|
||||
|
||||
_group_role
|
||||
|
||||
@@ -7,15 +7,15 @@ params["_unit"];
|
||||
private _callsign = "";
|
||||
|
||||
if ((([_unit] call BIS_fnc_objectType) select 0) == "Vehicle") then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
_callsign = getText (configOf _unit >> "displayName");
|
||||
|
||||
if (!isNull driver _unit) then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName") + " | " + ([name (driver _unit)] call armatak_fnc_shorten_name);
|
||||
_callsign = getText (configOf _unit >> "displayName") + " | " + ([name (driver _unit)] call armatak_fnc_shorten_name);
|
||||
};
|
||||
};
|
||||
|
||||
if (unitIsUAV _unit) then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
_callsign = getText (configOf _unit >> "displayName");
|
||||
|
||||
if (isUAVConnected _unit) then {
|
||||
_callsign = (_callsign) + "[ON]";
|
||||
|
||||
@@ -12,7 +12,7 @@ if (roleDescription _unit != "") then {
|
||||
_callsign = name _unit;
|
||||
|
||||
if (_callsign == "Error: No unit") then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
_callsign = getText (configOf _unit >> "displayName");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
params[_type, _message];
|
||||
params["_type", "_message"];
|
||||
|
||||
"armatak" callExtension ["log", [_type, _message]]
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
||||
|
||||
private _mapWidth = 30720;
|
||||
private _mapHeight = 30720;
|
||||
private _mapWidth = 8192;
|
||||
private _mapHeight = 8192;
|
||||
|
||||
// SW corner (used as origin)
|
||||
private _SW_lat = 39.456910;
|
||||
private _SW_lon = 24.940792;
|
||||
private _SW_lat = 39.458019;
|
||||
private _SW_lon = 24.939314;
|
||||
|
||||
// SE corner
|
||||
private _SE_lat = 39.459151;
|
||||
private _SE_lon = 25.083440;
|
||||
private _SE_lat = 39.458019;
|
||||
private _SE_lon = 25.081992;
|
||||
|
||||
// NW corner
|
||||
private _NW_lat = 39.567714;
|
||||
private _NW_lon = 24.937866;
|
||||
private _NW_lat = 39.568847;
|
||||
private _NW_lon = 24.939314;
|
||||
|
||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
||||
|
||||
private _mapWidth = 30720;
|
||||
private _mapHeight = 30720;
|
||||
private _mapWidth = 15360;
|
||||
private _mapHeight = 15360;
|
||||
|
||||
// SW corner (used as origin)
|
||||
private _SW_lat = -19.086825;
|
||||
private _SW_lon = 176.812772;
|
||||
private _SW_lat = -19.086803;
|
||||
private _SW_lon = 176.812619;
|
||||
|
||||
// SE corner
|
||||
private _SE_lat = -19.086825;
|
||||
private _SE_lon = 178.687920;
|
||||
private _SE_lat = -19.086803;
|
||||
private _SE_lon = 178.704583;
|
||||
|
||||
// NW corner
|
||||
private _NW_lat = -17.196898;
|
||||
private _NW_lon = 176.812622;
|
||||
private _NW_lat = -17.196900;
|
||||
private _NW_lon = 176.812619;
|
||||
|
||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
params["_latitude", "_longitude", "_altitude"];
|
||||
|
||||
_playerPosition = [_latitude, _longitude, _altitude];
|
||||
|
||||
_playerLatitude = _playerPosition select 0;
|
||||
_playerLongitude = _playerPosition select 1;
|
||||
|
||||
_playerMaxLongitude = 20480;
|
||||
_playerMaxLatitude = 20480;
|
||||
|
||||
_MapMaxLongitude = 48.351216;
|
||||
_MapMinLongitude = 48.097496;
|
||||
|
||||
_MapMaxLatitude = 38.345389;
|
||||
_MapMinLatitude = 37.956754;
|
||||
|
||||
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
||||
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
||||
|
||||
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
||||
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
||||
|
||||
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
||||
@@ -21,12 +21,12 @@ if (isServer) exitWith {
|
||||
|
||||
_syncUnits = synchronizedObjects _logic;
|
||||
|
||||
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
|
||||
missionNamespace setVariable ["armatak_server_syncedUnits", _syncUnits];
|
||||
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||
|
||||
[{
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||
|
||||
{
|
||||
_objectType = _x call BIS_fnc_objectType;
|
||||
@@ -45,13 +45,16 @@ if (isServer) exitWith {
|
||||
|
||||
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||
};
|
||||
};
|
||||
if (unitIsUAV _x) then {
|
||||
[_x] call armatak_fnc_send_drone_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
case ((_objectType select 0) == "VehicleAutonomous"): {
|
||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
[_x, _atak_type, _callsign] call armatak_fnc_send_drone_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
};
|
||||
};
|
||||
} forEach GVAR(syncedUnits);
|
||||
}, 2, []] call CBA_fnc_addPerFrameHandler;
|
||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
true;
|
||||
|
||||
@@ -25,36 +25,39 @@ missionNamespace setVariable ["armatak_tcp_socket_is_running", true];
|
||||
|
||||
_syncUnits = [];
|
||||
|
||||
missionNamespace setVariable ["armatak_marked_units", _syncUnits];
|
||||
missionNamespace setVariable ["armatak_server_syncedUnits", _syncUnits];
|
||||
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||
|
||||
[{
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||
[{
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||
|
||||
{
|
||||
_objectType = _x call BIS_fnc_objectType;
|
||||
switch (true) do {
|
||||
case ((_objectType select 0) == "Soldier"): {
|
||||
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||
{
|
||||
_objectType = _x call BIS_fnc_objectType;
|
||||
switch (true) do {
|
||||
case ((_objectType select 0) == "Soldier"): {
|
||||
_callsign = [_x] call armatak_fnc_extract_unit_callsign;
|
||||
_group_name = [group _x] call armatak_fnc_extract_group_color;
|
||||
_group_role = [_x] call armatak_fnc_extract_group_role;
|
||||
|
||||
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
};
|
||||
case ((_objectType select 0) == "Vehicle"): {
|
||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||
};
|
||||
case ((_objectType select 0) == "VehicleAutonomous"): {
|
||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
[_x, _atak_type, _callsign] call armatak_fnc_send_drone_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
};
|
||||
};
|
||||
case ((_objectType select 0) == "Vehicle"): {
|
||||
_atak_type = [_x] call armatak_fnc_extract_role;
|
||||
_callsign = [_x] call armatak_fnc_extract_marker_callsign;
|
||||
|
||||
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
|
||||
};
|
||||
};
|
||||
if (unitIsUAV _x) then {
|
||||
[_x] call armatak_fnc_send_drone_cot;
|
||||
[_x] call armatak_fnc_send_digital_pointer_cot;
|
||||
};
|
||||
} forEach GVAR(syncedUnits);
|
||||
}, 2, []] call CBA_fnc_addPerFrameHandler;
|
||||
} forEach GVAR(syncedUnits);
|
||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||
deleteVehicle _logic;
|
||||
closeDialog 1;
|
||||
|
||||
@@ -27,16 +27,16 @@ switch (false) do {
|
||||
deleteVehicle _logic;
|
||||
};
|
||||
default {
|
||||
if (_unit in (missionNamespace getVariable ["armatak_marked_units", []])) exitWith {
|
||||
if (_unit in (missionNamespace getVariable ["armatak_server_syncedUnits", []])) exitWith {
|
||||
["Unit already marked", "warning", "TCP Socket"] call EFUNC(main,notify);
|
||||
deleteVehicle _logic;
|
||||
};
|
||||
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_server_syncedUnits";
|
||||
|
||||
GVAR(syncedUnits) pushBack _unit;
|
||||
|
||||
missionNamespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||
missionNamespace setVariable ["armatak_server_syncedUnits", GVAR(syncedUnits)];
|
||||
SETVAR(_unit,GVAR(isRouting),true);
|
||||
|
||||
deleteVehicle _logic;
|
||||
|
||||
@@ -34,7 +34,7 @@ switch (false) do {
|
||||
};
|
||||
} forEach GVAR(syncedUnits);
|
||||
|
||||
missionNmaespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||
missionNmaespace setVariable ["armatak_server_syncedUnits", GVAR(syncedUnits)];
|
||||
SETVAR(_unit,GVAR(isRouting),false);
|
||||
|
||||
deleteVehicle _logic;
|
||||
|
||||
Reference in New Issue
Block a user