Skip to content

Commit 640a71c

Browse files
phr0gzfritogotlayed
authored andcommitted
Zones placed under server control, AI can cap any zone without anyone on the server
1 parent 258d119 commit 640a71c

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

source/captured.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _index = 0;
2222
} forEach WARCOM_zones_controled_by_OPFOR;
2323

2424
// ADD POINTS
25-
if (hasInterface) then {
25+
if (isServer) then {
2626
_points = round(_points/3);
2727
commandpointsblu1 = commandpointsblu1 + _points;
2828
publicVariable "commandpointsblu1";

source/initHQ/BluHQinit.sqf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ if (!zones_manually_placed) then {
9292

9393
// CALL ZONES GENERATION
9494
waitUntil {!isNil {getsize_script}}; // WAIT UNTIL THE MAPSIZE SCRIPT IS DONE
95+
createzone_server = true;
96+
publicVariable "createzone_server";
9597

9698
// CHECK IF ZONES ARE PLACED...
9799
// If not execute locatorZonesV1.sqf if the user wants them randomly placed. V2 if the user wants to place zones.
98-
if (!zones_created && !manually_chosen) then {
99-
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
100-
} else {
101-
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
102-
};
100+
// if (!zones_created && !manually_chosen) then {
101+
// _zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf";
102+
// } else {
103+
// _zones_create = [50, 0.2] execVM "initZones\locatorZonesV2.sqf";
104+
// };
103105
};
104106

105107
player allowDamage true;

source/initZones/locatorzonesV1.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ while {!_found} do
5252
_posDeMeilleurTruc = [center_of_map, 0,half_of_map,5,0,0.1,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos;
5353
if (_posDeMeilleurTruc select 0 != 0 && _posDeMeilleurTruc select 1 != 0) then {_Posfound=true;};
5454
};
55-
_playerDistance = _posDeMeilleurTruc distance player;
55+
_playerDistance = _posDeMeilleurTruc distance hq_blu1;
5656

5757

5858

@@ -91,7 +91,7 @@ while {!_found} do
9191

9292
player globalChat format["Zone location #%1 found !",_i];
9393
player globalChat format["Generating zone #%1",_i];
94-
waituntil {scriptdone _generatezonescript};
94+
//waituntil {scriptdone _generatezonescript};
9595
}; // END OF THIRD LOOP
9696
}; // END SECOND LOOP
9797
}; // END WHILE LOOP --- LOCATION FOUND

source/serverinit.sqf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ if (isNil "FogVar") then {
159159

160160
publicVariable "FogVar";
161161

162+
if (isNil "createzone_server") then {
163+
createzone_server = false;
164+
};
165+
166+
publicVariable "createzone_server";
167+
168+
if (isNil "mission_number_of_zones_captured") then {
169+
mission_number_of_zones_captured = 0;
170+
};
171+
172+
publicVariable "mission_number_of_zones_captured";
173+
162174
// this is a special one (if/else)
163175
if (isNil "Array_of_FOBS") then {
164176
// if the player is sp or server or no fobs have been created
@@ -180,7 +192,12 @@ publicVariable "Array_of_FOBname";
180192

181193
game_master = ["player1"];publicVariable "game_master";
182194

183-
195+
waitUntil {chosen_settings && createzone_server};
196+
if (!zones_manually_placed) then {
197+
if (!zones_created) then { // CHECK IF ZONES ARE PLACED, IF NOT EXECUTE locatorZonesV1.sqf
198+
_zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf"; // CHECK IF ZONES HAVE ALREADY BEEN PLACED
199+
};
200+
};
184201

185202
waitUntil { !isNil "serv_zones_array" };
186203
diag_log format ["serv_zones_array: %1", serv_zones_array];

0 commit comments

Comments
 (0)