Skip to content

Commit 1f4e263

Browse files
committed
#13, #14, #24, and more fixes
Added more lights to HQ even though I really don't see a big difference. Added feature to be able to replace guards as well as stationary weapons for HQ and FOBs, but not replace the building itself, I thought it would be too OP. Added autosave in singleplayer when accepting missions. Finally, fixed an array problem in manual zones.
1 parent 19c173c commit 1f4e263

File tree

19 files changed

+405
-20
lines changed

19 files changed

+405
-20
lines changed

source/initHQ/BluHQinit.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ _handle = [_hq] execVM "sounds\radiochatter.sqf";
4545
//_drawicon = [] execVM "inithq\drawIcon.sqf"; // create the icon
4646

4747
//GUARDS
48-
_handle = [getpos hq_blu1] execVM "initHQ\guards.sqf";
48+
_handle = [(getpos hq_blu1), _hq] execVM "initHQ\guards.sqf";
4949

5050
//STATIC DEFENSES
51-
_handle = [getpos hq_blu1] execVM "initHQ\fortify.sqf";
51+
_handle = [(getpos hq_blu1), _hq] execVM "initHQ\fortify.sqf";
5252

5353
// IF THE OFFICER IS DEAD -- BEGIN OF "SPAWN"
5454
[_hq] spawn {

source/initHQ/fortify.sqf

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_centerPos = _this select 0;
2+
_hq = _this select 1;
23

34
_groupGuard = createGroup WEST;
45

@@ -48,9 +49,67 @@ _atpod3 setpos [(_centerpos select 0)+7, (_centerpos select 1)+8];
4849
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
4950
_HQguard1 moveinGunner _atpod3;
5051

52+
// LIGHTS
53+
_light1 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
54+
_light1 allowdamage false;
55+
_light1 setdamage 0;
56+
_light1 setpos [_centerpos select 0, _centerpos select 1];
57+
58+
_light2 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
59+
_light2 allowdamage false;
60+
_light2 setdamage 0;
61+
_light2 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)-5.5];
62+
63+
_light3 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
64+
_light3 allowdamage false;
65+
_light3 setdamage 0;
66+
_light3 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)+3.5];
67+
68+
_light4 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
69+
_light4 allowdamage false;
70+
_light4 setdamage 0;
71+
_light4 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)+3.5];
72+
73+
_light5 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
74+
_light5 allowdamage false;
75+
_light5 setdamage 0;
76+
_light5 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)-5.5];
77+
78+
_light6 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
79+
_light6 allowdamage false;
80+
_light6 setdamage 0;
81+
_light6 setpos [(_centerpos select 0)+2.75, (_centerpos select 1)-2.75];
82+
83+
_light7 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
84+
_light7 allowdamage false;
85+
_light7 setdamage 0;
86+
_light7 setpos [(_centerpos select 0)-2.75, (_centerpos select 1)+1.75];
87+
88+
_light8 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
89+
_light8 allowdamage false;
90+
_light8 setdamage 0;
91+
_light8 setpos [(_centerpos select 0)+2.75, (_centerpos select 1)+1.75];
92+
93+
_light9 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
94+
_light9 allowdamage false;
95+
_light9 setdamage 0;
96+
_light9 setpos [(_centerpos select 0)-2.75, (_centerpos select 1)-2.75];
97+
5198
sleep 2;
5299
_atpod1 allowdamage true;
53100
_atpod2 allowdamage true;
54101
_atpod3 allowdamage true;
55102
_gl1pod allowdamage true;
56103
_aapod allowdamage true;
104+
_light1 allowdamage true;
105+
_light2 allowdamage true;
106+
_light3 allowdamage true;
107+
_light4 allowdamage true;
108+
_light5 allowdamage true;
109+
_light6 allowdamage true;
110+
_light7 allowdamage true;
111+
_light8 allowdamage true;
112+
_light9 allowdamage true;
113+
114+
115+
_hq addAction ["<t color='#ff0066'>Replace Defences (20CP)</t>", "initHQ\refortify.sqf", [_aapod, _gl1pod, _atpod1, _atpod2, _atpod3, _centerpos, _hq], 0, true, true, "", "_this == player"];

source/initHQ/fortifyFOB.sqf

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
_centerPos = _this select 3;
1+
_centerPos = (_this select 3) select 0;
22
_actionID = _this select 2;
33
_object = _this select 0;
4+
_fob = (_this select 3) select 1;
5+
aliveAllUnits = {alive _x} count allunits;
46

57
if (commandpointsblu1 < 4) exitWith {hint "You don't have enough Command Points"};
68
commandpointsblu1 = commandpointsblu1 - 4;
79
publicvariable "commandpointsblu1";
8-
_object removeAction _actionID;
910

11+
12+
if ((Warcom_Limiter_Param == 1) && (aliveAllUnits>99)) exitWith {hint "*DUWS AI Limiter is ENABLED!*\n\nTry Fortifying again when there are less than 100 AI units on the map"};
13+
14+
_object removeAction _actionID;
1015
playSound "loadgun";
1116

1217
_groupGuard = createGroup WEST;
@@ -17,17 +22,17 @@ _aapod allowdamage false;
1722
_aapod setdamage 0;
1823
_aapod setpos [_centerpos select 0, _centerpos select 1,(_centerpos select 2)+3.109];
1924

20-
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
21-
_HQguard1 moveinGunner _aapod;
25+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
26+
_fobguard1 moveinGunner _aapod;
2227

2328
// GMG
2429
_gl1pod = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"];
2530
_gl1pod allowdamage false;
2631
_gl1pod setdamage 0;
2732
_gl1pod setpos [(_centerpos select 0)-7, (_centerpos select 1)+5.5];
2833

29-
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
30-
_HQguard1 moveinGunner _gl1pod;
34+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
35+
_fobguard1 moveinGunner _gl1pod;
3136

3237
// AT
3338
_atpod1 = createVehicle ["B_static_AT_F", [0,0,0], [], 0, "NONE"];
@@ -36,30 +41,63 @@ _atpod1 allowdamage false;
3641
_atpod1 setdamage 0;
3742
_atpod1 setdir 215;
3843

39-
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
40-
_HQguard1 moveinGunner _atpod1;
44+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
45+
_fobguard1 moveinGunner _atpod1;
4146

4247
// HMG
4348
_atpod2 = createVehicle ["B_HMG_01_high_F", [0,0,0], [], 0, "NONE"];
4449
_atpod2 allowdamage false;
4550
_atpod2 setdamage 0;
4651
_atpod2 setpos [(_centerpos select 0)+8, (_centerpos select 1)-7];
4752

48-
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
49-
_HQguard1 moveinGunner _atpod2;
53+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
54+
_fobguard1 moveinGunner _atpod2;
5055

5156
// GMG
5257
_atpod3 = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"];
5358
_atpod3 allowdamage false;
5459
_atpod3 setdamage 0;
5560
_atpod3 setpos [(_centerpos select 0)+7, (_centerpos select 1)+8];
5661

57-
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
58-
_HQguard1 moveinGunner _atpod3;
62+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
63+
_fobguard1 moveinGunner _atpod3;
64+
65+
// LIGHTS
66+
_light1 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
67+
_light1 allowdamage false;
68+
_light1 setdamage 0;
69+
_light1 setpos [_centerpos select 0, _centerpos select 1];
70+
71+
_light2 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
72+
_light2 allowdamage false;
73+
_light2 setdamage 0;
74+
_light2 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)-5.5];
75+
76+
_light3 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
77+
_light3 allowdamage false;
78+
_light3 setdamage 0;
79+
_light3 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)+3.5];
80+
81+
_light4 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
82+
_light4 allowdamage false;
83+
_light4 setdamage 0;
84+
_light4 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)+3.5];
85+
86+
_light5 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
87+
_light5 allowdamage false;
88+
_light5 setdamage 0;
89+
_light5 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)-5.5];
5990

6091
sleep 2;
6192
_atpod1 allowdamage true;
6293
_atpod2 allowdamage true;
6394
_atpod3 allowdamage true;
6495
_gl1pod allowdamage true;
65-
_aapod allowdamage true;
96+
_aapod allowdamage true;
97+
_light1 allowdamage true;
98+
_light2 allowdamage true;
99+
_light3 allowdamage true;
100+
_light4 allowdamage true;
101+
_light5 allowdamage true;
102+
103+
_fob addAction ["<t color='#ff0066'>Replace FOB Defences (15CP)</t>", "initHQ\refortifyFOB.sqf", [_aapod, _gl1pod, _atpod1, _atpod2, _atpod3, _centerpos, _fob], 0, true, true, "", "_this == player"];

source/initHQ/fortifyFOB2.sqf

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
_centerPos = _this select 0;
2+
_fob = _this select 1;
3+
4+
_groupGuard = createGroup WEST;
5+
6+
// AA on the roof
7+
_aapod = createVehicle ["B_static_AA_F", [0,0,0], [], 0, "NONE"];
8+
_aapod allowdamage false;
9+
_aapod setdamage 0;
10+
_aapod setpos [_centerpos select 0, _centerpos select 1,(_centerpos select 2)+3.109];
11+
12+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
13+
_fobguard1 moveinGunner _aapod;
14+
15+
// GMG
16+
_gl1pod = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"];
17+
_gl1pod allowdamage false;
18+
_gl1pod setdamage 0;
19+
_gl1pod setpos [(_centerpos select 0)-7, (_centerpos select 1)+5.5];
20+
21+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
22+
_fobguard1 moveinGunner _gl1pod;
23+
24+
// AT
25+
_atpod1 = createVehicle ["B_static_AT_F", [0,0,0], [], 0, "NONE"];
26+
_atpod1 setpos [(_centerpos select 0)-7, (_centerpos select 1)-8];
27+
_atpod1 allowdamage false;
28+
_atpod1 setdamage 0;
29+
_atpod1 setdir 215;
30+
31+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
32+
_fobguard1 moveinGunner _atpod1;
33+
34+
// HMG
35+
_atpod2 = createVehicle ["B_HMG_01_high_F", [0,0,0], [], 0, "NONE"];
36+
_atpod2 allowdamage false;
37+
_atpod2 setdamage 0;
38+
_atpod2 setpos [(_centerpos select 0)+8, (_centerpos select 1)-7];
39+
40+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
41+
_fobguard1 moveinGunner _atpod2;
42+
43+
// GMG
44+
_atpod3 = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"];
45+
_atpod3 allowdamage false;
46+
_atpod3 setdamage 0;
47+
_atpod3 setpos [(_centerpos select 0)+7, (_centerpos select 1)+8];
48+
49+
_fobguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
50+
_fobguard1 moveinGunner _atpod3;
51+
52+
// LIGHTS
53+
_light1 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
54+
_light1 allowdamage false;
55+
_light1 setdamage 0;
56+
_light1 setpos [_centerpos select 0, _centerpos select 1];
57+
58+
_light2 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
59+
_light2 allowdamage false;
60+
_light2 setdamage 0;
61+
_light2 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)-5.5];
62+
63+
_light3 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
64+
_light3 allowdamage false;
65+
_light3 setdamage 0;
66+
_light3 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)+3.5];
67+
68+
_light4 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
69+
_light4 allowdamage false;
70+
_light4 setdamage 0;
71+
_light4 setpos [(_centerpos select 0)+5.5, (_centerpos select 1)+3.5];
72+
73+
_light5 = createVehicle ["Land_Camping_Light_F", [0,0,0], [], 0, "NONE"];
74+
_light5 allowdamage false;
75+
_light5 setdamage 0;
76+
_light5 setpos [(_centerpos select 0)-5.5, (_centerpos select 1)-5.5];
77+
78+
sleep 2;
79+
_atpod1 allowdamage true;
80+
_atpod2 allowdamage true;
81+
_atpod3 allowdamage true;
82+
_gl1pod allowdamage true;
83+
_aapod allowdamage true;
84+
_light1 allowdamage true;
85+
_light2 allowdamage true;
86+
_light3 allowdamage true;
87+
_light4 allowdamage true;
88+
_light5 allowdamage true;
89+
90+
_fob addAction ["<t color='#ff0066'>Replace FOB Defences (15CP)</t>", "initHQ\refortifyFOB.sqf", [_aapod, _gl1pod, _atpod1, _atpod2, _atpod3, _centerpos, _fob], 0, true, true, "", "_this == player"];

source/initHQ/guards.sqf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_centerPos = _this select 0;
2+
_hq = _this select 1;
23

34
// Create the guards
45
_groupGuard = createGroup WEST;
@@ -49,4 +50,6 @@ _wp setWaypointType "MOVE";
4950
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)+10], 0];
5051
_wp setWaypointType "CYCLE";
5152
_wp setWaypointBehaviour "SAFE";
52-
_wp setWaypointSpeed "LIMITED";
53+
_wp setWaypointSpeed "LIMITED";
54+
55+
_hq addAction ["<t color='#ff0066'>Replace Guards (20CP)</t>", "initHQ\reguard.sqf", [_groupGuard, _groupPatrol, _centerPos, _hq], 0, true, true, "", "_this == player"];

source/initHQ/guardsFOB.sqf

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
_centerPos = _this select 0;
2+
_fob = _this select 1;
3+
_size = 500;
4+
5+
// Create the guards
6+
_groupGuard = createGroup WEST;
7+
_HQguard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
8+
_HQguard1 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-1.6];
9+
_HQguard1 setdir 270;
10+
[_HQguard1,"STAND","FULL"] call BIS_fnc_ambientAnimCombat;
11+
12+
_HQguard2 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"];
13+
_HQguard2 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-4.7];
14+
_HQguard2 setdir 270;
15+
[_HQguard2,"WATCH","FULL"] call BIS_fnc_ambientAnimCombat;
16+
17+
_HQguard3 = _groupGuard createUnit ["B_Soldier_TL_F", _centerPos, [], 0, "FORM"];
18+
_HQguard3 setpos [(_centerPos select 0), (_centerPos select 1)-7.58];
19+
_HQguard3 setdir 180;
20+
[_HQguard3,"LEAN","FULL"] call BIS_fnc_ambientAnimCombat;
21+
22+
_HQguard4 = _groupGuard createUnit ["B_Soldier_LAT_F", _centerPos, [], 0, "FORM"];
23+
_HQguard4 setpos [(_centerPos select 0), (_centerPos select 1)-9];
24+
_HQguard4 setdir 0;
25+
[_HQguard4,"STAND","FULL"] call BIS_fnc_ambientAnimCombat;
26+
27+
// patrolling guard
28+
_groupPatrol = createGroup WEST;
29+
_HQguard5 = _groupPatrol createUnit ["B_Soldier_GL_F", _centerPos, [], 0, "FORM"];
30+
_HQguard5 setpos [(_centerPos select 0)+10, (_centerPos select 1)+10];
31+
32+
_groupPatrol setCombatMode "YELLOW";
33+
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)+10], 0];
34+
_wp setWaypointType "MOVE";
35+
_wp setWaypointBehaviour "SAFE";
36+
_wp setWaypointSpeed "LIMITED";
37+
38+
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)+10], 0];
39+
_wp setWaypointType "MOVE";
40+
_wp setWaypointBehaviour "SAFE";
41+
_wp setWaypointSpeed "LIMITED";
42+
43+
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)-10], 0];
44+
_wp setWaypointType "MOVE";
45+
_wp setWaypointBehaviour "SAFE";
46+
_wp setWaypointSpeed "LIMITED";
47+
48+
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)-10], 0];
49+
_wp setWaypointType "MOVE";
50+
51+
_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)+10], 0];
52+
_wp setWaypointType "CYCLE";
53+
_wp setWaypointBehaviour "SAFE";
54+
_wp setWaypointSpeed "LIMITED";
55+
56+
_fob addAction ["<t color='#ff0066'>Replace Guards (15CP)</t>", "initHQ\reguardFOB.sqf", [_groupGuard, _groupPatrol, _centerPos, _fob], 0, true, true, "", "_this == player"];

source/initHQ/refortify.sqf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
_aapod = (_this select 3) select 0;
2+
_gl1pod = (_this select 3) select 1;
3+
_atpod1 = (_this select 3) select 2;
4+
_atpod2 = (_this select 3) select 3;
5+
_atpod3 = (_this select 3) select 4;
6+
_centerPos = (_this select 3) select 5;
7+
_hq = (_this select 3) select 6;
8+
9+
if (commandpointsblu1>20) then {
10+
commandpointsblu1 = commandpointsblu1 - 20;
11+
publicVariable "commandpointsblu1";
12+
13+
playSound "loadgun";
14+
15+
{deletevehicle _x} foreach crew _aapod + [_aapod];
16+
{deletevehicle _x} foreach crew _gl1pod + [_gl1pod];
17+
{deletevehicle _x} foreach crew _atpod1 + [_atpod1];
18+
{deletevehicle _x} foreach crew _atpod2 + [_atpod2];
19+
{deletevehicle _x} foreach crew _atpod3 + [_atpod3];
20+
21+
(_this select 0) removeaction (_this select 2);
22+
0 = [_centerPos, _hq] execvm "initHQ\fortify.sqf";
23+
} else {
24+
hint "Not enough Command Points (20CP required)";
25+
};

0 commit comments

Comments
 (0)