+ To import this preset, drag this file onto the Launcher window. Or click the MODS tab, then PRESET in the top right, then IMPORT at the bottom, and finally select this file.
+
+
+
+
\ No newline at end of file
diff --git a/.hemtt/project.toml b/.hemtt/project.toml
new file mode 100644
index 0000000..9f9f086
--- /dev/null
+++ b/.hemtt/project.toml
@@ -0,0 +1,9 @@
+name = "Clarkson's Logi Framework"
+author = "Clarky"
+prefix = "clf"
+mainprefix = "z"
+
+[files]
+include = [
+ "LICENSE"
+]
diff --git a/Addons/logistics/$PBOPREFIX$ b/Addons/logistics/$PBOPREFIX$
deleted file mode 100644
index d5220d8..0000000
--- a/Addons/logistics/$PBOPREFIX$
+++ /dev/null
@@ -1 +0,0 @@
-z\clf\addons\logistics
\ No newline at end of file
diff --git a/Addons/logistics/XEH_postInit.sqf b/Addons/logistics/XEH_postInit.sqf
deleted file mode 100644
index 84f2529..0000000
--- a/Addons/logistics/XEH_postInit.sqf
+++ /dev/null
@@ -1 +0,0 @@
-#include "script_component.hpp"
\ No newline at end of file
diff --git a/Addons/logistics/script_component.hpp b/Addons/logistics/script_component.hpp
deleted file mode 100644
index 303375e..0000000
--- a/Addons/logistics/script_component.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#define COMPONENT logistics
-#define COMPONENT_BEAUTIFIED Logistics
-#include "\z\clf\addons\logistics\script_mod.hpp"
-
-// #define DEBUG_MODE_FULL
-#define DISABLE_COMPILE_CACHE
-// #define ENABLE_PERFORMANCE_COUNTERS
-
-//#ifdef DEBUG_ENABLED_MAIN
-// #define DEBUG_MODE_FULL
-//#endif
-
-//#ifdef DEBUG_SETTINGS_MAIN
-// #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
-//#endif
-
-#include "\z\clf\addons\logistics\script_macros.hpp"
diff --git a/Addons/logistics/script_macros.hpp b/Addons/logistics/script_macros.hpp
deleted file mode 100644
index a62ce7d..0000000
--- a/Addons/logistics/script_macros.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "\x\cba\addons\main\script_macros_common.hpp"
-#include "\x\cba\addons\xeh\script_xeh.hpp"
-
-// New PREP macros
-#undef PREP
-#ifdef DISABLE_COMPILE_CACHE
- // no compile cache
- #define PREP(fncName) TRIPLES(ADDON,fnc,fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf)
- #define PREP_S(fncName,subfolder) TRIPLES(ADDON,fnc,fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\subfolder\DOUBLES(fnc,fncName).sqf)
-#else
- // compile cache
- #define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
- #define PREP_S(fncName,subfolder) [QPATHTOF(functions\subfolder\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
-#endif
\ No newline at end of file
diff --git a/Addons/logistics/script_version.hpp b/Addons/logistics/script_version.hpp
deleted file mode 100644
index 3c21de2..0000000
--- a/Addons/logistics/script_version.hpp
+++ /dev/null
@@ -1,4 +0,0 @@
-#define MAJOR 1
-#define MINOR 1
-#define PATCHLVL 1
-#define BUILD 1
\ No newline at end of file
diff --git a/Addons/main/$PBOPREFIX$ b/Addons/main/$PBOPREFIX$
new file mode 100644
index 0000000..6cc5d14
--- /dev/null
+++ b/Addons/main/$PBOPREFIX$
@@ -0,0 +1 @@
+z\clf\addons\main
\ No newline at end of file
diff --git a/Addons/logistics/CfgEditorSubcategories.hpp b/Addons/main/CfgEditorSubcategories.hpp
similarity index 97%
rename from Addons/logistics/CfgEditorSubcategories.hpp
rename to Addons/main/CfgEditorSubcategories.hpp
index 16b3c53..901f916 100644
--- a/Addons/logistics/CfgEditorSubcategories.hpp
+++ b/Addons/main/CfgEditorSubcategories.hpp
@@ -4,4 +4,4 @@ class CfgEditorSubcategories {
displayName = CSTRING(Category_Logistics);
};
};
-*/
\ No newline at end of file
+*/
diff --git a/Addons/logistics/CfgEventHandlers.hpp b/Addons/main/CfgEventHandlers.hpp
similarity index 99%
rename from Addons/logistics/CfgEventHandlers.hpp
rename to Addons/main/CfgEventHandlers.hpp
index adaa9cc..ed22a92 100644
--- a/Addons/logistics/CfgEventHandlers.hpp
+++ b/Addons/main/CfgEventHandlers.hpp
@@ -23,4 +23,4 @@ class Extended_PostInit_EventHandlers
// init = "call compile preprocessFileLineNumbers 'logistics\\XEH_preInit.sqf'";
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
-};
\ No newline at end of file
+};
diff --git a/Addons/logistics/cfgFunctions.hpp b/Addons/main/CfgFunctions.hpp
similarity index 99%
rename from Addons/logistics/cfgFunctions.hpp
rename to Addons/main/CfgFunctions.hpp
index 5efe153..180a5cb 100644
--- a/Addons/logistics/cfgFunctions.hpp
+++ b/Addons/main/CfgFunctions.hpp
@@ -37,4 +37,4 @@ class CfgFunctions
};
};
-*/
\ No newline at end of file
+*/
diff --git a/Addons/logistics/CfgModuleCategories.hpp b/Addons/main/CfgModuleCategories.hpp
similarity index 99%
rename from Addons/logistics/CfgModuleCategories.hpp
rename to Addons/main/CfgModuleCategories.hpp
index 86fa242..792d8c3 100644
--- a/Addons/logistics/CfgModuleCategories.hpp
+++ b/Addons/main/CfgModuleCategories.hpp
@@ -18,4 +18,4 @@ class CfgFactionClasses {
side = 7;
};
*/
-};
\ No newline at end of file
+};
diff --git a/Addons/logistics/cfgVehicles.hpp b/Addons/main/CfgVehicles.hpp
similarity index 100%
rename from Addons/logistics/cfgVehicles.hpp
rename to Addons/main/CfgVehicles.hpp
diff --git a/Addons/logistics/XEH_PREP.hpp b/Addons/main/XEH_PREP.hpp
similarity index 95%
rename from Addons/logistics/XEH_PREP.hpp
rename to Addons/main/XEH_PREP.hpp
index 2b0a06d..35d6a48 100644
--- a/Addons/logistics/XEH_PREP.hpp
+++ b/Addons/main/XEH_PREP.hpp
@@ -29,4 +29,4 @@ PREP_S(moduleInitFOB,modules);
PREP_S(moduleInitHQ,modules);
PREP_S(moduleInitMaterielDepot,modules);
PREP_S(moduleInitOreDepot,modules);
-PREP_S(moduleInitSupplyVehicle,modules);
\ No newline at end of file
+PREP_S(moduleInitSupplyVehicle,modules);
diff --git a/Addons/main/XEH_postInit.sqf b/Addons/main/XEH_postInit.sqf
new file mode 100644
index 0000000..421c54b
--- /dev/null
+++ b/Addons/main/XEH_postInit.sqf
@@ -0,0 +1 @@
+#include "script_component.hpp"
diff --git a/Addons/logistics/XEH_preInit.sqf b/Addons/main/XEH_preInit.sqf
similarity index 92%
rename from Addons/logistics/XEH_preInit.sqf
rename to Addons/main/XEH_preInit.sqf
index 03f4828..b7cd7be 100644
--- a/Addons/logistics/XEH_preInit.sqf
+++ b/Addons/main/XEH_preInit.sqf
@@ -12,7 +12,9 @@
] call CBA_settings_fnc_init;
*/
+PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
+PREP_RECOMPILE_END;
// Setting up for auto-naming of new bases etc. in mission
GVAR(baseNames) = [
@@ -50,4 +52,4 @@ GVAR(opforBaseIndex) = 0;
GVAR(independentBaseIndex) = 0;
GVAR(civilianBaseIndex) = 0;
-#include "initSettings.inc.sqf"
\ No newline at end of file
+#include "initSettings.inc.sqf"
diff --git a/Addons/logistics/XEH_preStart.sqf b/Addons/main/XEH_preStart.sqf
similarity index 100%
rename from Addons/logistics/XEH_preStart.sqf
rename to Addons/main/XEH_preStart.sqf
diff --git a/Addons/logistics/config.cpp b/Addons/main/config.cpp
similarity index 63%
rename from Addons/logistics/config.cpp
rename to Addons/main/config.cpp
index 84fc6d6..41b614d 100644
--- a/Addons/logistics/config.cpp
+++ b/Addons/main/config.cpp
@@ -4,6 +4,7 @@ class CfgPatches
{
class ADDON
{
+ name = QUOTE(COMPONENT);
units[] = {
QGVAR(initHQ),
QGVAR(initFOB),
@@ -25,24 +26,24 @@ class CfgPatches
};
};
-/*
+
class CfgMods {
class PREFIX {
- dir = "@ace";
- name = "Advanced Combat Environment 3";
- picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca";
- hidePicture = "true";
+ dir = "@clf";
+ name = "Clarkson's Logi Framework";
+ //picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca";
+ //hidePicture = "true";
hideName = "true";
- actionName = "Website";
- action = CSTRING(URL);
- description = "Issue Tracker: https://github.com/acemod/ACE3/issues";
+ //actionName = "Website";
+ //action = CSTRING(URL);
+ //description = "Issue Tracker: https://github.com/acemod/ACE3/issues";
};
};
-*/
+
#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"
#include "CfgVehicles.hpp"
#include "CfgModuleCategories.hpp"
-// #include "ui\gui.hpp"
\ No newline at end of file
+// #include "ui\gui.hpp"
diff --git a/Addons/logistics/fn_template.sqf b/Addons/main/functions/fnc_template.sqf
similarity index 100%
rename from Addons/logistics/fn_template.sqf
rename to Addons/main/functions/fnc_template.sqf
diff --git a/Addons/logistics/functions/fnc_vehicleLoadMateriel.sqf b/Addons/main/functions/fnc_vehicleLoadMateriel.sqf
similarity index 100%
rename from Addons/logistics/functions/fnc_vehicleLoadMateriel.sqf
rename to Addons/main/functions/fnc_vehicleLoadMateriel.sqf
diff --git a/Addons/logistics/functions/fnc_vehicleLoadOre.sqf b/Addons/main/functions/fnc_vehicleLoadOre.sqf
similarity index 100%
rename from Addons/logistics/functions/fnc_vehicleLoadOre.sqf
rename to Addons/main/functions/fnc_vehicleLoadOre.sqf
diff --git a/Addons/logistics/functions/fnc_vehicleUnloadMateriel.sqf b/Addons/main/functions/fnc_vehicleUnloadMateriel.sqf
similarity index 100%
rename from Addons/logistics/functions/fnc_vehicleUnloadMateriel.sqf
rename to Addons/main/functions/fnc_vehicleUnloadMateriel.sqf
diff --git a/Addons/logistics/functions/fnc_vehicleUnloadOre.sqf b/Addons/main/functions/fnc_vehicleUnloadOre.sqf
similarity index 100%
rename from Addons/logistics/functions/fnc_vehicleUnloadOre.sqf
rename to Addons/main/functions/fnc_vehicleUnloadOre.sqf
diff --git a/Addons/logistics/functions/init/fnc_initEngineeringBay.sqf b/Addons/main/functions/init/fnc_initEngineeringBay.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initEngineeringBay.sqf
rename to Addons/main/functions/init/fnc_initEngineeringBay.sqf
index 11418aa..f5394af 100644
--- a/Addons/logistics/functions/init/fnc_initEngineeringBay.sqf
+++ b/Addons/main/functions/init/fnc_initEngineeringBay.sqf
@@ -41,4 +41,4 @@ if (_hq isNotEqualTo "") then {
"CLF_fnc_initEngineeringBayInteractions",
0,
true
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initEngineeringBayInteractions.sqf b/Addons/main/functions/init/fnc_initEngineeringBayInteractions.sqf
similarity index 97%
rename from Addons/logistics/functions/init/fnc_initEngineeringBayInteractions.sqf
rename to Addons/main/functions/init/fnc_initEngineeringBayInteractions.sqf
index 4d475a9..5eb7754 100644
--- a/Addons/logistics/functions/init/fnc_initEngineeringBayInteractions.sqf
+++ b/Addons/main/functions/init/fnc_initEngineeringBayInteractions.sqf
@@ -24,7 +24,7 @@
params ["_engineering"];
-_factory addAction [
+_engineering addAction [
"Open Vehicle Engineering",
{
@@ -45,4 +45,4 @@ _factory addAction [
"",
"true", // Figure out a way to lock this to player side checks (macros?)
6
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initFOB.sqf b/Addons/main/functions/init/fnc_initFOB.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initFOB.sqf
rename to Addons/main/functions/init/fnc_initFOB.sqf
index 30d893c..8cfc0c5 100644
--- a/Addons/logistics/functions/init/fnc_initFOB.sqf
+++ b/Addons/main/functions/init/fnc_initFOB.sqf
@@ -54,4 +54,4 @@ _fob setVariable [
"CLF_fnc_initFOBInteractions",
0,
true
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initFOBInteractions.sqf b/Addons/main/functions/init/fnc_initFOBInteractions.sqf
similarity index 100%
rename from Addons/logistics/functions/init/fnc_initFOBInteractions.sqf
rename to Addons/main/functions/init/fnc_initFOBInteractions.sqf
diff --git a/Addons/logistics/functions/init/fnc_initFactory.sqf b/Addons/main/functions/init/fnc_initFactory.sqf
similarity index 97%
rename from Addons/logistics/functions/init/fnc_initFactory.sqf
rename to Addons/main/functions/init/fnc_initFactory.sqf
index 9c58c61..ff0324e 100644
--- a/Addons/logistics/functions/init/fnc_initFactory.sqf
+++ b/Addons/main/functions/init/fnc_initFactory.sqf
@@ -82,7 +82,7 @@ _factory setVariable [
_currentOre = _currentOre + (_x getVariable ["currentOre", 0]);
} forEach _oreDepots;
- if !(_currentOre > 0) exitWith {};
+ if (_currentOre <= 0) exitWith {};
private _freeSpace = 0;
@@ -111,7 +111,7 @@ _factory setVariable [
{
// If the _amount is now at 0, exit the loop early
- if (_amount <= 0) exitWith {};
+ if (_amountToConvert <= 0) exitWith {};
// Get currently looped depot's materiel and draw down from it
private _depotMateriel = _x getVariable "currentMateriel";
diff --git a/Addons/logistics/functions/init/fnc_initFactoryInteractions.sqf b/Addons/main/functions/init/fnc_initFactoryInteractions.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initFactoryInteractions.sqf
rename to Addons/main/functions/init/fnc_initFactoryInteractions.sqf
index be868c2..78b2e42 100644
--- a/Addons/logistics/functions/init/fnc_initFactoryInteractions.sqf
+++ b/Addons/main/functions/init/fnc_initFactoryInteractions.sqf
@@ -52,4 +52,4 @@ _factory addAction [
"",
"true",
6
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initHQ.sqf b/Addons/main/functions/init/fnc_initHQ.sqf
similarity index 95%
rename from Addons/logistics/functions/init/fnc_initHQ.sqf
rename to Addons/main/functions/init/fnc_initHQ.sqf
index 95eb9a3..3685576 100644
--- a/Addons/logistics/functions/init/fnc_initHQ.sqf
+++ b/Addons/main/functions/init/fnc_initHQ.sqf
@@ -69,8 +69,8 @@ switch (_side) do
};
private _baseMarker = createMarker [format ["%1 [HQ]", _name], _hq];
-_baseMarker setMarkerShape "ICON";
-_baseMarker setMarkerType "mil_dot";
+_baseMarker setMarkerShapeLocal "ICON";
+_baseMarker setMarkerTypeLocal "mil_dot";
_baseMarker setMarkerText format ["%1 [HQ]", _name];
// TODO - Set colour based on side. Also figure out better icon.
@@ -94,4 +94,4 @@ _hq setVariable [
QFUNC(initHQInteractions),
0,
true
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initHQInteractions.sqf b/Addons/main/functions/init/fnc_initHQInteractions.sqf
similarity index 100%
rename from Addons/logistics/functions/init/fnc_initHQInteractions.sqf
rename to Addons/main/functions/init/fnc_initHQInteractions.sqf
diff --git a/Addons/logistics/functions/init/fnc_initMaterielDepot.sqf b/Addons/main/functions/init/fnc_initMaterielDepot.sqf
similarity index 92%
rename from Addons/logistics/functions/init/fnc_initMaterielDepot.sqf
rename to Addons/main/functions/init/fnc_initMaterielDepot.sqf
index 6afebdb..1f4c290 100644
--- a/Addons/logistics/functions/init/fnc_initMaterielDepot.sqf
+++ b/Addons/main/functions/init/fnc_initMaterielDepot.sqf
@@ -23,7 +23,7 @@ if (!isServer) exitWith {};
_depot setVariable ["isSupplyDepot", true, true];
_depot setVariable ["maxMateriel", _maxMateriel, true];
_depot setVariable ["currentMateriel", _currentMateriel, true];
-_depot setVariable ["materielRate", _materielRate, true];
+_depot setVariable ["generationRate", _generationRate, true];
// Wait to run the initialisaion for mission start -- Prevents base push until HQ object is initialised
if (_base isNotEqualTo "") then {
@@ -54,7 +54,7 @@ if (_generationRate > 0) then {
[
{
params ["_args", "_handle"];
- _args params ["_depot", "_materielRate"];
+ _args params ["_depot", "_generationRate"];
if (!alive _depot || isNull _depot) then {
[_handle] call CBA_fnc_removePerFrameHandler;
@@ -70,7 +70,7 @@ if (_generationRate > 0) then {
_depotMax - _depotCurrent;
private _amount =
- (_materielRate min _freeSpace);
+ (_generationRate min _freeSpace);
_depot setVariable [
"currentMateriel",
@@ -79,6 +79,6 @@ if (_generationRate > 0) then {
];
},
30,
- [_depot, _materielRate]
+ [_depot, _generationRate]
] call CBA_fnc_addPerFrameHandler;
};
diff --git a/Addons/logistics/functions/init/fnc_initMaterielDepotInteractions.sqf b/Addons/main/functions/init/fnc_initMaterielDepotInteractions.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initMaterielDepotInteractions.sqf
rename to Addons/main/functions/init/fnc_initMaterielDepotInteractions.sqf
index e7f9658..7b43c05 100644
--- a/Addons/logistics/functions/init/fnc_initMaterielDepotInteractions.sqf
+++ b/Addons/main/functions/init/fnc_initMaterielDepotInteractions.sqf
@@ -55,4 +55,4 @@ _depot addAction [
"",
"true",
6
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initOreDepot.sqf b/Addons/main/functions/init/fnc_initOreDepot.sqf
similarity index 94%
rename from Addons/logistics/functions/init/fnc_initOreDepot.sqf
rename to Addons/main/functions/init/fnc_initOreDepot.sqf
index 10ec52d..7e3c014 100644
--- a/Addons/logistics/functions/init/fnc_initOreDepot.sqf
+++ b/Addons/main/functions/init/fnc_initOreDepot.sqf
@@ -23,7 +23,7 @@ if (!isServer) exitWith {};
_depot setVariable ["isOreDepot", true, true];
_depot setVariable ["maxOre", _maxOre, true];
_depot setVariable ["currentOre", _currentOre, true];
-_depot setVariable ["oreRate", _generationRate, true];
+_depot setVariable ["generationRate", _generationRate, true];
// Wait to run the initialisaion for mission start -- Prevents base push until HQ object is initialised
if (_base isNotEqualTo "") then {
@@ -70,7 +70,7 @@ if (_generationRate > 0) then {
_depotMax - _depotCurrent;
private _amount =
- (_oreRate min _freeSpace);
+ (_generationRate min _freeSpace);
_depot setVariable [
"currentOre",
@@ -79,6 +79,6 @@ if (_generationRate > 0) then {
];
},
30,
- [_depot, _oreRate]
+ [_depot, _generationRate]
] call CBA_fnc_addPerFrameHandler;
};
diff --git a/Addons/logistics/functions/init/fnc_initOreDepotInteractions.sqf b/Addons/main/functions/init/fnc_initOreDepotInteractions.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initOreDepotInteractions.sqf
rename to Addons/main/functions/init/fnc_initOreDepotInteractions.sqf
index bb27b63..a3b7419 100644
--- a/Addons/logistics/functions/init/fnc_initOreDepotInteractions.sqf
+++ b/Addons/main/functions/init/fnc_initOreDepotInteractions.sqf
@@ -55,4 +55,4 @@ _depot addAction [
"",
"true",
6
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/init/fnc_initSupplyVehicle.sqf b/Addons/main/functions/init/fnc_initSupplyVehicle.sqf
similarity index 94%
rename from Addons/logistics/functions/init/fnc_initSupplyVehicle.sqf
rename to Addons/main/functions/init/fnc_initSupplyVehicle.sqf
index 33c9c39..2a80e92 100644
--- a/Addons/logistics/functions/init/fnc_initSupplyVehicle.sqf
+++ b/Addons/main/functions/init/fnc_initSupplyVehicle.sqf
@@ -21,7 +21,7 @@ params ["_vehicle", "_maxLoad", "_currentMateriel", "_currentOre", "_transferRat
if (!isServer) exitWith {};
_vehicle setVariable ["isSupplyVehicle", true, true];
-_vehicle setVariable ["maxLoad", _maxMateriel, true];
+_vehicle setVariable ["maxLoad", _maxLoad, true];
_vehicle setVariable ["currentMateriel", _currentMateriel, true];
_vehicle setVariable ["currentOre", _currentOre, true];
_vehicle setVariable ["transferRate", _transferRate, true];
diff --git a/Addons/logistics/functions/init/fnc_initSupplyVehicleInteractions.sqf b/Addons/main/functions/init/fnc_initSupplyVehicleInteractions.sqf
similarity index 99%
rename from Addons/logistics/functions/init/fnc_initSupplyVehicleInteractions.sqf
rename to Addons/main/functions/init/fnc_initSupplyVehicleInteractions.sqf
index e3facdf..3a3dc9b 100644
--- a/Addons/logistics/functions/init/fnc_initSupplyVehicleInteractions.sqf
+++ b/Addons/main/functions/init/fnc_initSupplyVehicleInteractions.sqf
@@ -284,4 +284,4 @@ _vehicle addAction [
false, // Remove on completion
false, // Show in unconscious state
true // Show on screen
-] call BIS_fnc_holdActionAdd;
\ No newline at end of file
+] call BIS_fnc_holdActionAdd;
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitEngineeringBay.sqf b/Addons/main/functions/modules/fnc_moduleInitEngineeringBay.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitEngineeringBay.sqf
rename to Addons/main/functions/modules/fnc_moduleInitEngineeringBay.sqf
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitFOB.sqf b/Addons/main/functions/modules/fnc_moduleInitFOB.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitFOB.sqf
rename to Addons/main/functions/modules/fnc_moduleInitFOB.sqf
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitFactory.sqf b/Addons/main/functions/modules/fnc_moduleInitFactory.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitFactory.sqf
rename to Addons/main/functions/modules/fnc_moduleInitFactory.sqf
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitHQ.sqf b/Addons/main/functions/modules/fnc_moduleInitHQ.sqf
similarity index 99%
rename from Addons/logistics/functions/modules/fnc_moduleInitHQ.sqf
rename to Addons/main/functions/modules/fnc_moduleInitHQ.sqf
index cac7a8a..029eafe 100644
--- a/Addons/logistics/functions/modules/fnc_moduleInitHQ.sqf
+++ b/Addons/main/functions/modules/fnc_moduleInitHQ.sqf
@@ -27,4 +27,4 @@ diag_log format [
diag_log format [
"Attached objects: %1",
attachedObjects _logic
-];
\ No newline at end of file
+];
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitMaterielDepot.sqf b/Addons/main/functions/modules/fnc_moduleInitMaterielDepot.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitMaterielDepot.sqf
rename to Addons/main/functions/modules/fnc_moduleInitMaterielDepot.sqf
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitOreDepot.sqf b/Addons/main/functions/modules/fnc_moduleInitOreDepot.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitOreDepot.sqf
rename to Addons/main/functions/modules/fnc_moduleInitOreDepot.sqf
diff --git a/Addons/logistics/functions/modules/fnc_moduleInitSupplyVehicle.sqf b/Addons/main/functions/modules/fnc_moduleInitSupplyVehicle.sqf
similarity index 100%
rename from Addons/logistics/functions/modules/fnc_moduleInitSupplyVehicle.sqf
rename to Addons/main/functions/modules/fnc_moduleInitSupplyVehicle.sqf
diff --git a/Addons/logistics/initSettings.inc.sqf b/Addons/main/initSettings.inc.sqf
similarity index 98%
rename from Addons/logistics/initSettings.inc.sqf
rename to Addons/main/initSettings.inc.sqf
index e3b5142..0eab57a 100644
--- a/Addons/logistics/initSettings.inc.sqf
+++ b/Addons/main/initSettings.inc.sqf
@@ -10,4 +10,4 @@
2
]
] call CBA_fnc_addSetting;
-*/
\ No newline at end of file
+*/
diff --git a/Addons/main/script_component.hpp b/Addons/main/script_component.hpp
new file mode 100644
index 0000000..a75cb6f
--- /dev/null
+++ b/Addons/main/script_component.hpp
@@ -0,0 +1,13 @@
+#define COMPONENT main
+#define COMPONENT_BEAUTIFIED Main
+#include "\z\clf\addons\main\script_mod.hpp"
+
+//#ifdef DEBUG_ENABLED_MAIN
+// #define DEBUG_MODE_FULL
+//#endif
+
+//#ifdef DEBUG_SETTINGS_MAIN
+// #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
+//#endif
+
+#include "\z\clf\addons\main\script_macros.hpp"
diff --git a/Addons/main/script_debug.hpp b/Addons/main/script_debug.hpp
new file mode 100644
index 0000000..f879524
--- /dev/null
+++ b/Addons/main/script_debug.hpp
@@ -0,0 +1,11 @@
+// Fast Recompiling via function
+// To Use: [] call ADDON_PREP_RECOMPILE; where ADDON is your prefix, e.g. TUT
+#ifdef DISABLE_COMPILE_CACHE
+ #define LINKFUNC(x) {call FUNC(x)}
+ #define PREP_RECOMPILE_START if (isNil QUOTE(DOUBLES(ADDON,PREP_RECOMPILE))) then {DOUBLES(ADDON,RECOMPILES) = []; DOUBLES(ADDON,PREP_RECOMPILE) = {{call _x} forEach DOUBLES(ADDON,RECOMPILES);}}; private _recomp = {
+ #define PREP_RECOMPILE_END }; call _recomp; DOUBLES(ADDON,RECOMPILES) pushBack _recomp;
+#else
+ #define LINKFUNC(x) FUNC(x)
+ #define PREP_RECOMPILE_START ; // disabled
+ #define PREP_RECOMPILE_END ; // disabled
+#endif
diff --git a/Addons/main/script_macros.hpp b/Addons/main/script_macros.hpp
new file mode 100644
index 0000000..882f8d8
--- /dev/null
+++ b/Addons/main/script_macros.hpp
@@ -0,0 +1,33 @@
+#include "\x\cba\addons\main\script_macros_common.hpp"
+#include "\x\cba\addons\xeh\script_xeh.hpp"
+#include "script_debug.hpp"
+
+// Disables compile cache when debug mode is enabled. Makes file patching work.
+#ifdef DEBUG_MODE_FULL
+ #define DISABLE_COMPILE_CACHE
+#endif
+
+/*
+// New PREP macros - including a subfolder variant which will enable me to organise my functions for my own sanity
+#undef PREP
+#ifdef DISABLE_COMPILE_CACHE
+ // no compile cache
+ #define PREP(function) TRIPLES(ADDON,fnc,function) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,function).sqf)
+ #define PREP_S(function,subfolder) TRIPLES(ADDON,fnc,function) = compile preprocessFileLineNumbers QPATHTOF(functions\subfolder\DOUBLES(fnc,function).sqf)
+#else
+ // compile cache
+ #define PREP(function) [QPATHTOF(functions\DOUBLES(fnc,function).sqf), QFUNC(function)] call CBA_fnc_compileFunction
+ #define PREP_S(function,subfolder) [QPATHTOF(functions\subfolder\DOUBLES(fnc,function).sqf), QFUNC(function)] call CBA_fnc_compileFunction
+#endif
+*/
+// Utilising helper PREP maccro redefines from https://github.com/flufflesamy/CBA-Tutorial/
+// CBA XEH PREP macro override for when compile cache is disabled.
+#ifdef DISABLE_COMPILE_CACHE
+ #undef PREP
+ #define PREP(function) TRIPLES(ADDON,fnc,function) = compile preprocessFileLineNumbers '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT_F\functions\DOUBLES(fnc,function).sqf'
+ #define PREP_S(function,subfolder) TRIPLES(ADDON,fnc,function) = compile preprocessFileLineNumbers '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT_F\functions\subfolder\DOUBLES(fnc,function).sqf'
+#else
+ #undef PREP
+ #define PREP(function) ['\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT_F\functions\DOUBLES(fnc,function).sqf', 'TRIPLES(ADDON,fnc,function)'] call SLX_XEH_COMPILE_NEW
+ #define PREP_S(function,subfolder) ['\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT_F\functions\subfolder\DOUBLES(fnc,function).sqf', 'TRIPLES(ADDON,fnc,function)'] call SLX_XEH_COMPILE_NEW
+#endif
diff --git a/Addons/logistics/script_mod.hpp b/Addons/main/script_mod.hpp
similarity index 80%
rename from Addons/logistics/script_mod.hpp
rename to Addons/main/script_mod.hpp
index 8e61759..27b2476 100644
--- a/Addons/logistics/script_mod.hpp
+++ b/Addons/main/script_mod.hpp
@@ -4,13 +4,14 @@
#define PREFIX clf
#define SUBPREFIX addons
-#define ADDON DOUBLES(PREFIX,COMPONENT)
+// Enables debug mode. Comment out on release.
+#define DEBUG_MODE_FULL
#include "script_version.hpp"
#define VERSION MAJOR.MINOR
-#define VERSION_STR MAJOR.MINOR.PATCHLVL.BUILD
-#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
+#define VERSION_STR MAJOR.MINOR.PATCH.BUILD
+#define VERSION_AR MAJOR,MINOR,PATCH,BUILD
// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 2.22
diff --git a/Addons/main/script_version.hpp b/Addons/main/script_version.hpp
new file mode 100644
index 0000000..295d154
--- /dev/null
+++ b/Addons/main/script_version.hpp
@@ -0,0 +1,4 @@
+#define MAJOR 0
+#define MINOR 1
+#define PATCH 1
+#define BUILD 20
diff --git a/Addons/logistics/stringtable.xml b/Addons/main/stringtable.xml
similarity index 98%
rename from Addons/logistics/stringtable.xml
rename to Addons/main/stringtable.xml
index 455affa..6a94c26 100644
--- a/Addons/logistics/stringtable.xml
+++ b/Addons/main/stringtable.xml
@@ -18,4 +18,4 @@
UPDATE ME
-
\ No newline at end of file
+
diff --git a/Addons/logistics/ui/RscModuleAttributes.hpp b/Addons/main/ui/RscModuleAttributes.hpp
similarity index 99%
rename from Addons/logistics/ui/RscModuleAttributes.hpp
rename to Addons/main/ui/RscModuleAttributes.hpp
index 59513bc..1cc6518 100644
--- a/Addons/logistics/ui/RscModuleAttributes.hpp
+++ b/Addons/main/ui/RscModuleAttributes.hpp
@@ -21,4 +21,4 @@ class RscDisplayAttributes {
class ButtonOK;
class ButtonCancel;
};
-};
\ No newline at end of file
+};
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..67e952b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,630 @@
+Copyright (C) 2026 Clarky
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
diff --git a/include/x/cba/addons/main/$PBOPREFIX$ b/include/x/cba/addons/main/$PBOPREFIX$
new file mode 100644
index 0000000..835b0c9
--- /dev/null
+++ b/include/x/cba/addons/main/$PBOPREFIX$
@@ -0,0 +1 @@
+x\cba\addons\main
\ No newline at end of file
diff --git a/include/x/cba/addons/main/script_macros_common.hpp b/include/x/cba/addons/main/script_macros_common.hpp
new file mode 100644
index 0000000..8aab821
--- /dev/null
+++ b/include/x/cba/addons/main/script_macros_common.hpp
@@ -0,0 +1,1857 @@
+/*
+ Header: script_macros_common.hpp
+
+ Description:
+ A general set of useful macro functions for use by CBA itself or by any module that uses CBA.
+
+ Authors:
+ Sickboy and Spooner
+*/
+
+/* ****************************************************
+ New - Should be exported to general addon
+ Aim:
+ - Simplify (shorten) the amount of characters required for repetitive tasks
+ - Provide a solid structure that can be dynamic and easy editable (Which sometimes means we cannot adhere to Aim #1 ;-)
+ An example is the path that is built from defines. Some available in this file, others in mods and addons.
+
+ Follows Standard:
+ Object variables: PREFIX_COMPONENT
+ Main-object variables: PREFIX_main
+ Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf
+ e.g: x\six\addons\sys_menu\fDate.sqf
+
+ Usage:
+ define PREFIX and COMPONENT, then include this file
+ (Note, you could have a main addon for your mod, define the PREFIX in a macros.hpp,
+ and include this script_macros_common.hpp file.
+ Then in your addons, add a component.hpp, define the COMPONENT,
+ and include your mod's script_macros.hpp
+ In your scripts you can then include the addon's component.hpp with relative path)
+
+ use in subcomponents (subconfigs)
+ define SUBCOMPONENT and include parent component's script_component.hpp
+ currently only supported by SUBADDON, additional macros may be added in the future
+
+ TODO:
+ - Try only to use 1 string type " vs '
+ - Evaluate double functions, and simplification
+ - Evaluate naming scheme; current = prototype
+ - Evaluate "Debug" features..
+ - Evaluate "create mini function per precompiled script, that will load the script on first usage, rather than on init"
+ - Also saw "Namespace" typeName, evaluate which we need :P
+ - Single/Multi player gamelogics? (Incase of MP, you would want only 1 gamelogic per component, which is pv'ed from server, etc)
+ */
+
+#ifndef MAINPREFIX
+ #define MAINPREFIX x
+#endif
+
+#ifndef SUBPREFIX
+ #define SUBPREFIX addons
+#endif
+
+#ifndef MAINLOGIC
+ #define MAINLOGIC main
+#endif
+
+#define ADDON DOUBLES(PREFIX,COMPONENT)
+#define MAIN_ADDON DOUBLES(PREFIX,main)
+
+#ifdef SUBCOMPONENT
+ #define SUBADDON DOUBLES(ADDON,SUBCOMPONENT)
+#endif
+
+/* -------------------------------------------
+Macro: VERSION_CONFIG
+ Define CBA Versioning System config entries.
+
+ VERSION should be a floating-point number (1 separator).
+ VERSION_STR is a string representation of the version.
+ VERSION_AR is an array representation of the version.
+
+ VERSION must always be defined, otherwise it is 0.
+ VERSION_STR and VERSION_AR default to VERSION if undefined.
+
+Parameters:
+ None
+
+Example:
+ (begin example)
+ #define VERSION 1.0
+ #define VERSION_STR 1.0.1
+ #define VERSION_AR 1,0,1
+
+ class CfgPatches {
+ class MyMod_main {
+ VERSION_CONFIG;
+ };
+ };
+ (end)
+
+Author:
+ ?, Jonpas
+------------------------------------------- */
+#ifndef VERSION
+ #define VERSION 0
+#endif
+
+#ifndef VERSION_STR
+ #define VERSION_STR VERSION
+#endif
+
+#ifndef VERSION_AR
+ #define VERSION_AR VERSION
+#endif
+
+#ifndef VERSION_CONFIG
+ #define VERSION_CONFIG version = VERSION; versionStr = QUOTE(VERSION_STR); versionAr[] = {VERSION_AR}
+#endif
+
+/* -------------------------------------------
+Group: Debugging
+------------------------------------------- */
+
+/* -------------------------------------------
+Macros: DEBUG_MODE_x
+ Managing debugging based on debug level.
+
+ According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included,
+ only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL.
+
+ DEBUG_MODE_FULL - Full debugging output.
+ DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified).
+ DEBUG_MODE_MINIMAL - Only and enabled.
+
+Examples:
+ In order to turn on full debugging for a single file,
+ (begin example)
+ // Top of individual script file.
+ #define DEBUG_MODE_FULL
+ #include "script_component.hpp"
+ (end)
+
+ In order to force minimal debugging for a single component,
+ (begin example)
+ // Top of addons\\script_component.hpp
+ // Ensure that any FULL and NORMAL setting from the individual files are undefined and MINIMAL is set.
+ #ifdef DEBUG_MODE_FULL
+ #undef DEBUG_MODE_FULL
+ #endif
+ #ifdef DEBUG_MODE_NORMAL
+ #undef DEBUG_MODE_NORMAL
+ #endif
+ #ifndef DEBUG_MODE_MINIMAL
+ #define DEBUG_MODE_MINIMAL
+ #endif
+ #include "script_macros.hpp"
+ (end)
+
+ In order to turn on full debugging for a whole addon,
+ (begin example)
+ // Top of addons\main\script_macros.hpp
+ #ifndef DEBUG_MODE_FULL
+ #define DEBUG_MODE_FULL
+ #endif
+ #include "\x\cba\addons\main\script_macros_common.hpp"
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+
+// If DEBUG_MODE_FULL, then also enable DEBUG_MODE_NORMAL.
+#ifdef DEBUG_MODE_FULL
+#define DEBUG_MODE_NORMAL
+#endif
+
+// If DEBUG_MODE_NORMAL, then also enable DEBUG_MODE_MINIMAL.
+#ifdef DEBUG_MODE_NORMAL
+#define DEBUG_MODE_MINIMAL
+#endif
+
+// If no debug modes specified, use DEBUG_MODE_NORMAL (+ DEBUG_MODE_MINIMAL).
+#ifndef DEBUG_MODE_MINIMAL
+#define DEBUG_MODE_NORMAL
+#define DEBUG_MODE_MINIMAL
+#endif
+
+#define LOG_SYS_FORMAT(LEVEL,MESSAGE) format ['[%1] (%2) %3: %4', toUpper 'PREFIX', 'COMPONENT', LEVEL, MESSAGE]
+
+#ifdef DEBUG_SYNCHRONOUS
+#define LOG_SYS(LEVEL,MESSAGE) diag_log text LOG_SYS_FORMAT(LEVEL,MESSAGE)
+#else
+#define LOG_SYS(LEVEL,MESSAGE) LOG_SYS_FORMAT(LEVEL,MESSAGE) call CBA_fnc_log
+#endif
+
+#define LOG_SYS_FILELINENUMBERS(LEVEL,MESSAGE) LOG_SYS(LEVEL,format [ARR_4('%1 %2:%3',MESSAGE,__FILE__,__LINE__ + 1)])
+
+/* -------------------------------------------
+Macro: LOG()
+ Log a debug message into the RPT log.
+
+ Only run if is defined.
+
+Parameters:
+ MESSAGE - Message to record
+
+Example:
+ (begin example)
+ LOG("Initiated clog-dancing simulator.");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#ifdef DEBUG_MODE_FULL
+
+#define LOG(MESSAGE) LOG_SYS('LOG',MESSAGE)
+#define LOG_1(MESSAGE,ARG1) LOG(FORMAT_1(MESSAGE,ARG1))
+#define LOG_2(MESSAGE,ARG1,ARG2) LOG(FORMAT_2(MESSAGE,ARG1,ARG2))
+#define LOG_3(MESSAGE,ARG1,ARG2,ARG3) LOG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define LOG_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) LOG(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define LOG_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) LOG(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define LOG_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) LOG(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define LOG_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) LOG(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define LOG_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) LOG(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+#else
+
+#define LOG(MESSAGE) /* disabled */
+#define LOG_1(MESSAGE,ARG1) /* disabled */
+#define LOG_2(MESSAGE,ARG1,ARG2) /* disabled */
+#define LOG_3(MESSAGE,ARG1,ARG2,ARG3) /* disabled */
+#define LOG_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) /* disabled */
+#define LOG_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) /* disabled */
+#define LOG_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) /* disabled */
+#define LOG_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) /* disabled */
+#define LOG_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) /* disabled */
+
+#endif
+
+/* -------------------------------------------
+Macro: INFO()
+ Record a message without file and line number in the RPT log.
+
+Parameters:
+ MESSAGE - Message to record
+
+Example:
+ (begin example)
+ INFO("Mod X is loaded, do Y");
+ (end)
+
+Author:
+ commy2
+------------------------------------------- */
+#define INFO(MESSAGE) LOG_SYS('INFO',MESSAGE)
+#define INFO_1(MESSAGE,ARG1) INFO(FORMAT_1(MESSAGE,ARG1))
+#define INFO_2(MESSAGE,ARG1,ARG2) INFO(FORMAT_2(MESSAGE,ARG1,ARG2))
+#define INFO_3(MESSAGE,ARG1,ARG2,ARG3) INFO(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define INFO_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) INFO(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define INFO_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) INFO(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define INFO_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) INFO(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define INFO_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) INFO(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define INFO_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) INFO(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+/* -------------------------------------------
+Macro: WARNING()
+ Record a non-critical error in the RPT log.
+
+ Only run if or higher is defined.
+
+Parameters:
+ MESSAGE - Message to record
+
+Example:
+ (begin example)
+ WARNING("This function has been deprecated. Please don't use it in future!");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#ifdef DEBUG_MODE_NORMAL
+
+#define WARNING(MESSAGE) LOG_SYS('WARNING',MESSAGE)
+#define WARNING_1(MESSAGE,ARG1) WARNING(FORMAT_1(MESSAGE,ARG1))
+#define WARNING_2(MESSAGE,ARG1,ARG2) WARNING(FORMAT_2(MESSAGE,ARG1,ARG2))
+#define WARNING_3(MESSAGE,ARG1,ARG2,ARG3) WARNING(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define WARNING_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) WARNING(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define WARNING_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) WARNING(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define WARNING_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) WARNING(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define WARNING_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) WARNING(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define WARNING_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) WARNING(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+#else
+
+#define WARNING(MESSAGE) /* disabled */
+#define WARNING_1(MESSAGE,ARG1) /* disabled */
+#define WARNING_2(MESSAGE,ARG1,ARG2) /* disabled */
+#define WARNING_3(MESSAGE,ARG1,ARG2,ARG3) /* disabled */
+#define WARNING_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) /* disabled */
+#define WARNING_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) /* disabled */
+#define WARNING_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) /* disabled */
+#define WARNING_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) /* disabled */
+#define WARNING_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) /* disabled */
+
+#endif
+
+/* -------------------------------------------
+Macro: ERROR()
+ Record a critical error in the RPT log.
+
+Parameters:
+ MESSAGE - Message to record
+
+Example:
+ (begin example)
+ ERROR("value of frog not found in config ...yada...yada...");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ERROR(MESSAGE) LOG_SYS('ERROR',MESSAGE)
+#define ERROR_1(MESSAGE,ARG1) ERROR(FORMAT_1(MESSAGE,ARG1))
+#define ERROR_2(MESSAGE,ARG1,ARG2) ERROR(FORMAT_2(MESSAGE,ARG1,ARG2))
+#define ERROR_3(MESSAGE,ARG1,ARG2,ARG3) ERROR(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define ERROR_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) ERROR(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define ERROR_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) ERROR(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define ERROR_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) ERROR(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define ERROR_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) ERROR(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define ERROR_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) ERROR(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+/* -------------------------------------------
+Macro: ERROR_MSG()
+ Record a critical error in the RPT log and display on screen error message.
+
+ Newlines (\n) in the MESSAGE will be put on separate lines.
+
+Parameters:
+ MESSAGE - Message to record
+
+Example:
+ (begin example)
+ ERROR_MSG("value of frog not found in config ...yada...yada...");
+ (end)
+
+Author:
+ commy2
+------------------------------------------- */
+#define ERROR_MSG(MESSAGE) ['PREFIX', 'COMPONENT', nil, MESSAGE, __FILE__, __LINE__ + 1] call CBA_fnc_error
+#define ERROR_MSG_1(MESSAGE,ARG1) ERROR_MSG(FORMAT_1(MESSAGE,ARG1))
+#define ERROR_MSG_2(MESSAGE,ARG1,ARG2) ERROR_MSG(FORMAT_2(MESSAGE,ARG1,ARG2))
+#define ERROR_MSG_3(MESSAGE,ARG1,ARG2,ARG3) ERROR_MSG(FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define ERROR_MSG_4(MESSAGE,ARG1,ARG2,ARG3,ARG4) ERROR_MSG(FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define ERROR_MSG_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) ERROR_MSG(FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define ERROR_MSG_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) ERROR_MSG(FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define ERROR_MSG_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) ERROR_MSG(FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define ERROR_MSG_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) ERROR_MSG(FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+/* -------------------------------------------
+Macro: ERROR_WITH_TITLE()
+ Record a critical error in the RPT log.
+
+ The title can be specified (in the heading is always just "ERROR")
+ Newlines (\n) in the MESSAGE will be put on separate lines.
+
+Parameters:
+ TITLE - Title of error message
+ MESSAGE - Body of error message
+
+Example:
+ (begin example)
+ ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada...");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ERROR_WITH_TITLE(TITLE,MESSAGE) ['PREFIX', 'COMPONENT', TITLE, MESSAGE, __FILE__, __LINE__ + 1] call CBA_fnc_error
+#define ERROR_WITH_TITLE_1(TITLE,MESSAGE,ARG1) ERROR_WITH_TITLE(TITLE,FORMAT_1(MESSAGE,ARG1))
+#define ERROR_WITH_TITLE_2(TITLE,MESSAGE,ARG1,ARG2) ERROR_WITH_TITLE(TITLE,FORMAT_2(MESSAGE,ARG1,ARG2))
+#define ERROR_WITH_TITLE_3(TITLE,MESSAGE,ARG1,ARG2,ARG3) ERROR_WITH_TITLE(TITLE,FORMAT_3(MESSAGE,ARG1,ARG2,ARG3))
+#define ERROR_WITH_TITLE_4(TITLE,MESSAGE,ARG1,ARG2,ARG3,ARG4) ERROR_WITH_TITLE(TITLE,FORMAT_4(MESSAGE,ARG1,ARG2,ARG3,ARG4))
+#define ERROR_WITH_TITLE_5(TITLE,MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5) ERROR_WITH_TITLE(TITLE,FORMAT_5(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5))
+#define ERROR_WITH_TITLE_6(TITLE,MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) ERROR_WITH_TITLE(TITLE,FORMAT_6(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6))
+#define ERROR_WITH_TITLE_7(TITLE,MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) ERROR_WITH_TITLE(TITLE,FORMAT_7(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7))
+#define ERROR_WITH_TITLE_8(TITLE,MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) ERROR_WITH_TITLE(TITLE,FORMAT_8(MESSAGE,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8))
+
+/* -------------------------------------------
+Macro: MESSAGE_WITH_TITLE()
+ Record a single line in the RPT log.
+
+Parameters:
+ TITLE - Title of log message
+ MESSAGE - Body of message
+
+Example:
+ (begin example)
+ MESSAGE_WITH_TITLE("Value found","Value of frog found in config ");
+ (end)
+
+Author:
+ Killswitch
+------------------------------------------- */
+#define MESSAGE_WITH_TITLE(TITLE,MESSAGE) LOG_SYS_FILELINENUMBERS(TITLE,MESSAGE)
+
+/* -------------------------------------------
+Macro: RETDEF()
+ If a variable is undefined, return the default value. Otherwise, return the
+ variable itself.
+
+Parameters:
+ VARIABLE - the variable to check
+ DEFAULT_VALUE - the default value to use if variable is undefined
+
+Example:
+ (begin example)
+ // _var is undefined
+ hintSilent format ["_var=%1", RETDEF(_var,5)]; // "_var=5"
+ _var = 7;
+ hintSilent format ["_var=%1", RETDEF(_var,5)]; // "_var=7"
+ (end example)
+Author:
+ 654wak654
+------------------------------------------- */
+#define RETDEF(VARIABLE,DEFAULT_VALUE) (if (isNil {VARIABLE}) then [{DEFAULT_VALUE}, {VARIABLE}])
+
+/* -------------------------------------------
+Macro: RETNIL()
+ If a variable is undefined, return the value nil. Otherwise, return the
+ variable itself.
+
+Parameters:
+ VARIABLE - the variable to check
+
+Example:
+ (begin example)
+ // _var is undefined
+ hintSilent format ["_var=%1", RETNIL(_var)]; // "_var=any"
+ (end example)
+
+Author:
+ Alef (see CBA issue #8514)
+------------------------------------------- */
+#define RETNIL(VARIABLE) RETDEF(VARIABLE,nil)
+
+/* -------------------------------------------
+Macros: TRACE_n()
+ Log a message and 1-8 variables to the RPT log.
+
+ Only run if is defined.
+
+ TRACE_1(MESSAGE,A) - Log 1 variable.
+ TRACE_2(MESSAGE,A,B) - Log 2 variables.
+ TRACE_3(MESSAGE,A,B,C) - Log 3 variables.
+ TRACE_4(MESSAGE,A,B,C,D) - Log 4 variables.
+ TRACE_5(MESSAGE,A,B,C,D,E) - Log 5 variables.
+ TRACE_6(MESSAGE,A,B,C,D,E,F) - Log 6 variables.
+ TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables.
+ TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables.
+ TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables.
+
+Parameters:
+ MESSAGE - Message to add to the trace [String]
+ A..H - Variable names to log values of [Any]
+
+Example:
+ (begin example)
+ TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player));
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define PFORMAT_1(MESSAGE,A) format ['%1: A=%2', MESSAGE, RETNIL(A)]
+
+#define PFORMAT_2(MESSAGE,A,B) \
+ format ['%1: A=%2, B=%3', MESSAGE, RETNIL(A), RETNIL(B)]
+
+#define PFORMAT_3(MESSAGE,A,B,C) \
+ format ['%1: A=%2, B=%3, C=%4', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C)]
+
+#define PFORMAT_4(MESSAGE,A,B,C,D) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D)]
+
+#define PFORMAT_5(MESSAGE,A,B,C,D,E) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E)]
+
+#define PFORMAT_6(MESSAGE,A,B,C,D,E,F) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F)]
+
+#define PFORMAT_7(MESSAGE,A,B,C,D,E,F,G) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G)]
+
+#define PFORMAT_8(MESSAGE,A,B,C,D,E,F,G,H) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H)]
+
+#define PFORMAT_9(MESSAGE,A,B,C,D,E,F,G,H,I) \
+ format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I)]
+
+
+#ifdef DEBUG_MODE_FULL
+#define TRACE_1(MESSAGE,A) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_1(str diag_frameNo + ' ' + (MESSAGE),A))
+#define TRACE_2(MESSAGE,A,B) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_2(str diag_frameNo + ' ' + (MESSAGE),A,B))
+#define TRACE_3(MESSAGE,A,B,C) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_3(str diag_frameNo + ' ' + (MESSAGE),A,B,C))
+#define TRACE_4(MESSAGE,A,B,C,D) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_4(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D))
+#define TRACE_5(MESSAGE,A,B,C,D,E) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_5(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D,E))
+#define TRACE_6(MESSAGE,A,B,C,D,E,F) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_6(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D,E,F))
+#define TRACE_7(MESSAGE,A,B,C,D,E,F,G) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_7(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D,E,F,G))
+#define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_8(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D,E,F,G,H))
+#define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) LOG_SYS_FILELINENUMBERS('TRACE',PFORMAT_9(str diag_frameNo + ' ' + (MESSAGE),A,B,C,D,E,F,G,H,I))
+#else
+#define TRACE_1(MESSAGE,A) /* disabled */
+#define TRACE_2(MESSAGE,A,B) /* disabled */
+#define TRACE_3(MESSAGE,A,B,C) /* disabled */
+#define TRACE_4(MESSAGE,A,B,C,D) /* disabled */
+#define TRACE_5(MESSAGE,A,B,C,D,E) /* disabled */
+#define TRACE_6(MESSAGE,A,B,C,D,E,F) /* disabled */
+#define TRACE_7(MESSAGE,A,B,C,D,E,F,G) /* disabled */
+#define TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) /* disabled */
+#define TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) /* disabled */
+#endif
+
+/* -------------------------------------------
+Group: General
+------------------------------------------- */
+
+// *************************************
+// Internal Functions
+#define DOUBLES(var1,var2) var1##_##var2
+#define TRIPLES(var1,var2,var3) var1##_##var2##_##var3
+#define QUOTE(var1) #var1
+
+#ifdef MODULAR
+ #define COMPONENT_T DOUBLES(t,COMPONENT)
+ #define COMPONENT_M DOUBLES(m,COMPONENT)
+ #define COMPONENT_S DOUBLES(s,COMPONENT)
+ #define COMPONENT_C DOUBLES(c,COMPONENT)
+ #define COMPONENT_F COMPONENT_C
+#else
+ #define COMPONENT_T COMPONENT
+ #define COMPONENT_M COMPONENT
+ #define COMPONENT_S COMPONENT
+ #define COMPONENT_F COMPONENT
+ #define COMPONENT_C COMPONENT
+#endif
+
+/* -------------------------------------------
+Macro: INC()
+
+Description:
+ Increase a number by one.
+
+Parameters:
+ VAR - Variable to increment [Number]
+
+Example:
+ (begin example)
+ _counter = 0;
+ INC(_counter);
+ // _counter => 1
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define INC(var) var = (var) + 1
+
+/* -------------------------------------------
+Macro: DEC()
+
+Description:
+ Decrease a number by one.
+
+Parameters:
+ VAR - Variable to decrement [Number]
+
+Example:
+ (begin example)
+ _counter = 99;
+ DEC(_counter);
+ // _counter => 98
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define DEC(var) var = (var) - 1
+
+/* -------------------------------------------
+Macro: ADD()
+
+Description:
+ Add a value to a variable. Variable and value should be both Numbers or both Strings.
+
+Parameters:
+ VAR - Variable to add to [Number or String]
+ VALUE - Value to add [Number or String]
+
+Examples:
+ (begin example)
+ _counter = 2;
+ ADD(_counter,3);
+ // _counter => 5
+ (end)
+ (begin example)
+ _str = "hello";
+ ADD(_str," ");
+ ADD(_str,"Fred");
+ // _str => "hello Fred"
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define ADD(var1,var2) var1 = (var1) + (var2)
+
+/* -------------------------------------------
+Macro: SUB()
+
+Description:
+ Subtract a value from a number variable. VAR and VALUE should both be Numbers.
+
+Parameters:
+ VAR - Variable to subtract from [Number]
+ VALUE - Value to subtract [Number]
+
+Examples:
+ (begin example)
+ _numChickens = 2;
+ SUB(_numChickens,3);
+ // _numChickens => -1
+ (end)
+------------------------------------------- */
+#define SUB(var1,var2) var1 = (var1) - (var2)
+
+/* -------------------------------------------
+Macro: REM()
+
+Description:
+ Remove an element from an array each time it occurs.
+
+ This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required
+ or if only one of the elements that matches ELEMENT needs to be removed.
+
+Parameters:
+ ARRAY - Array to modify [Array]
+ ELEMENT - Element to remove [Any]
+
+Examples:
+ (begin example)
+ _array = [1, 2, 3, 4, 3, 8];
+ REM(_array,3);
+ // _array = [1, 2, 4, 8];
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define REM(var1,var2) SUB(var1,[var2])
+
+/* -------------------------------------------
+Macro: PUSH()
+
+Description:
+ Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array.
+
+Parameters:
+ ARRAY - Array to push element onto [Array]
+ ELEMENT - Element to push [Any]
+
+Examples:
+ (begin example)
+ _fish = ["blue", "green", "smelly"];
+ PUSH(_fish,"monkey-flavoured");
+ // _fish => ["blue", "green", "smelly", "monkey-flavoured"]
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define PUSH(var1,var2) (var1) pushBack (var2)
+
+/* -------------------------------------------
+Macro: MAP()
+Description:
+ Applies given code to each element of the array, then assigns the
+ resulting array to the original
+Parameters:
+ ARRAY - Array to be modified
+ CODE - Code that'll be applied to each element of the array.
+Example:
+ (begin example)
+ _array = [1, 2, 3, 4, 3, 8];
+ MAP(_array,_x + 1);
+ // _array is now [2, 3, 4, 5, 4, 9];
+ (end)
+Author:
+ 654wak654
+------------------------------------------- */
+#define MAP(ARR,CODE) ARR = ARR apply {CODE}
+
+/* -------------------------------------------
+Macro: FILTER()
+Description:
+ Filters an array based on given code, then assigns the resulting array
+ to the original
+Parameters:
+ ARRAY - Array to be filtered
+ CODE - Condition to pick elements
+Example:
+ (begin example)
+ _array = [1, 2, 3, 4, 3, 8];
+ FILTER(_array,_x % 2 == 0)
+ // _array is now [2, 4, 8];
+ (end)
+Author:
+ Commy2
+------------------------------------------- */
+#define FILTER(ARR,CODE) ARR = ARR select {CODE}
+
+/* -------------------------------------------
+Macro: UNIQUE()
+Description:
+ Removes duplicate values in given array
+Parameters:
+ ARRAY - The array to be modified
+Example:
+ (begin example)
+ _someArray = [4, 4, 5, 5, 5, 2];
+ UNIQUE(_someArray);
+ // _someArray is now [4, 5, 2]
+ (end)
+Author:
+ Commy2
+------------------------------------------- */
+#define UNIQUE(ARR) ARR = ARR arrayIntersect ARR
+
+/* -------------------------------------------
+Macro: INTERSECTION()
+Description:
+ Finds unique common elements between two arrays and assigns them
+ to the first array
+Parameters:
+ ARRAY0 - The array to be modified
+ ARRAY1 - The array to find intersections with
+Example:
+ (begin example)
+ _someArray = [1, 2, 3, 4, 5, 5];
+ _anotherArray = [4, 5, 6, 7];
+ INTERSECTION(_someArray,_anotherArray);
+ // _someArray is now [4, 5]
+ (end)
+Author:
+ 654wak654
+------------------------------------------- */
+#define INTERSECTION(ARG0,ARG1) ARG0 = ARG0 arrayIntersect (ARG1)
+
+/* -------------------------------------------
+Macro: ISNILS()
+
+Description:
+ Sets a variable with a value, but only if it is undefined.
+
+Parameters:
+ VARIABLE - Variable to set [Any, not nil]
+ DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil]
+
+Examples:
+ (begin example)
+ // _fish is undefined
+ ISNILS(_fish,0);
+ // _fish => 0
+ (end)
+ (begin example)
+ _fish = 12;
+ // ...later...
+ ISNILS(_fish,0);
+ // _fish => 12
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define ISNILS(VARIABLE,DEFAULT_VALUE) if (isNil #VARIABLE) then { VARIABLE = DEFAULT_VALUE }
+#define ISNILS2(var1,var2,var3,var4) ISNILS(TRIPLES(var1,var2,var3),var4)
+#define ISNILS3(var1,var2,var3) ISNILS(DOUBLES(var1,var2),var3)
+#define ISNIL(var1,var2) ISNILS2(PREFIX,COMPONENT,var1,var2)
+#define ISNILMAIN(var1,var2) ISNILS3(PREFIX,var1,var2)
+
+#define CREATELOGICS(var1,var2) var1##_##var2 = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["LOGIC", [0, 0, 0], [], 0, "NONE"]
+#define CREATELOGICLOCALS(var1,var2) var1##_##var2 = "LOGIC" createVehicleLocal [0, 0, 0]
+#define CREATELOGICGLOBALS(var1,var2) var1##_##var2 = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit ["LOGIC", [0, 0, 0], [], 0, "NONE"]; publicVariable QUOTE(DOUBLES(var1,var2))
+#define CREATELOGICGLOBALTESTS(var1,var2) var1##_##var2 = ([sideLogic] call CBA_fnc_getSharedGroup) createUnit [QUOTE(DOUBLES(ADDON,logic)), [0, 0, 0], [], 0, "NONE"]
+
+#define GETVARS(var1,var2,var3) (var1##_##var2 getVariable #var3)
+#define GETVARMAINS(var1,var2) GETVARS(var1,MAINLOGIC,var2)
+
+#ifndef PATHTO_SYS
+ #define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\var1\SUBPREFIX\var2\var3.sqf
+#endif
+#ifndef PATHTOF_SYS
+ #define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\var1\SUBPREFIX\var2\var3
+#endif
+
+#ifndef PATHTOF2_SYS
+ #define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\var1\SUBPREFIX\var2\var3
+#endif
+
+#define PATHTO_R(var1) PATHTOF2_SYS(PREFIX,COMPONENT_C,var1)
+#define PATHTO_T(var1) PATHTOF_SYS(PREFIX,COMPONENT_T,var1)
+#define PATHTO_M(var1) PATHTOF_SYS(PREFIX,COMPONENT_M,var1)
+#define PATHTO_S(var1) PATHTOF_SYS(PREFIX,COMPONENT_S,var1)
+#define PATHTO_C(var1) PATHTOF_SYS(PREFIX,COMPONENT_C,var1)
+#define PATHTO_F(var1) PATHTO_SYS(PREFIX,COMPONENT_F,var1)
+
+// Already quoted ""
+#define QPATHTO_R(var1) QUOTE(PATHTO_R(var1))
+#define QPATHTO_T(var1) QUOTE(PATHTO_T(var1))
+#define QPATHTO_M(var1) QUOTE(PATHTO_M(var1))
+#define QPATHTO_S(var1) QUOTE(PATHTO_S(var1))
+#define QPATHTO_C(var1) QUOTE(PATHTO_C(var1))
+#define QPATHTO_F(var1) QUOTE(PATHTO_F(var1))
+
+// This only works for binarized configs after recompiling the pbos
+// TODO: Reduce amount of calls / code..
+#define COMPILE_FILE2_CFG_SYS(var1) compile preprocessFileLineNumbers var1
+#define COMPILE_FILE2_SYS(var1) COMPILE_FILE2_CFG_SYS(var1)
+
+#define COMPILE_FILE_SYS(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_SYS(var1,var2,var3)')
+#define COMPILE_FILE_CFG_SYS(var1,var2,var3) COMPILE_FILE2_CFG_SYS('PATHTO_SYS(var1,var2,var3)')
+
+#define SETVARS(var1,var2) var1##_##var2 setVariable
+#define SETVARMAINS(var1) SETVARS(var1,MAINLOGIC)
+#define GVARMAINS(var1,var2) var1##_##var2
+#define CFGSETTINGSS(var1,var2) configFile >> "CfgSettings" >> #var1 >> #var2
+//#define SETGVARS(var1,var2,var3) var1##_##var2##_##var3 =
+//#define SETGVARMAINS(var1,var2) var1##_##var2 =
+
+// Compile-Once, JIT: On first use.
+// #define PREPMAIN_SYS(var1,var2,var3) var1##_fnc_##var3 = { var1##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)); if (isNil "_this") then { call var1##_fnc_##var3 } else { _this call var1##_fnc_##var3 } }
+// #define PREP_SYS(var1,var2,var3) var1##_##var2##_fnc_##var3 = { var1##_##var2##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3)); if (isNil "_this") then { call var1##_##var2##_fnc_##var3 } else { _this call var1##_##var2##_fnc_##var3 } }
+// #define PREP_SYS2(var1,var2,var3,var4) var1##_##var2##_fnc_##var4 = { var1##_##var2##_fnc_##var4 = COMPILE_FILE_SYS(var1,var3,DOUBLES(fnc,var4)); if (isNil "_this") then { call var1##_##var2##_fnc_##var4 } else { _this call var1##_##var2##_fnc_##var4 } }
+
+// Compile-Once, at Macro. As opposed to Compile-Once, on first use.
+#define PREPMAIN_SYS(var1,var2,var3) var1##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3))
+#define PREP_SYS(var1,var2,var3) var1##_##var2##_fnc_##var3 = COMPILE_FILE_SYS(var1,var2,DOUBLES(fnc,var3))
+#define PREP_SYS2(var1,var2,var3,var4) var1##_##var2##_fnc_##var4 = COMPILE_FILE_SYS(var1,var3,DOUBLES(fnc,var4))
+
+#define LSTR(var1) TRIPLES(ADDON,STR,var1)
+
+#ifndef DEBUG_SETTINGS
+ #define DEBUG_SETTINGS [false, true, false]
+#endif
+
+#define MSG_INIT QUOTE(Initializing: ADDON version: VERSION)
+
+// *************************************
+// User Functions
+#define CFGSETTINGS CFGSETTINGSS(PREFIX,COMPONENT)
+#define PATHTO(var1) PATHTO_SYS(PREFIX,COMPONENT_F,var1)
+#define PATHTOF(var1) PATHTOF_SYS(PREFIX,COMPONENT,var1)
+#define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2)
+#define QPATHTOF(var1) QUOTE(PATHTOF(var1))
+#define QPATHTOEF(var1,var2) QUOTE(PATHTOEF(var1,var2))
+
+#define COMPILE_FILE(var1) COMPILE_FILE_SYS(PREFIX,COMPONENT_F,var1)
+#define COMPILE_FILE_CFG(var1) COMPILE_FILE_CFG_SYS(PREFIX,COMPONENT_F,var1)
+#define COMPILE_FILE2(var1) COMPILE_FILE2_SYS('var1')
+#define COMPILE_FILE2_CFG(var1) COMPILE_FILE2_CFG_SYS('var1')
+
+#define COMPILE_SCRIPT(var1) compileScript ['PATHTO_SYS(PREFIX,COMPONENT_F,var1)']
+
+
+#define VERSIONING_SYS(var1) class CfgSettings { \
+ class CBA { \
+ class Versioning { \
+ class var1 {}; \
+ }; \
+ }; \
+};
+
+#define VERSIONING VERSIONING_SYS(PREFIX)
+
+/* -------------------------------------------
+Macro: GVAR()
+ Get full variable identifier for a global variable owned by this component.
+
+Parameters:
+ VARIABLE - Partial name of global variable owned by this component [Any].
+
+Example:
+ (begin example)
+ GVAR(frog) = 12;
+ // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define GVAR(var1) DOUBLES(ADDON,var1)
+#define EGVAR(var1,var2) TRIPLES(PREFIX,var1,var2)
+#define QGVAR(var1) QUOTE(GVAR(var1))
+#define QEGVAR(var1,var2) QUOTE(EGVAR(var1,var2))
+#define QQGVAR(var1) QUOTE(QGVAR(var1))
+#define QQEGVAR(var1,var2) QUOTE(QEGVAR(var1,var2))
+
+/* -------------------------------------------
+Macro: GVARMAIN()
+ Get full variable identifier for a global variable owned by this addon.
+
+Parameters:
+ VARIABLE - Partial name of global variable owned by this addon [Any].
+
+Example:
+ (begin example)
+ GVARMAIN(frog) = 12;
+ // In SPON_FrogDancing component, equivalent to SPON_frog = 12
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define GVARMAIN(var1) GVARMAINS(PREFIX,var1)
+#define QGVARMAIN(var1) QUOTE(GVARMAIN(var1))
+#define QQGVARMAIN(var1) QUOTE(QGVARMAIN(var1))
+// TODO: What's this?
+#define SETTINGS DOUBLES(PREFIX,settings)
+#define CREATELOGIC CREATELOGICS(PREFIX,COMPONENT)
+#define CREATELOGICGLOBAL CREATELOGICGLOBALS(PREFIX,COMPONENT)
+#define CREATELOGICGLOBALTEST CREATELOGICGLOBALTESTS(PREFIX,COMPONENT)
+#define CREATELOGICLOCAL CREATELOGICLOCALS(PREFIX,COMPONENT)
+#define CREATELOGICMAIN CREATELOGICS(PREFIX,MAINLOGIC)
+#define GETVAR(var1) GETVARS(PREFIX,COMPONENT,var1)
+#define SETVAR SETVARS(PREFIX,COMPONENT)
+#define SETVARMAIN SETVARMAINS(PREFIX)
+#define IFCOUNT(var1,var2,var3) if (count var1 > var2) then { var3 = var1 select var2 };
+
+/* -------------------------------------------
+Macro: PREP()
+
+Description:
+ Defines a function.
+
+ Full file path:
+ '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\fnc_.sqf'
+
+ Resulting function name:
+ 'PREFIX_COMPONENT_'
+
+ The PREP macro should be placed in a script run by a XEH preStart and XEH preInit event.
+
+ The PREP macro allows for CBA function caching, which drastically speeds up load times.
+ Beware though that function caching is enabled by default and as such to disable it, you need to
+ #define DISABLE_COMPILE_CACHE above your #include "script_components.hpp" include!
+
+ The function will be defined in ui and mission namespace. It can not be overwritten without
+ a mission restart.
+
+Parameters:
+ FUNCTION NAME - Name of the function, unquoted
+
+Examples:
+ (begin example)
+ PREP(banana);
+ call FUNC(banana);
+ (end)
+
+Author:
+ dixon13
+ ------------------------------------------- */
+//#define PREP(var1) PREP_SYS(PREFIX,COMPONENT_F,var1)
+
+#ifdef DISABLE_COMPILE_CACHE
+ #define PREP(var1) TRIPLES(ADDON,fnc,var1) = compile preprocessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))'
+ #define PREPMAIN(var1) TRIPLES(PREFIX,fnc,var1) = compile preprocessFileLineNumbers 'PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))'
+#else
+ #define PREP(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(ADDON,fnc,var1)'] call SLX_XEH_COMPILE_NEW
+ #define PREPMAIN(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(PREFIX,fnc,var1)'] call SLX_XEH_COMPILE_NEW
+#endif
+
+/* -------------------------------------------
+Macro: PATHTO_FNC()
+
+Description:
+ Defines a function inside CfgFunctions.
+
+ Full file path in addons:
+ '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\fnc_.sqf'
+ Define 'RECOMPILE' to enable recompiling.
+ Define 'SKIP_FUNCTION_HEADER' to skip adding function header.
+
+Parameters:
+ FUNCTION NAME - Name of the function, unquoted
+
+Examples:
+ (begin example)
+ // file name: fnc_addPerFrameHandler.sqf
+ class CfgFunctions {
+ class CBA {
+ class Misc {
+ PATHTO_FNC(addPerFrameHandler);
+ };
+ };
+ };
+ // -> CBA_fnc_addPerFrameHandler
+ (end)
+
+Author:
+ dixon13, commy2
+ ------------------------------------------- */
+#ifdef RECOMPILE
+ #undef RECOMPILE
+ #define RECOMPILE recompile = 1
+#else
+ #define RECOMPILE recompile = 0
+#endif
+// Set function header type: -1 - no header; 0 - default header; 1 - system header.
+#ifdef SKIP_FUNCTION_HEADER
+ #define CFGFUNCTION_HEADER headerType = -1
+#else
+ #define CFGFUNCTION_HEADER headerType = 0
+#endif
+
+#define PATHTO_FNC(func) class func {\
+ file = QPATHTOF(DOUBLES(fnc,func).sqf);\
+ CFGFUNCTION_HEADER;\
+ RECOMPILE;\
+}
+
+#define FUNC(var1) TRIPLES(ADDON,fnc,var1)
+#define FUNCMAIN(var1) TRIPLES(PREFIX,fnc,var1)
+#define FUNC_INNER(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)
+#define EFUNC(var1,var2) FUNC_INNER(var1,var2)
+#define QFUNC(var1) QUOTE(FUNC(var1))
+#define QFUNCMAIN(var1) QUOTE(FUNCMAIN(var1))
+#define QFUNC_INNER(var1,var2) QUOTE(FUNC_INNER(var1,var2))
+#define QEFUNC(var1,var2) QUOTE(EFUNC(var1,var2))
+#define QQFUNC(var1) QUOTE(QFUNC(var1))
+#define QQFUNCMAIN(var1) QUOTE(QFUNCMAIN(var1))
+#define QQFUNC_INNER(var1,var2) QUOTE(QFUNC_INNER(var1,var2))
+#define QQEFUNC(var1,var2) QUOTE(QEFUNC(var1,var2))
+
+#ifndef PRELOAD_ADDONS
+ #define PRELOAD_ADDONS class CfgAddons { \
+ class PreloadAddons { \
+ class ADDON { \
+ list[]={ QUOTE(ADDON) }; \
+ }; \
+ }; \
+}
+#endif
+
+/* -------------------------------------------
+Macros: ARG_#()
+ Select from list of array arguments
+
+Parameters:
+ VARIABLE(1-8) - elements for the list
+
+Author:
+ Rommel
+------------------------------------------- */
+#define ARG_1(A,B) ((A) select (B))
+#define ARG_2(A,B,C) (ARG_1(ARG_1(A,B),C))
+#define ARG_3(A,B,C,D) (ARG_1(ARG_2(A,B,C),D))
+#define ARG_4(A,B,C,D,E) (ARG_1(ARG_3(A,B,C,D),E))
+#define ARG_5(A,B,C,D,E,F) (ARG_1(ARG_4(A,B,C,D,E),F))
+#define ARG_6(A,B,C,D,E,F,G) (ARG_1(ARG_5(A,B,C,D,E,F),G))
+#define ARG_7(A,B,C,D,E,F,G,H) (ARG_1(ARG_6(A,B,C,D,E,E,F,G),H))
+#define ARG_8(A,B,C,D,E,F,G,H,I) (ARG_1(ARG_7(A,B,C,D,E,E,F,G,H),I))
+
+/* -------------------------------------------
+Macros: ARR_#()
+ Create list from arguments. Useful for working around , in macro parameters.
+ 1-8 arguments possible.
+
+Parameters:
+ VARIABLE(1-8) - elements for the list
+
+Author:
+ Nou
+------------------------------------------- */
+#define ARR_1(ARG1) ARG1
+#define ARR_2(ARG1,ARG2) ARG1, ARG2
+#define ARR_3(ARG1,ARG2,ARG3) ARG1, ARG2, ARG3
+#define ARR_4(ARG1,ARG2,ARG3,ARG4) ARG1, ARG2, ARG3, ARG4
+#define ARR_5(ARG1,ARG2,ARG3,ARG4,ARG5) ARG1, ARG2, ARG3, ARG4, ARG5
+#define ARR_6(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6
+#define ARR_7(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7
+#define ARR_8(ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8
+
+/* -------------------------------------------
+Macros: FORMAT_#(STR, ARG1)
+ Format - Useful for working around , in macro parameters.
+ 1-8 arguments possible.
+
+Parameters:
+ STRING - string used by format
+ VARIABLE(1-8) - elements for usage in format
+
+Author:
+ Nou & Sickboy
+------------------------------------------- */
+#define FORMAT_1(STR,ARG1) format[STR, ARG1]
+#define FORMAT_2(STR,ARG1,ARG2) format[STR, ARG1, ARG2]
+#define FORMAT_3(STR,ARG1,ARG2,ARG3) format[STR, ARG1, ARG2, ARG3]
+#define FORMAT_4(STR,ARG1,ARG2,ARG3,ARG4) format[STR, ARG1, ARG2, ARG3, ARG4]
+#define FORMAT_5(STR,ARG1,ARG2,ARG3,ARG4,ARG5) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5]
+#define FORMAT_6(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6]
+#define FORMAT_7(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7]
+#define FORMAT_8(STR,ARG1,ARG2,ARG3,ARG4,ARG5,ARG6,ARG7,ARG8) format[STR, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8]
+
+// CONTROL(46) 12
+#define DISPLAY(A) (findDisplay A)
+#define CONTROL(A) DISPLAY(A) displayCtrl
+
+/* -------------------------------------------
+Macros: IS_x()
+ Checking the data types of variables.
+
+ IS_ARRAY() - Array
+ IS_BOOL() - Boolean
+ IS_BOOLEAN() - UI display handle(synonym for )
+ IS_CODE() - Code block (i.e a compiled function)
+ IS_CONFIG() - Configuration
+ IS_CONTROL() - UI control handle.
+ IS_DISPLAY() - UI display handle.
+ IS_FUNCTION() - A compiled function (synonym for )
+ IS_GROUP() - Group.
+ IS_INTEGER() - Is a number a whole number?
+ IS_LOCATION() - World location.
+ IS_NUMBER() - A floating point number (synonym for )
+ IS_OBJECT() - World object.
+ IS_SCALAR() - Floating point number.
+ IS_SCRIPT() - A script handle (as returned by execVM and spawn commands).
+ IS_SIDE() - Game side.
+ IS_STRING() - World object.
+ IS_TEXT() - Structured text.
+
+Parameters:
+ VARIABLE - Variable to check if it is of a particular type [Any, not nil]
+
+Author:
+ Spooner
+------------------------------------------- */
+#define IS_META_SYS(VAR,TYPE) (if (isNil {VAR}) then {false} else {(VAR) isEqualType TYPE})
+#define IS_ARRAY(VAR) IS_META_SYS(VAR,[])
+#define IS_BOOL(VAR) IS_META_SYS(VAR,false)
+#define IS_CODE(VAR) IS_META_SYS(VAR,{})
+#define IS_CONFIG(VAR) IS_META_SYS(VAR,configNull)
+#define IS_CONTROL(VAR) IS_META_SYS(VAR,controlNull)
+#define IS_DISPLAY(VAR) IS_META_SYS(VAR,displayNull)
+#define IS_GROUP(VAR) IS_META_SYS(VAR,grpNull)
+#define IS_OBJECT(VAR) IS_META_SYS(VAR,objNull)
+#define IS_SCALAR(VAR) IS_META_SYS(VAR,0)
+#define IS_SCRIPT(VAR) IS_META_SYS(VAR,scriptNull)
+#define IS_SIDE(VAR) IS_META_SYS(VAR,west)
+#define IS_STRING(VAR) IS_META_SYS(VAR,"STRING")
+#define IS_TEXT(VAR) IS_META_SYS(VAR,text "")
+#define IS_LOCATION(VAR) IS_META_SYS(VAR,locationNull)
+
+#define IS_BOOLEAN(VAR) IS_BOOL(VAR)
+#define IS_FUNCTION(VAR) IS_CODE(VAR)
+#define IS_INTEGER(VAR) (if (IS_SCALAR(VAR)) then {floor (VAR) == (VAR)} else {false})
+#define IS_NUMBER(VAR) IS_SCALAR(VAR)
+
+#define FLOAT_TO_STRING(num) (if (_this == 0) then {"0"} else {str parseNumber (str (_this % _this) + str floor abs _this) + "." + (str (abs _this - floor abs _this) select [2]) + "0"})
+
+/* -------------------------------------------
+Macro: SCRIPT()
+ Sets name of script (relies on PREFIX and COMPONENT values being #defined).
+ Define 'SKIP_SCRIPT_NAME' to skip adding scriptName.
+
+Parameters:
+ NAME - Name of script [Indentifier]
+
+Example:
+ (begin example)
+ SCRIPT(eradicateMuppets);
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#ifndef SKIP_SCRIPT_NAME
+ #define SCRIPT(NAME) scriptName 'PREFIX\COMPONENT\NAME'
+#else
+ #define SCRIPT(NAME) /* nope */
+#endif
+
+/* -------------------------------------------
+Macros: EXPLODE_n()
+ DEPRECATED - Use param/params commands added in Arma 3 1.48
+
+ Splitting an ARRAY into a number of variables (A, B, C, etc).
+
+ Note that this NOT does make the created variables private.
+ _PVT variants do.
+
+ EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable.
+ EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables.
+ EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables.
+ EXPLODE_4(ARRAY,A,B,C,D) - Split a 4-element array into separate variables.
+ EXPLODE_5(ARRAY,A,B,C,D,E) - Split a 5-element array into separate variables.
+ EXPLODE_6(ARRAY,A,B,C,D,E,F) - Split a 6-element array into separate variables.
+ EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables.
+ EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables.
+ EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables.
+
+Parameters:
+ ARRAY - Array to read from [Array]
+ A..H - Names of variables to set from array [Identifier]
+
+Example:
+ (begin example)
+ _array = ["fred", 156.8, 120.9];
+ EXPLODE_3(_array,_name,_height,_weight);
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define EXPLODE_1_SYS(ARRAY,A) A = ARRAY param [0]
+#define EXPLODE_1(ARRAY,A) EXPLODE_1_SYS(ARRAY,A); TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A)
+#define EXPLODE_1_PVT(ARRAY,A) ARRAY params [#A]; TRACE_1("EXPLODE_1, " + QUOTE(ARRAY),A)
+
+#define EXPLODE_2_SYS(ARRAY,A,B) EXPLODE_1_SYS(ARRAY,A); B = ARRAY param [1]
+#define EXPLODE_2(ARRAY,A,B) EXPLODE_2_SYS(ARRAY,A,B); TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B)
+#define EXPLODE_2_PVT(ARRAY,A,B) ARRAY params [#A,#B]; TRACE_2("EXPLODE_2, " + QUOTE(ARRAY),A,B)
+
+#define EXPLODE_3_SYS(ARRAY,A,B,C) EXPLODE_2_SYS(ARRAY,A,B); C = ARRAY param [2]
+#define EXPLODE_3(ARRAY,A,B,C) EXPLODE_3_SYS(ARRAY,A,B,C); TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C)
+#define EXPLODE_3_PVT(ARRAY,A,B,C) ARRAY params [#A,#B,#C]; TRACE_3("EXPLODE_3, " + QUOTE(ARRAY),A,B,C)
+
+#define EXPLODE_4_SYS(ARRAY,A,B,C,D) EXPLODE_3_SYS(ARRAY,A,B,C); D = ARRAY param [3]
+#define EXPLODE_4(ARRAY,A,B,C,D) EXPLODE_4_SYS(ARRAY,A,B,C,D); TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D)
+#define EXPLODE_4_PVT(ARRAY,A,B,C,D) ARRAY params [#A,#B,#C,#D]; TRACE_4("EXPLODE_4, " + QUOTE(ARRAY),A,B,C,D)
+
+#define EXPLODE_5_SYS(ARRAY,A,B,C,D,E) EXPLODE_4_SYS(ARRAY,A,B,C,D); E = ARRAY param [4]
+#define EXPLODE_5(ARRAY,A,B,C,D,E) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E)
+#define EXPLODE_5_PVT(ARRAY,A,B,C,D,E) ARRAY params [#A,#B,#C,#D,#E]; TRACE_5("EXPLODE_5, " + QUOTE(ARRAY),A,B,C,D,E)
+
+#define EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F) EXPLODE_5_SYS(ARRAY,A,B,C,D,E); F = ARRAY param [5]
+#define EXPLODE_6(ARRAY,A,B,C,D,E,F) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F)
+#define EXPLODE_6_PVT(ARRAY,A,B,C,D,E,F) ARRAY params [#A,#B,#C,#D,#E,#F]; TRACE_6("EXPLODE_6, " + QUOTE(ARRAY),A,B,C,D,E,F)
+
+#define EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G) EXPLODE_6_SYS(ARRAY,A,B,C,D,E,F); G = ARRAY param [6]
+#define EXPLODE_7(ARRAY,A,B,C,D,E,F,G) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G)
+#define EXPLODE_7_PVT(ARRAY,A,B,C,D,E,F,G) ARRAY params [#A,#B,#C,#D,#E,#F,#G]; TRACE_7("EXPLODE_7, " + QUOTE(ARRAY),A,B,C,D,E,F,G)
+
+#define EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_7_SYS(ARRAY,A,B,C,D,E,F,G); H = ARRAY param [7]
+#define EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H)
+#define EXPLODE_8_PVT(ARRAY,A,B,C,D,E,F,G,H) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H]; TRACE_8("EXPLODE_8, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H)
+
+#define EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_8_SYS(ARRAY,A,B,C,D,E,F,G,H); I = ARRAY param [8]
+#define EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) EXPLODE_9_SYS(ARRAY,A,B,C,D,E,F,G,H,I); TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I)
+#define EXPLODE_9_PVT(ARRAY,A,B,C,D,E,F,G,H,I) ARRAY params [#A,#B,#C,#D,#E,#F,#G,#H,#I]; TRACE_9("EXPLODE_9, " + QUOTE(ARRAY),A,B,C,D,E,F,G,H,I)
+
+/* -------------------------------------------
+Macro: xSTRING()
+ Get full string identifier from a stringtable owned by this component.
+
+Parameters:
+ VARIABLE - Partial name of global variable owned by this component [Any].
+
+Example:
+ ADDON is CBA_Balls.
+ (begin example)
+ // Localized String (localize command must still be used with it)
+ LSTRING(Example); // STR_CBA_Balls_Example;
+ // Config String (note the $)
+ CSTRING(Example); // $STR_CBA_Balls_Example;
+ (end)
+
+Author:
+ Jonpas
+------------------------------------------- */
+#ifndef STRING_MACROS_GUARD
+#define STRING_MACROS_GUARD
+ #define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1))
+ #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
+ #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1))
+ #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2))
+ #define SUBCSTRING(var1) QUOTE(TRIPLES($STR,SUBADDON,var1))
+
+ #define LLSTRING(var1) localize QUOTE(TRIPLES(STR,ADDON,var1))
+ #define LELSTRING(var1,var2) localize QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2))
+ #define LSUBLSTRING(var1) localize QUOTE(TRIPLES(STR,SUBADDON,var1))
+#endif
+
+
+/* -------------------------------------------
+Group: Managing Function Parameters
+------------------------------------------- */
+
+/* -------------------------------------------
+Macros: PARAMS_n()
+ DEPRECATED - Use param/params commands added in Arma 3 1.48
+
+ Setting variables based on parameters passed to a function.
+
+ Each parameter is defines as private and set to the appropriate value from _this.
+
+ PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array).
+ PARAMS_2(A,B) - Get 2 parameters from the _this array.
+ PARAMS_3(A,B,C) - Get 3 parameters from the _this array.
+ PARAMS_4(A,B,C,D) - Get 4 parameters from the _this array.
+ PARAMS_5(A,B,C,D,E) - Get 5 parameters from the _this array.
+ PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array.
+ PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array.
+ PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array.
+
+Parameters:
+ A..H - Name of variable to read from _this [Identifier]
+
+Example:
+ A function called like this:
+ (begin example)
+ [_name,_address,_telephone] call recordPersonalDetails;
+ (end)
+ expects 3 parameters and those variables could be initialised at the start of the function definition with:
+ (begin example)
+ recordPersonalDetails = {
+ PARAMS_3(_name,_address,_telephone);
+ // Rest of function follows...
+ };
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define PARAMS_1(A) EXPLODE_1_PVT(_this,A)
+#define PARAMS_2(A,B) EXPLODE_2_PVT(_this,A,B)
+#define PARAMS_3(A,B,C) EXPLODE_3_PVT(_this,A,B,C)
+#define PARAMS_4(A,B,C,D) EXPLODE_4_PVT(_this,A,B,C,D)
+#define PARAMS_5(A,B,C,D,E) EXPLODE_5_PVT(_this,A,B,C,D,E)
+#define PARAMS_6(A,B,C,D,E,F) EXPLODE_6_PVT(_this,A,B,C,D,E,F)
+#define PARAMS_7(A,B,C,D,E,F,G) EXPLODE_7_PVT(_this,A,B,C,D,E,F,G)
+#define PARAMS_8(A,B,C,D,E,F,G,H) EXPLODE_8_PVT(_this,A,B,C,D,E,F,G,H)
+#define PARAMS_9(A,B,C,D,E,F,G,H,I) EXPLODE_9_PVT(_this,A,B,C,D,E,F,G,H,I)
+
+/* -------------------------------------------
+Macro: DEFAULT_PARAM()
+ DEPRECATED - Use param/params commands added in Arma 3 1.48 - Will not work with HEMTT 1.13.2+
+
+ Getting a default function parameter. This may be used together with to have a mix of required and
+ optional parameters.
+
+Parameters:
+ INDEX - Index of parameter in _this [Integer, 0+]
+ NAME - Name of the variable to set [Identifier]
+ DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any]
+
+Example:
+ A function called with optional parameters:
+ (begin example)
+ [_name] call myFunction;
+ [_name, _numberOfLegs] call myFunction;
+ [_name, _numberOfLegs, _hasAHead] call myFunction;
+ (end)
+ 1 required parameter and 2 optional parameters. Those variables could be initialised at the start of the function
+ definition with:
+ (begin example)
+ myFunction = {
+ PARAMS_1(_name);
+ DEFAULT_PARAM(1,_numberOfLegs,2);
+ DEFAULT_PARAM(2,_hasAHead,true);
+ // Rest of function follows...
+ };
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define DEFAULT_PARAM(INDEX,NAME,DEF_VALUE) \
+ private [#NAME,"_this"]; \
+ ISNILS(_this,[]); \
+ NAME = _this param [INDEX, DEF_VALUE]; \
+ TRACE_3("DEFAULT_PARAM",INDEX,NAME,DEF_VALUE)
+
+/* -------------------------------------------
+Macro: KEY_PARAM()
+ Get value from key in _this list, return default when key is not included in list.
+
+Parameters:
+ KEY - Key name [String]
+ NAME - Name of the variable to set [Identifier]
+ DEF_VALUE - Default value to use in case key not found [ANY]
+
+Example:
+
+
+Author:
+ Muzzleflash
+------------------------------------------- */
+#define KEY_PARAM(KEY,NAME,DEF_VALUE) \
+ private #NAME; \
+ NAME = [toLower KEY, toUpper KEY, DEF_VALUE, RETNIL(_this)] call CBA_fnc_getArg; \
+ TRACE_3("KEY_PARAM",KEY,NAME,DEF_VALUE)
+
+/* -------------------------------------------
+Group: Assertions
+------------------------------------------- */
+
+#define ASSERTION_ERROR(MESSAGE) ERROR_WITH_TITLE("Assertion failed!",MESSAGE)
+
+/* -------------------------------------------
+Macro: ASSERT_TRUE()
+ Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE.
+
+Parameters:
+ CONDITION - Condition to assert as true [Boolean]
+ MESSSAGE - Message to display if (A OPERATOR B) is false [String]
+
+Example:
+ (begin example)
+ ASSERT_TRUE(_frogIsDead,"The frog is alive");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ASSERT_TRUE(CONDITION,MESSAGE) \
+ if (not (CONDITION)) then \
+ { \
+ ASSERTION_ERROR('Assertion (CONDITION) failed!\n\n' + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Macro: ASSERT_FALSE()
+ Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE.
+
+Parameters:
+ CONDITION - Condition to assert as false [Boolean]
+ MESSSAGE - Message to display if (A OPERATOR B) is true [String]
+
+Example:
+ (begin example)
+ ASSERT_FALSE(_frogIsDead,"The frog died");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ASSERT_FALSE(CONDITION,MESSAGE) \
+ if (CONDITION) then \
+ { \
+ ASSERTION_ERROR('Assertion (not (CONDITION)) failed!\n\n' + (MESSAGE)) \
+ }
+
+/* -------------------------------------------
+Macro: ASSERT_OP()
+ Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE.
+
+Parameters:
+ A - First value [Any]
+ OPERATOR - Binary operator to use [Operator]
+ B - Second value [Any]
+ MESSSAGE - Message to display if (A OPERATOR B) is false. [String]
+
+Example:
+ (begin example)
+ ASSERT_OP(_fish,>,5,"Too few fish!");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ASSERT_OP(A,OPERATOR,B,MESSAGE) \
+ if (not ((A) OPERATOR (B))) then \
+ { \
+ ASSERTION_ERROR('Assertion (A OPERATOR B) failed!\n' + 'A: ' + (str (A)) + '\n' + 'B: ' + (str (B)) + "\n\n" + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Macro: ASSERT_DEFINED()
+ Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE..
+
+Parameters:
+ VARIABLE - Variable to test if defined [String or Function].
+ MESSAGE - Message to display if variable is undefined [String].
+
+Examples:
+ (begin example)
+ ASSERT_DEFINED("_anUndefinedVar","Too few fish!");
+ ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!");
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define ASSERT_DEFINED(VARIABLE,MESSAGE) \
+ if (isNil VARIABLE) then \
+ { \
+ ASSERTION_ERROR('Assertion (VARIABLE is defined) failed!\n\n' + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Group: Unit tests
+------------------------------------------- */
+#define TEST_SUCCESS(MESSAGE) MESSAGE_WITH_TITLE("Test OK",MESSAGE)
+#define TEST_FAIL(MESSAGE) ERROR_WITH_TITLE("Test FAIL",MESSAGE)
+
+/* -------------------------------------------
+Macro: TEST_TRUE()
+ Tests that a CONDITION is true.
+ If the condition is not true, an error is raised with the given MESSAGE.
+
+Parameters:
+ CONDITION - Condition to assert as true [Boolean]
+ MESSSAGE - Message to display if (A OPERATOR B) is false [String]
+
+Example:
+ (begin example)
+ TEST_TRUE(_frogIsDead,"The frog is alive");
+ (end)
+
+Author:
+ Killswitch
+------------------------------------------- */
+#define TEST_TRUE(CONDITION, MESSAGE) \
+ if (CONDITION) then \
+ { \
+ TEST_SUCCESS('(CONDITION)'); \
+ } \
+ else \
+ { \
+ TEST_FAIL('(CONDITION) ' + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Macro: TEST_FALSE()
+ Tests that a CONDITION is false.
+ If the condition is not false, an error is raised with the given MESSAGE.
+
+Parameters:
+ CONDITION - Condition to test as false [Boolean]
+ MESSSAGE - Message to display if (A OPERATOR B) is true [String]
+
+Example:
+ (begin example)
+ TEST_FALSE(_frogIsDead,"The frog died");
+ (end)
+
+Author:
+ Killswitch
+------------------------------------------- */
+#define TEST_FALSE(CONDITION, MESSAGE) \
+ if (not (CONDITION)) then \
+ { \
+ TEST_SUCCESS('(not (CONDITION))'); \
+ } \
+ else \
+ { \
+ TEST_FAIL('(not (CONDITION)) ' + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Macro: TEST_OP()
+ Tests that (A OPERATOR B) is true.
+ If the test fails, an error is raised with the given MESSAGE.
+
+Parameters:
+ A - First value [Any]
+ OPERATOR - Binary operator to use [Operator]
+ B - Second value [Any]
+ MESSSAGE - Message to display if (A OPERATOR B) is false. [String]
+
+Example:
+ (begin example)
+ TEST_OP(_fish,>,5,"Too few fish!");
+ (end)
+
+Author:
+ Killswitch
+------------------------------------------- */
+#define TEST_OP(A,OPERATOR,B,MESSAGE) \
+ if ((A) OPERATOR (B)) then \
+ { \
+ TEST_SUCCESS('(A OPERATOR B)') \
+ } \
+ else \
+ { \
+ TEST_FAIL('(A OPERATOR B)') \
+ };
+
+/* -------------------------------------------
+Macro: TEST_DEFINED_AND_OP()
+ Tests that A and B are defined and (A OPERATOR B) is true.
+ If the test fails, an error is raised with the given MESSAGE.
+
+Parameters:
+ A - First value [Any]
+ OPERATOR - Binary operator to use [Operator]
+ B - Second value [Any]
+ MESSSAGE - Message to display [String]
+
+Example:
+ (begin example)
+ TEST_OP(_fish,>,5,"Too few fish!");
+ (end)
+
+Author:
+ Killswitch, PabstMirror
+------------------------------------------- */
+#define TEST_DEFINED_AND_OP(A,OPERATOR,B,MESSAGE) \
+ if (isNil #A) then { \
+ TEST_FAIL('(A is not defined) ' + (MESSAGE)); \
+ } else { \
+ if (isNil #B) then { \
+ TEST_FAIL('(B is not defined) ' + (MESSAGE)); \
+ } else { \
+ if ((A) OPERATOR (B)) then { \
+ TEST_SUCCESS('(A OPERATOR B) ' + (MESSAGE)) \
+ } else { \
+ TEST_FAIL('(A OPERATOR B) ' + (MESSAGE)) \
+ }; }; };
+
+
+/* -------------------------------------------
+Macro: TEST_DEFINED()
+ Tests that a VARIABLE is defined.
+
+Parameters:
+ VARIABLE - Variable to test if defined [String or Function].
+ MESSAGE - Message to display if variable is undefined [String].
+
+Examples:
+ (begin example)
+ TEST_DEFINED("_anUndefinedVar","Too few fish!");
+ TEST_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!");
+ (end)
+
+Author:
+ Killswitch
+------------------------------------------- */
+#define TEST_DEFINED(VARIABLE,MESSAGE) \
+ if (not isNil VARIABLE) then \
+ { \
+ TEST_SUCCESS('(' + VARIABLE + ' is defined)'); \
+ } \
+ else \
+ { \
+ TEST_FAIL('(' + VARIABLE + ' is not defined)' + (MESSAGE)); \
+ }
+
+/* -------------------------------------------
+Group: Managing Deprecation
+------------------------------------------- */
+
+/* -------------------------------------------
+Macro: DEPRECATE_SYS()
+ Allow deprecation of a function that has been renamed.
+
+ Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION
+ (PREFIX_ prepended) with the intention that the old function will be disabled in the future.
+
+ Shows a warning in RPT each time the deprecated function is used, but runs the new function.
+
+Parameters:
+ OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more]
+ NEW_FUNCTION - Full name of new function [Function]
+
+Example:
+ (begin example)
+ // After renaming CBA_fnc_frog as CBA_fnc_fish
+ DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish);
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define DEPRECATE_SYS(OLD_FUNCTION,NEW_FUNCTION) \
+ OLD_FUNCTION = { \
+ WARNING('Deprecated function used: OLD_FUNCTION (new: NEW_FUNCTION) in ADDON'); \
+ if (isNil "_this") then { call NEW_FUNCTION } else { _this call NEW_FUNCTION }; \
+ }
+
+/* -------------------------------------------
+Macro: DEPRECATE()
+ Allow deprecation of a function, in the current component, that has been renamed.
+
+ Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION
+ (PREFIX_ prepended) with the intention that the old function will be disabled in the future.
+
+ Shows a warning in RPT each time the deprecated function is used, but runs the new function.
+
+Parameters:
+ OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more]
+ NEW_FUNCTION - Name of new function, assuming PREFIX [Function]
+
+Example:
+ (begin example)
+ // After renaming CBA_fnc_frog as CBA_fnc_fish
+ DEPRECATE(fnc_frog,fnc_fish);
+ (end)
+
+Author:
+ Sickboy
+------------------------------------------- */
+#define DEPRECATE(OLD_FUNCTION,NEW_FUNCTION) \
+ DEPRECATE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),DOUBLES(PREFIX,NEW_FUNCTION))
+
+/* -------------------------------------------
+Macro: OBSOLETE_SYS()
+ Replace a function that has become obsolete.
+
+ Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone
+ using the function should replace it with the simple command, since the function will be disabled in the future.
+
+ Shows a warning in RPT each time the deprecated function is used, and runs the command function.
+
+Parameters:
+ OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more]
+ COMMAND_CODE - Code to replace the old function [Function]
+
+Example:
+ (begin example)
+ // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete:
+ OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player });
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define OBSOLETE_SYS(OLD_FUNCTION,COMMAND_CODE) \
+ OLD_FUNCTION = { \
+ WARNING('Obsolete function used: (use: OLD_FUNCTION) in ADDON'); \
+ if (isNil "_this") then { call COMMAND_CODE } else { _this call COMMAND_CODE }; \
+ }
+
+/* -------------------------------------------
+Macro: OBSOLETE()
+ Replace a function, in the current component, that has become obsolete.
+
+ Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple
+ COMMAND_CODE, with the intention that anyone using the function should replace it with the simple
+ command.
+
+ Shows a warning in RPT each time the deprecated function is used.
+
+Parameters:
+ OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more]
+ COMMAND_CODE - Code to replace the old function [Function]
+
+Example:
+ (begin example)
+ // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete:
+ OBSOLETE(fMyWeapon,{ currentWeapon player });
+ (end)
+
+Author:
+ Spooner
+------------------------------------------- */
+#define OBSOLETE(OLD_FUNCTION,COMMAND_CODE) \
+ OBSOLETE_SYS(DOUBLES(PREFIX,OLD_FUNCTION),COMMAND_CODE)
+
+#define BWC_CONFIG(NAME) class NAME { \
+ units[] = {}; \
+ weapons[] = {}; \
+ requiredVersion = REQUIRED_VERSION; \
+ requiredAddons[] = {}; \
+ version = VERSION; \
+}
+
+// XEH Specific
+#define XEH_CLASS CBA_Extended_EventHandlers
+#define XEH_CLASS_BASE DOUBLES(XEH_CLASS,base)
+#define XEH_DISABLED class EventHandlers { class XEH_CLASS {}; }; SLX_XEH_DISABLED = 1
+#define XEH_ENABLED class EventHandlers { class XEH_CLASS { EXTENDED_EVENTHANDLERS }; }; SLX_XEH_DISABLED = 0
+
+// TODO: These are actually outdated; _Once ?
+#define XEH_PRE_INIT QUOTE(call COMPILE_FILE(XEH_PreInit_Once))
+#define XEH_PRE_CINIT QUOTE(call COMPILE_FILE(XEH_PreClientInit_Once))
+#define XEH_PRE_SINIT QUOTE(call COMPILE_FILE(XEH_PreServerInit_Once))
+
+#define XEH_POST_INIT QUOTE(call COMPILE_FILE(XEH_PostInit_Once))
+#define XEH_POST_CINIT QUOTE(call COMPILE_FILE(XEH_PostClientInit_Once))
+#define XEH_POST_SINIT QUOTE(call COMPILE_FILE(XEH_PostServerInit_Once))
+
+/* -------------------------------------------
+Macro: IS_ADMIN
+ Check if the local machine is an admin in the multiplayer environment.
+
+ Reports 'true' for logged and voted in admins.
+
+Parameters:
+ None
+
+Example:
+ (begin example)
+ // print "true" if player is admin
+ systemChat str IS_ADMIN;
+ (end)
+
+Author:
+ commy2
+------------------------------------------- */
+#define IS_ADMIN_SYS(x) x##kick
+#define IS_ADMIN serverCommandAvailable 'IS_ADMIN_SYS(#)'
+
+/* -------------------------------------------
+Macro: IS_ADMIN_LOGGED
+ Check if the local machine is a logged in admin in the multiplayer environment.
+
+ Reports 'false' if the player was voted to be the admin.
+
+Parameters:
+ None
+
+Example:
+ (begin example)
+ // print "true" if player is admin and entered in the server password
+ systemChat str IS_ADMIN_LOGGED;
+ (end)
+
+Author:
+ commy2
+------------------------------------------- */
+#define IS_ADMIN_LOGGED_SYS(x) x##shutdown
+#define IS_ADMIN_LOGGED serverCommandAvailable 'IS_ADMIN_LOGGED_SYS(#)'
+
+/* -------------------------------------------
+Macro: FILE_EXISTS
+ Check if a file exists
+
+ Reports "false" if the file does not exist.
+
+Parameters:
+ FILE - Path to the file
+
+Example:
+ (begin example)
+ // print "true" if file exists
+ systemChat str FILE_EXISTS("\A3\ui_f\data\igui\cfg\cursors\weapon_ca.paa");
+ (end)
+
+Author:
+ commy2
+------------------------------------------- */
+#define FILE_EXISTS(FILE) (fileExists (FILE))
+
+/* -------------------------------------------
+Macro: QADDON, QQADDON
+
+Description:
+ Quoted Variant of ADDON
+
+Parameters:
+
+Examples:
+ (begin example)
+ QUOTE(configName _x isEqualTo QUOTE(QUOTE(abe_banana))) configClasses (configFile >> QADDON)
+ (end)
+
+Author:
+ OverlordZorn
+------------------------------------------- */
+#ifndef QADDON
+ #define QADDON QUOTE(ADDON)
+#endif
+#ifndef QQADDON
+ #define QQADDON QUOTE(QUOTE(ADDON))
+#endif
diff --git a/include/x/cba/addons/xeh/$PBOPREFIX$ b/include/x/cba/addons/xeh/$PBOPREFIX$
new file mode 100644
index 0000000..4533938
--- /dev/null
+++ b/include/x/cba/addons/xeh/$PBOPREFIX$
@@ -0,0 +1 @@
+x\cba\addons\xeh
\ No newline at end of file
diff --git a/include/x/cba/addons/xeh/script_xeh.hpp b/include/x/cba/addons/xeh/script_xeh.hpp
new file mode 100644
index 0000000..bf89b64
--- /dev/null
+++ b/include/x/cba/addons/xeh/script_xeh.hpp
@@ -0,0 +1,146 @@
+/*
+ Header: script_xeh.hpp
+
+ Description:
+ Used internally.
+*/
+/////////////////////////////////////////////////////////////////////////////////
+// MACRO: EXTENDED_EVENTHANDLERS
+// Add all XEH event handlers
+/////////////////////////////////////////////////////////////////////////////////
+
+#define EXTENDED_EVENTHANDLERS init = "call cba_xeh_fnc_init"; \
+fired = "call cba_xeh_fnc_fired"; \
+animChanged = "call cba_xeh_fnc_animChanged"; \
+animDone = "call cba_xeh_fnc_animDone"; \
+animStateChanged = "call cba_xeh_fnc_animStateChanged"; \
+assembled = "call cba_xeh_fnc_assembled"; \
+attached = "call cba_xeh_fnc_attached"; \
+cargoLoaded = "call cba_xeh_fnc_cargoLoaded"; \
+cargoUnloaded = "call cba_xeh_fnc_cargoUnloaded"; \
+containerClosed = "call cba_xeh_fnc_containerClosed"; \
+containerOpened = "call cba_xeh_fnc_containerOpened"; \
+controlsShifted = "call cba_xeh_fnc_controlsShifted"; \
+dammaged = "call cba_xeh_fnc_dammaged"; \
+deleted = "call cba_xeh_fnc_deleted"; \
+detached = "call cba_xeh_fnc_detached"; \
+disassembled = "call cba_xeh_fnc_disassembled"; \
+engine = "call cba_xeh_fnc_engine"; \
+epeContact = "call cba_xeh_fnc_epeContact"; \
+epeContactEnd = "call cba_xeh_fnc_epeContactEnd"; \
+epeContactStart = "call cba_xeh_fnc_epeContactStart"; \
+explosion = "call cba_xeh_fnc_explosion"; \
+firedMan = "call cba_xeh_fnc_firedMan"; \
+firedNear = "call cba_xeh_fnc_firedNear"; \
+fuel = "call cba_xeh_fnc_cba_xeh_fuel"; \
+gear = "call cba_xeh_fnc_gear"; \
+gestureChanged = "call cba_xeh_fnc_gestureChanged"; \
+gestureDone = "call cba_xeh_fnc_gestureDone"; \
+getIn = "call cba_xeh_fnc_getIn"; \
+getInMan = "call cba_xeh_fnc_getInMan"; \
+getOut = "call cba_xeh_fnc_getOut"; \
+getOutMan = "call cba_xeh_fnc_getOutMan"; \
+handleHeal = "call cba_xeh_fnc_handleHeal"; \
+hit = "call cba_xeh_fnc_hit"; \
+hitPart = "call cba_xeh_fnc_hitPart"; \
+incomingMissile = "call cba_xeh_fnc_incomingMissile"; \
+inventoryClosed = "call cba_xeh_fnc_inventoryClosed"; \
+inventoryOpened = "call cba_xeh_fnc_inventoryOpened"; \
+killed = "call cba_xeh_fnc_killed"; \
+landedTouchDown = "call cba_xeh_fnc_landedTouchDown"; \
+landedStopped = "call cba_xeh_fnc_landedStopped"; \
+leaningChanged = "call cba_xeh_fnc_leaningChanged"; \
+local = "call cba_xeh_fnc_local"; \
+magazineReloading = "call cba_xeh_fnc_magazineReloading"; \
+opticsModeChanged = "call cba_xeh_fnc_opticsModeChanged"; \
+opticsSwitch = "call cba_xeh_fnc_opticsSwitch"; \
+put = "call cba_xeh_fnc_put"; \
+reloaded = "call cba_xeh_fnc_reloaded"; \
+respawn = "call cba_xeh_fnc_respawn"; \
+ropeAttach = "call cba_xeh_fnc_ropeAttach"; \
+ropeBreak = "call cba_xeh_fnc_ropeBreak"; \
+seatSwitched = "call cba_xeh_fnc_seatSwitched"; \
+seatSwitchedMan = "call cba_xeh_fnc_seatSwitchedMan"; \
+slotItemChanged = "call cba_xeh_fnc_slotItemChanged"; \
+suppressed = "call cba_xeh_fnc_suppressed"; \
+soundPlayed = "call cba_xeh_fnc_soundPlayed"; \
+take = "call cba_xeh_fnc_take"; \
+turnIn = "call cba_xeh_fnc_turnIn"; \
+turnOut = "call cba_xeh_fnc_turnOut"; \
+visionModeChanged = "call cba_xeh_fnc_visionModeChanged"; \
+weaponAssembled = "call cba_xeh_fnc_weaponAssembled"; \
+weaponChanged = "call cba_xeh_fnc_weaponChanged"; \
+weaponDisassembled = "call cba_xeh_fnc_weaponDisassembled"; \
+weaponDeployed = "call cba_xeh_fnc_weaponDeployed"; \
+weaponRested = "call cba_xeh_fnc_weaponRested";
+
+
+/*
+ MACRO: DELETE_EVENTHANDLERS
+
+ Removes all event handlers.
+*/
+
+#define DELETE_EVENTHANDLERS init = ""; \
+fired = ""; \
+animChanged = ""; \
+animDone = ""; \
+animStateChanged = ""; \
+assembled = ""; \
+attached = ""; \
+cargoLoaded = ""; \
+cargoUnloaded = ""; \
+containerClosed = ""; \
+containerOpened = ""; \
+controlsShifted = ""; \
+dammaged = ""; \
+deleted = ""; \
+detached = ""; \
+disassembled = ""; \
+engine = ""; \
+epeContact = ""; \
+epeContactEnd = ""; \
+epeContactStart = ""; \
+explosion = ""; \
+firedMan = ""; \
+firedNear = ""; \
+fuel = ""; \
+gear = ""; \
+gestureChanged = ""; \
+gestureDone = "" \
+getIn = ""; \
+getInMan = ""; \
+getOut = ""; \
+getOutMan = ""; \
+handleHeal = ""; \
+hit = ""; \
+hitPart = ""; \
+incomingMissile = ""; \
+inventoryClosed = ""; \
+inventoryOpened = ""; \
+killed = ""; \
+landedTouchDown = ""; \
+landedStopped = ""; \
+leaningChanged = ""; \
+local = ""; \
+magazineReloading = ""; \
+opticsModeChanged = ""; \
+opticsSwitch = ""; \
+put = ""; \
+reloaded = ""; \
+respawn = ""; \
+ropeAttach = ""; \
+ropeBreak = ""; \
+seatSwitched = ""; \
+seatSwitchedMan = ""; \
+soundPlayed = ""; \
+suppressed = ""; \
+take = ""; \
+turnIn = ""; \
+turnOut = ""; \
+visionModeChanged = ""; \
+weaponAssembled = ""; \
+weaponChanged = ""; \
+weaponDisassembled = ""; \
+weaponDeployed = ""; \
+weaponRested = "";
diff --git a/mod.cpp b/mod.cpp
index 572cf38..4aca958 100644
--- a/mod.cpp
+++ b/mod.cpp
@@ -9,4 +9,4 @@ tooltip = "CLF";
tooltipOwned = "CLF Owned";
overview = "Clarkson's Logi Framework is a mod designed to introduce a configurable logistical backing to the fundamental loop of Arma3, built and managed by players at runtime.";
author = "Clarky";
-//overviewPicture = ".paa";
\ No newline at end of file
+//overviewPicture = ".paa";