[WIP] refactoring extract info function into more functions to handle the data to be grabbed

This commit is contained in:
Valmo Trindade
2024-07-23 16:58:06 -03:00
parent 9d89c5fb69
commit 8603dd6d93
4 changed files with 66 additions and 9 deletions

View File

@@ -0,0 +1,11 @@
params["_unit"];
private _callsign = "";
if (roleDescription _unit != "") then {
_callsign = name _unit + " | " + roleDescription _unit;
} else {
_callsign = name _unit;
};
_callsign

View File

@@ -0,0 +1,22 @@
params["_unit"];
private _role = "Gnd Combat Infantry Rifleman";
/*
TODO - Provide one of these options using tons of ifs
"Gnd Combat Infantry Rifleman", Nickname: "Rifleman"
"Gnd Combat Infantry grenadier", Nickname: "Grenadier"
"Gnd Combat Infantry Mortar" , Nickname: "Mortar"
"Gnd Combat Infantry MachineGunner (LMG)", Nickname: "LMG"
"Gnd Combat Infantry Medic" , Nickname: "Medic"
"Gnd Combat Infantry Sniper", Nickname: "Sniper"
"Gnd Combat Infantry Recon" , Nickname: "Recon"
"Gnd Combat Infantry anti Tank" , Nickname: "anti Tank"
"Gnd Combat Infantry air defense", Nickname: "AA"
"Gnd Combat Infantry Engineer", Nickname: "Engineer"
"Ground"
"Gnd Equip Vehic Civilian", Nickname: Vehicle (OK)
"Gnd Equip Vehic Ambulance": "a-.-G-E-V-m" , Nickname: Ambulance (OK)
*/
_role

View File

@@ -1,14 +1,32 @@
// function name: armatak_fnc_extract_info
// function author: Valmo
// function description: Receives a player's unit as param and return the information array needed to send the HTTP request
params["_unit"];
// ATAK UTIL INFOS
private _atak_uid = getPlayerUID _unit; // ATAK Get Player UID
private _atak_callsign = name _unit; // ATAK Display Name
private _atak_team_color = "team_color"; // ATAK Team Colors -> White, Yellow, Orange, Magenta, Red, Maroon, Purple, Dark Blue, Blue, Cyan, Teal, Green, Dark Green, Brown || Change it on every squad? make it customizable?
private _atak_role = "role"; // ATAK Roles -> Team Member, Team Lead, HQ, Sniper, Medic, Forward Observer, RTO, K9
private _atak_display_type = "display_type"; // ATAK Display Types -> Ground Troop, Armored Vehicle, Civilian Vehicle, Generic Air Unit, Generic Ground Unit, Generic Sea Surface Unit
private _atak_location = worldName; // ATAK Location in Real World -> Already stored in a database or array
private _atak_position = getPos _unit; // ATAK Position -> Converted Arma 3 XYZ Coords to Geographic Coords
private _atak_uid = getPlayerUID _unit;
private _atak_callsign = [_unit] call armatak_fnc_extract_callsign;
private _atak_bearing = getDir _unit;
private _atak_team_color = "team_color";
private _atak_role = [_unit] call armatak_fnc_extract_role;
private _atak_location = worldName;
private _atak_position = getPos _unit;
_unit_info = [_atak_uid, _atak_callsign, _atak_team_color, _atak_role, _atak_display_type, _atak_location, _atak_position];
/*
desired object
{
"longitude": -77.0104,
"latitude": 38.889,
"attitude": "hostile",
"bearing": 132, getDir function
"geoObject": "Gnd Combat Infantry Sniper", extract_role function
"how": "nonCoT", -- default and won't change
"name": "Putin",
"timeout": 600
}
*/
_unit_info = [_atak_uid, _atak_callsign, _atak_bearing ,_atak_team_color, _atak_role, _atak_display_type, _atak_location, _atak_position];
_unit_info