From b98c321a630825b0ff586fd003f4c4dad68a7048 Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Fri, 19 Jul 2024 02:11:31 -0300 Subject: [PATCH] added intial sqf functions --- addons/main/CfgFunctions.hpp | 13 +++++++++++++ addons/main/config.cpp | 3 ++- addons/main/functions/fn_core.sqf | 9 +++++++++ addons/main/functions/fn_extract_info.sqf | 12 ++++++++++++ addons/main/functions/fn_init.sqf | 9 +++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 addons/main/CfgFunctions.hpp create mode 100644 addons/main/functions/fn_core.sqf create mode 100644 addons/main/functions/fn_extract_info.sqf create mode 100644 addons/main/functions/fn_init.sqf diff --git a/addons/main/CfgFunctions.hpp b/addons/main/CfgFunctions.hpp new file mode 100644 index 0000000..228390d --- /dev/null +++ b/addons/main/CfgFunctions.hpp @@ -0,0 +1,13 @@ +class CfgFunctions { + class armatak { + class core { + file = "\armatak\armatak\armatak_main\functions\fn_core.sqf"; + }; + class init { + file = "\armatak\armatak\armatak_main\functions\fn_init.sqf"; + }; + class extract_info { + file = "\armatak\armatak\armatak_main\functions\fn_extract_info.sqf"; + }; + }; +}; \ No newline at end of file diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 329a5c6..3c32333 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -12,4 +12,5 @@ class CfgPatches { }; }; -#include "CfgCommands.hpp" \ No newline at end of file +#include "CfgCommands.hpp" +#include "CfgFunctions.hpp" \ No newline at end of file diff --git a/addons/main/functions/fn_core.sqf b/addons/main/functions/fn_core.sqf new file mode 100644 index 0000000..96de241 --- /dev/null +++ b/addons/main/functions/fn_core.sqf @@ -0,0 +1,9 @@ +// function name: armatak_fnc_map_not_found +// function author: Valmo +// function description: Main bootstrap function for the mod + +params[]; + +if (!isServer) then { + return; +}; \ No newline at end of file diff --git a/addons/main/functions/fn_extract_info.sqf b/addons/main/functions/fn_extract_info.sqf new file mode 100644 index 0000000..64b7fe9 --- /dev/null +++ b/addons/main/functions/fn_extract_info.sqf @@ -0,0 +1,12 @@ +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/array +private _atak_position = getPos _unit; // ATAK Position -> Converted Arma 3 XYZ Coords to Geographic Coords + +return [_atak_uid, _atak_callsign, _atak_team_color, _atak_role, _atak_display_type, _atak_location, _atak_position]; \ No newline at end of file diff --git a/addons/main/functions/fn_init.sqf b/addons/main/functions/fn_init.sqf new file mode 100644 index 0000000..223f82c --- /dev/null +++ b/addons/main/functions/fn_init.sqf @@ -0,0 +1,9 @@ +// 1. Create FreeTAKServer instance +// .... +if (!isServer) exitWith {}; + +private _armatak_fts_server_url = "armatak" callExtension ["init",[]]; + +if (!_armatak_fts_server_url) exitWith {}; + +missionNamespace setVariable ["armatak_fts_server_url", _armatak_fts_server_url];