This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathx_macros.sqf
83 lines (76 loc) · 4.81 KB
/
x_macros.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// uncomment for debugging with __TRACE. see below
//#define __DEBUG__
#define __COMP d
#define FUNC(funcname) __COMP##_fnc_##funcname
#define GVAR(varname) __COMP##_##varname
#define QUOTE(qtext) #qtext
#define QGVAR(varname) QUOTE(GVAR(varname))
#define GV(obje,varname) (obje getVariable #varname)
#define GV2(obje,varname) (obje getVariable varname)
#define PARAMS_1(param1) param1 = _this select 0
#define PARAMS_2(param1,param2) PARAMS_1(param1); param2 = _this select 1
#define PARAMS_3(param1,param2,param3) PARAMS_2(param1,param2); param3 = _this select 2
#define PARAMS_4(param1,param2,param3,param4) PARAMS_3(param1,param2,param3); param4 = _this select 3
#define PARAMS_5(param1,param2,param3,param4,param5) PARAMS_4(param1,param2,param3,param4); param5 = _this select 4
#define PARAMS_6(param1,param2,param3,param4,param5,param6) PARAMS_5(param1,param2,param3,param4,param5); param6 = _this select 5
#define PARAMS_7(param1,param2,param3,param4,param5,param6,param7) PARAMS_6(param1,param2,param3,param4,param5,param6); param7 = _this select 6
#define PARAMS_8(param1,param2,param3,param4,param5,param6,param7,param8) PARAMS_7(param1,param2,param3,param4,param5,param6,param7); param8 = _this select 7
#define __isEast if (GVAR(own_side) == "EAST") then {
#define __isWest if (GVAR(own_side) == "WEST") then {
#define __getMNsVar(mvarname) (missionNamespace getVariable #mvarname)
#define __getMNsVar2(mvarname) (missionNamespace getVariable mvarname)
#define __mNsSetVar missionNamespace setVariable
#define __pGetVar(pvarname) (player getVariable #pvarname)
#define __pSetVar player setVariable
#define __XJIPGetVar(jvarname) (X_JIPH getVariable #jvarname)
#define __XJIPSetVar X_JIPH setVariable
#define __uiGetVar(uvarname) (uiNamespace getVariable #uvarname)
#define __AIVer ("AI" in GVAR(version))
#define __OAVer ("OA" in GVAR(version))
#define __COVer ("CO" in GVAR(version))
#define __RankedVer ("RANKED" in GVAR(version))
#define __WoundsVer ("WOUNDS" in GVAR(version))
#define __AddToExtraVec(ddvec) GVAR(extra_mission_vehicle_remover_array) set [count GVAR(extra_mission_vehicle_remover_array), ddvec];
#define __GetEGrp(grpnamexx) grpnamexx = [GVAR(side_enemy)] call FUNC(creategroup);
#define __TargetInfo _target_array2 = GVAR(target_names) select (X_JIPH getVariable QUOTE(GVAR(current_target_index)));_current_target_name = _target_array2 select 1;
#define __addRemoveVehi(xvecx) xvecx execFSM "fsms\RemoveVehi.fsm";
#define __addDead(xunitx) GVAR(allunits_add) set [count GVAR(allunits_add), xunitx];
#define __Poss _poss = GVAR(x_sm_pos) select 0;
#define __PossAndOther _poss = GVAR(x_sm_pos) select 0;_pos_other = GVAR(x_sm_pos) select 1;
#define __ccppfln(xfile1) call compile preprocessFileLineNumbers #xfile1
#define __cppfln(xdfunc,xfile2) xdfunc = compile preprocessFileLineNumbers #xfile2
#define __addkpw(wpoints) GVAR(kill_points_west) = GVAR(kill_points_west) + wpoints
#define __addkpe(epoints) GVAR(kill_points_east) = GVAR(kill_points_east) + epoints
#define __notlocalexit(xtheunit) if (!local xtheunit) exitWith {}
#define __INC(vari) vari = vari + 1
#define __DEC(vard) vard = vard - 1
#define __MPCheck if (X_MP) then { \
if ((call FUNC(PlayersNumber)) == 0 && {!GVAR(all_simulation_stoped)}) then { \
GVAR(all_simulation_stoped) = true; \
{_x enableSimulation false} forEach allUnits; \
}; \
waitUntil {sleep (1.012 + random 1);(call FUNC(PlayersNumber)) > 0}; \
if (GVAR(all_simulation_stoped)) then { \
{_x enableSimulation true} forEach allUnits; \
GVAR(all_simulation_stoped) = false; \
}; \
};
#define __DOM_NVER_STR__ "Domination! 2"
#define __DOM_NVER_STR2__ "2.80"
#ifdef THIS_FILE
#define THIS_FILE_ 'THIS_FILE'
scriptName THIS_FILE;
#else
#define THIS_FILE_ __FILE__
#endif
#ifdef __DEBUG__
#define __TRACE(tmsg) diag_log format ["T%1,DT%2,F%3,FPS%4,%5,%6,'%7'", time, diag_tickTime, diag_frameno, diag_fps, THIS_FILE_, __LINE__, tmsg];
#define __TRACE_1(tmsg,parame1) diag_log format ["T%1,DT%2,F%3,FPS%4,%5,%6,'%7',%8: %9", time, diag_tickTime, diag_frameno, diag_fps, THIS_FILE_, __LINE__, tmsg, parame1, call compile format ["%1", parame1]];
#define __TRACE_2(tmsg,parame1,parame2) diag_log format ["T%1,DT%2,F%3,FPS%4,%5,%6,'%7',%8: %9,%10: %11", time, diag_tickTime, diag_frameno, diag_fps, THIS_FILE_, __LINE__, tmsg, parame1, call compile format ["%1", parame1], parame2, call compile format ["%1", parame2]];
#define __TRACE_3(tmsg,parame1,parame2,parame3) diag_log format ["T%1,DT%2,F%3,FPS%4,%5,%6,'%7',%8: %9,%10: %11,%12: %13", time, diag_tickTime, diag_frameno, diag_fps, THIS_FILE_, __LINE__, tmsg, parame1, call compile format ["%1", parame1], parame2, call compile format ["%1", parame2], parame3, call compile format ["%1", parame3]];
#else
#define __TRACE(tmsg)
#define __TRACE_1(tmsg,parame1)
#define __TRACE_2(tmsg,parame1,parame2)
#define __TRACE_3(tmsg,parame1,parame2,parame3)
#endif