2016-10-02 10:55:31 +00:00
|
|
|
#define DEBUG_SYNCHRONOUS
|
2016-05-30 16:37:03 +00:00
|
|
|
#include "\x\cba\addons\main\script_macros_common.hpp"
|
|
|
|
#include "\x\cba\addons\xeh\script_xeh.hpp"
|
|
|
|
|
|
|
|
// Default versioning level
|
|
|
|
#define DEFAULT_VERSIONING_LEVEL 2
|
|
|
|
|
|
|
|
#define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName)
|
|
|
|
#define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName
|
|
|
|
#define DFUNC(var1) TRIPLES(ADDON,fnc,var1)
|
|
|
|
#define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2)
|
|
|
|
|
2016-06-17 19:44:04 +00:00
|
|
|
#undef QFUNC
|
|
|
|
#undef QEFUNC
|
|
|
|
#define QFUNC(var1) QUOTE(DFUNC(var1))
|
|
|
|
#define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2))
|
|
|
|
|
2016-05-30 16:37:03 +00:00
|
|
|
#define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)]
|
|
|
|
#define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)]
|
|
|
|
#define SETPVAR_SYS(var1,var2) setVariable [ARR_3(QUOTE(var1),var2,true)]
|
|
|
|
|
2016-06-14 15:27:47 +00:00
|
|
|
#undef GETVAR
|
2017-12-30 13:38:45 +00:00
|
|
|
#define GETVAR(var1,var2,var3) (var1 GETVAR_SYS(var2,var3))
|
|
|
|
#define GETMVAR(var1,var2) (missionNamespace GETVAR_SYS(var1,var2))
|
|
|
|
#define GETUVAR(var1,var2) (uiNamespace GETVAR_SYS(var1,var2))
|
|
|
|
#define GETPRVAR(var1,var2) (profileNamespace GETVAR_SYS(var1,var2))
|
|
|
|
#define GETPAVAR(var1,var2) (parsingNamespace GETVAR_SYS(var1,var2))
|
2016-05-30 16:37:03 +00:00
|
|
|
|
2016-06-14 15:27:47 +00:00
|
|
|
#undef SETVAR
|
2016-05-30 16:37:03 +00:00
|
|
|
#define SETVAR(var1,var2,var3) var1 SETVAR_SYS(var2,var3)
|
|
|
|
#define SETPVAR(var1,var2,var3) var1 SETPVAR_SYS(var2,var3)
|
|
|
|
#define SETMVAR(var1,var2) missionNamespace SETVAR_SYS(var1,var2)
|
|
|
|
#define SETUVAR(var1,var2) uiNamespace SETVAR_SYS(var1,var2)
|
|
|
|
#define SETPRVAR(var1,var2) profileNamespace SETVAR_SYS(var1,var2)
|
|
|
|
#define SETPAVAR(var1,var2) parsingNamespace SETVAR_SYS(var1,var2)
|
|
|
|
|
|
|
|
#define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2)
|
|
|
|
#define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3)
|
|
|
|
|
2017-12-30 13:38:45 +00:00
|
|
|
#define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT})
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \
|
|
|
|
weapon = #WEAPON; \
|
|
|
|
count = COUNT; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
|
|
|
name = #ITEM; \
|
|
|
|
count = COUNT; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \
|
|
|
|
magazine = #MAGAZINE; \
|
|
|
|
count = COUNT; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MACRO_ADDBACKPACK(BACKPACK,COUNT) class _xx_##BACKPACK { \
|
|
|
|
backpack = #BACKPACK; \
|
|
|
|
count = COUNT; \
|
|
|
|
}
|
|
|
|
|
|
|
|
// item types
|
|
|
|
#define TYPE_DEFAULT 0
|
|
|
|
#define TYPE_MUZZLE 101
|
|
|
|
#define TYPE_OPTICS 201
|
|
|
|
#define TYPE_FLASHLIGHT 301
|
|
|
|
#define TYPE_BIPOD 302
|
|
|
|
#define TYPE_FIRST_AID_KIT 401
|
|
|
|
#define TYPE_FINS 501 // not implemented
|
|
|
|
#define TYPE_BREATHING_BOMB 601 // not implemented
|
|
|
|
#define TYPE_NVG 602
|
|
|
|
#define TYPE_GOGGLE 603
|
|
|
|
#define TYPE_SCUBA 604 // not implemented
|
|
|
|
#define TYPE_HEADGEAR 605
|
|
|
|
#define TYPE_FACTOR 607
|
|
|
|
#define TYPE_RADIO 611
|
|
|
|
#define TYPE_HMD 616
|
|
|
|
#define TYPE_BINOCULAR 617
|
|
|
|
#define TYPE_MEDIKIT 619
|
|
|
|
#define TYPE_TOOLKIT 620
|
|
|
|
#define TYPE_UAV_TERMINAL 621
|
|
|
|
#define TYPE_VEST 701
|
|
|
|
#define TYPE_UNIFORM 801
|
|
|
|
#define TYPE_BACKPACK 901
|
|
|
|
|
|
|
|
#ifdef DISABLE_COMPILE_CACHE
|
2016-07-04 06:17:30 +00:00
|
|
|
#undef PREP
|
2016-06-02 15:02:09 +00:00
|
|
|
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QPATHTOF(functions\DOUBLES(fnc,fncName).sqf)
|
2016-05-30 16:37:03 +00:00
|
|
|
#else
|
2016-06-14 15:27:47 +00:00
|
|
|
#undef PREP
|
2016-06-02 15:02:09 +00:00
|
|
|
#define PREP(fncName) [QPATHTOF(functions\DOUBLES(fnc,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
|
2016-05-30 16:37:03 +00:00
|
|
|
#endif
|
|
|
|
|
2016-06-02 15:02:09 +00:00
|
|
|
#define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QPATHTOF(folder\__PREP__.sqf)
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
#define ACE_isHC (!hasInterface && !isDedicated)
|
|
|
|
|
|
|
|
#define IDC_STAMINA_BAR 193
|
|
|
|
|
2016-10-02 10:55:31 +00:00
|
|
|
#define ACE_DEPRECATED(arg1,arg2,arg3) WARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3)
|
2016-05-30 16:37:03 +00:00
|
|
|
|
|
|
|
#define PFORMAT_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) \
|
|
|
|
format ['%1: A=%2, B=%3, C=%4, D=%5, E=%6, F=%7, G=%8, H=%9, I=%10 J=%11', MESSAGE, RETNIL(A), RETNIL(B), RETNIL(C), RETNIL(D), RETNIL(E), RETNIL(F), RETNIL(G), RETNIL(H), RETNIL(I), RETNIL(J)]
|
|
|
|
#ifdef DEBUG_MODE_FULL
|
|
|
|
#define TRACE_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) \
|
|
|
|
[THIS_FILE_, __LINE__, PFORMAT_10(MESSAGE,A,B,C,D,E,F,G,H,I,J)] call CBA_fnc_log
|
|
|
|
#else
|
|
|
|
#define TRACE_10(MESSAGE,A,B,C,D,E,F,G,H,I,J) /* disabled */
|
|
|
|
#endif
|
|
|
|
|
2017-10-28 08:34:54 +00:00
|
|
|
#define GRAVITY 9.8066
|
|
|
|
|
2017-11-14 13:43:29 +00:00
|
|
|
#define SD_TO_MIN_MAX(d) ((d) * 3.371) // Standard deviation -> min / max of random [min, mid, max]
|
|
|
|
|
2017-11-06 17:33:08 +00:00
|
|
|
// Angular unit conversion
|
|
|
|
#define MRAD_TO_MOA(d) ((d) * 3.43774677) // Conversion factor: 54 / (5 * PI)
|
|
|
|
#define MOA_TO_MRAD(d) ((d) * 0.29088821) // Conversion factor: (5 * PI) / 54
|
|
|
|
#define DEG_TO_MOA(d) ((d) * 60) // Conversion factor: 60
|
|
|
|
#define MOA_TO_DEG(d) ((d) / 60) // Conversion factor: 1 / 60
|
|
|
|
#define DEG_TO_MRAD(d) ((d) * 17.45329252) // Conversion factor: (50 * PI) / 9
|
|
|
|
#define MRAD_TO_DEG(d) ((d) / 17.45329252) // Conversion factor: 9 / (50 * PI)
|
|
|
|
#define MOA_TO_RAD(d) ((d) * 0.00029088) // Conversion factor: PI / 10800
|
|
|
|
|
2016-05-30 16:37:03 +00:00
|
|
|
#include "script_debug.hpp"
|