Skip to content

Commit 42bb99b

Browse files
committed
Merged phr0gzMultiplaye fritogotlayed/DUWS-R@640a71c into development
2 parents 593f85c + 640a71c commit 42bb99b

File tree

24 files changed

+622
-250
lines changed

24 files changed

+622
-250
lines changed

source/INIT.sqf

Lines changed: 43 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,21 @@
11
diag_log format ["------------------ DUWS-R START ----v0------ player: %1", profileName];
22

3-
//////////////////////////////////////////////////////
4-
// HOW TO MANUALLY CREATE THE MISSION:
5-
// 1)YOU MUST PLACE THE HQ LOCATION
6-
// 2)DEFINE THE CAPTURABLE ZONES
7-
// -- YOU CAN ALSO JUST PUT A HQ SOMEWHERE AND LET THE ZONES BEING RANDOMLY GENERATED
8-
// -- YOU MUST PLACE MANUALLY THE HQ IF YOU ARE ALREADY PLACING THE ZONES BY HAND
9-
// 3) DONT FORGET TO DEFINE THE VARIABLES BELOW. If you are ONLY placing the HQ by hand, you just need to put "hq_manually_placed" to
10-
// "true" instead of "false". If you are also placing the zones by hand, make "zones_manually_placed" to "true".
11-
/////////////////////////////////////////////////////////////
12-
// 1) In the gamelogic, for the HQ( !! MAKE ONLY ONE HQ !!): _null=[getpos this] execVM "initHQ\BluHQinit.sqf"
13-
//
14-
// 2) In the init of gamelogic, to create a capturable enemy zone:
15-
// _null = ["zone name",pts awarded upon capture, zone radius,getpos this,false/true,false/true] execvm "createzone.sqf";
16-
// "zone name": name of the zone
17-
// pts awarded upon capture: points you earn when you capture the zone. Also the amount of points of army power you take and receive
18-
// from the enemy after capture
19-
// zone radius: how large the zone is
20-
// getpos this: It's the position of the zone. The gamelogic actually. You don't have to modify this.
21-
// false/true: if the zone is fortified or not. If the zone is fortified, there will be a bit more enemies and they will be maning
22-
// static defences if there are any
23-
// false/true: if the zone is selecting randomly a prefab base. Prefab is selected according to the zone radius. The bigger the zone,
24-
// the bigger the prefab asset will be chosen.
25-
//
26-
// EXAMPLE, in the init of a gamelogic you have placed on the map:
27-
// _null=["OP Xander",20,200,getpos this,true,false] execvm "initZones\createzone.sqf"
28-
//
29-
// 3) Define these variables:
30-
31-
// choose between "tropical" - "arid" - "temperate" - "temperate_cold" - "mediterranean"
32-
if (isNil "weather_type") then {weather_type = "tropical";};
33-
// set the skill range of ennemy AI
34-
if (isNil "opfor_ai_skill") then {opfor_ai_skill = [0.1,0.3];};
35-
// set the skill range of friendly AI, from 0 to 1 (0 being completely dumb)
36-
if (isNil "blufor_ai_skill") then {blufor_ai_skill = [0.4,0.7];};
37-
38-
// you must specify if you have manually placed HQ or not. false = HQ is randomly placed, true = you have manually placed the HQ
39-
hq_manually_placed = false;
40-
// you must specify if you have manually placed the zones or not. false = zones are randomly generated, true = you have manually placed the zones
41-
zones_manually_placed = false;
42-
zones_max_dist_from_hq = 7500;
43-
dynamic_weather_enable = true;
44-
maually_chosen = false;
45-
46-
if (isNil "enable_fast_travel") then { enable_fast_travel = true; };
47-
// chopper taxi (support) will fast travel (teleport) or not
48-
if (isNil "enableChopperFastTravel") then { enableChopperFastTravel = true; };
49-
// Starting CP
50-
if (isNil "commandpointsblu1") then { commandpointsblu1 = 20; };
51-
// STARTING ARMY POWER
52-
if (isNil "blufor_ap") then {blufor_ap = 0;};
53-
opfor_ap = 0;
54-
55-
///////////////////////////////////////////////////////
56-
// initialise variables
57-
//////////////////////////////////////////////////////
58-
// MOST OF THE VALUES ARE BEING OVERWRITTEN BY PLAYER INPUT AT THE BEGINNING
59-
//////////////////////////////////////////////////////
60-
61-
/////////////////////////////////////////////////////////////
62-
debugmode = false; // Debug mode, kind of obsolete
63-
/// ------------- VALUES UNDER THIS ARE OVERWRITTEN
64-
zones_number = 9; // Number of capturables zones to create (when zones are created randomly)
65-
zones_spacing = 1200; // minimum space between 2 zones (in meters) // SOON OBSOLETE
66-
zones_max_radius = 1000; // Determine the maximum radius a generated zone can have
67-
zones_min_radius = 200; // Determine the minium radius a generated zone can have. SHOULD NOT BE UNDER 200.
68-
69-
///////////////////////////////////////////////////////
70-
// This mission will have a harder time generating stuff if a lot of the terrain of the island is sloped, meaning that valid locations
71-
// will be harder/take longer to find (side missions, mission init).
72-
// Keep that in mind when tweaking the zones amount/radius value.
73-
/////////////////////////////////////////////////////////
74-
// preprocess the qrf file for the EH
75-
QRF_test = compile preprocessFile "WARCOM\WARCOM_opf_qrf.sqf";
76-
persistent_stat_script_init = [] execVM "persistent\persistent_stats_init.sqf";
77-
waitUntil {scriptDone persistent_stat_script_init};
78-
execvm "dynamic_music\dyn_music_init.sqf";
79-
80-
// nber of missions succes(!!dont touch!!)
81-
missions_success = 0;
82-
83-
zones_created = false;
84-
blu_hq_created = false;
85-
can_get_mission = true;
86-
failsafe_zones_not_found = false;
87-
createcenter sideLogic;
88-
LogicGroup = createGroup SideLogic;
89-
PAPABEAR=[West,"HQ"];
90-
locator_hq_actived = false;
91-
op_zones_index = 0;
92-
clientisSync = false;
93-
fobSwitch = false;
94-
player_is_choosing_hqpos = false;
95-
96-
if (isNil "amount_zones_created") then {
97-
amount_zones_created = 0;
98-
};
99-
100-
if (isNil "HQ_pos_found_generated") then {
101-
HQ_pos_found_generated = false;
102-
};
1033

104-
if (isNil "chosen_settings") then {
105-
chosen_settings = false;
106-
};
107-
108-
if (isNil "chosen_hq_placement") then {
109-
chosen_hq_placement = false;
110-
};
111-
112-
if (isNil "zoneundercontrolblu") then {
113-
zoneundercontrolblu = 0;
114-
};
4+
if (isServer) then { nul = [] execVM "serverinit.sqf"; };
5+
if (isDedicated) exitWith {};
6+
waitUntil {!isNull player};
1157

116-
if (isNil "amount_zones_captured") then {
117-
amount_zones_captured = 0;
118-
};
119-
120-
if (isNil "savegameNumber") then {
121-
savegameNumber = 0;
122-
};
123-
124-
if (isNil "capturedZonesNumber") then {
125-
capturedZonesNumber = 0;
126-
};
127-
128-
if (isNil "finishedMissionsNumber") then {
129-
finishedMissionsNumber = 0;
130-
};
131-
132-
if (isNil "OvercastVar") then {
133-
OvercastVar = 0;
134-
};
135-
136-
if (isNil "FogVar") then {
137-
FogVar = 0;
138-
};
8+
player allowDamage false;
1399

140-
// this is a special one (if/else)
141-
if (isNil "Array_of_FOBS") then {
142-
// if the player is sp or server or no fobs have been created
143-
Array_of_FOBS = [];
144-
}
145-
else /// JIP for the client
146-
{
147-
{
148-
[_x] execVM "support\FOBactions.sqf";
149-
} forEach Array_of_FOBS;
150-
};
10+
persistent_stat_script_init = [] execVM "persistent\persistent_stats_init.sqf";
11+
waitUntil {scriptDone persistent_stat_script_init};
12+
execvm "dynamic_music\dyn_music_init.sqf";
15113

152-
if (isNil "Array_of_FOBname") then {
153-
Array_of_FOBname = [];
154-
};
155-
156-
player allowDamage false;
15714

15815
#include "dialog\supports_init.hpp"
15916
#include "dialog\squad_number_init.hpp"
16017

161-
execVM "misc\gps_marker.sqf";
18+
if (hasInterface) then { execVM "misc\gps_marker.sqf";};
16219
if (!isMultiplayer) then {
16320
getsize_script = [player] execVM "mapsize.sqf";
16421
};
@@ -220,32 +77,41 @@ if (isMultiplayer) then {
22077
if (!isServer) then {
22178
"finishedMissionsNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_missions_total.sqf";}; // change the shown CP for request dialog
22279
};
80+
81+
player globalChat format ["gamemaster: %1", game_master];
82+
player globalChat format ["HQ_pos_found_generated: %1", HQ_pos_found_generated];
22383

224-
if (isServer) then { // SERVER INIT
225-
DUWS_host_start = false;
226-
publicVariable "DUWS_host_start";
227-
waitUntil {time > 0.1};
228-
getsize_script = [player] execVM "mapsize.sqf";
229-
DUWS_host_start = true;
230-
publicVariable "DUWS_host_start";
231-
232-
// init High Command
233-
_handle = [] execVM "dialog\hc_init.sqf";
234-
waitUntil {scriptDone getsize_script};
235-
};
84+
if (!isDedicated && !HQ_pos_found_generated) then { // SERVER INIT
85+
if (((vehiclevarname player) in game_master)) then {
86+
DUWS_host_start = false;
87+
publicVariable "DUWS_host_start";
88+
waitUntil {time > 0.1};
89+
getsize_script = [player] execVM "mapsize.sqf";
90+
DUWS_host_start = true;
91+
publicVariable "DUWS_host_start";
92+
93+
// init High Command
94+
_handle = [] execVM "dialog\hc_init.sqf";
95+
waitUntil {scriptDone getsize_script};
96+
};
97+
};
23698
};
23799

238-
if (isServer) then {
239-
_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
240-
waitUntil {chosen_hq_placement};
241-
242-
// create random HQ
243-
if (!hq_manually_placed && !player_is_choosing_hqpos) then {
244-
hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
245-
waitUntil {scriptDone hq_create};
246-
};
100+
if (!isDedicated && !HQ_pos_found_generated) then {
101+
if (((vehiclevarname player) in game_master)) then {
102+
_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
103+
waitUntil {chosen_hq_placement};
104+
player globalChat format ["hq_manually_placed: %1", hq_manually_placed];
105+
player globalChat format ["player_is_choosing_hqpos: %1", player_is_choosing_hqpos];
106+
// create random HQ
107+
if (!hq_manually_placed && !player_is_choosing_hqpos) then {
108+
player globalChat "lance recherche position...";
109+
hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
110+
waitUntil {scriptDone hq_create};
111+
};
112+
};
247113
};
248-
114+
249115
/*
250116
//////// DEBUG LOOP /////////////
251117
[] spawn {
@@ -272,7 +138,7 @@ if (isServer) then {
272138
] execVM 'repetitive_cleanup.sqf';
273139
};
274140

275-
if (!isServer) then {
141+
if (hasInterface) then {
276142
// WHEN CLIENT CONNECTS INIT (might need sleep)
277143
waitUntil {isPlayer Player};
278144
hintsilent "Waiting for the host to find an HQ...";
@@ -296,13 +162,9 @@ if (!isMultiplayer) then {
296162
_handle = [] execVM "dialog\hc_init.sqf";
297163
};
298164

299-
if (isServer) then {
300-
// initialise the ressources per zone bonus
301-
_basepoint = [] execVM "zonesundercontrol.sqf";
302-
};
303165

304-
// init the bonuses you get when capturing zones
305-
_basepoint = [] execVM "zones_bonus.sqf";
166+
167+
306168

307169
// INIT the operative list
308170
execVM "dialog\operative\operator_init.sqf";
@@ -359,11 +221,7 @@ if (isMultiplayer) then {
359221
["island_captured_win",true,true] call BIS_fnc_endMission;
360222
};
361223

362-
if (zones_manually_placed) then {
363-
waitUntil {!isNil ("Array_of_OPFOR_zones")};
364-
sleep 1;
365-
_warcom_init = [Array_of_OPFOR_zones, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 1500] execVM "WARCOM\WARCOM_init.sqf";
366-
};
224+
367225

368226
if (mission_DUWS_firstlaunch) then {
369227
waitUntil {chosen_settings};

source/WARCOM/WARCOM_blu_assault.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WARCOM_blu_attack_wave_avalaible = false;
66
// Type of attack wave
77
[] spawn {
88
//WARCOM_blu_attack_wave_type = ["B_Soldier_TL_F","B_Soldier_F"];
9-
9+
diag_log format ["WARCOM_blufor_ap_assault: %1", WARCOM_blufor_ap];
1010
waitUntil {sleep 1; WARCOM_blufor_ap>=10};
1111
[West,"HQ"] sidechat "This is HQ, BLUFOR troops just arrived on the island, we'll soon be able to push through the enemy lines";
1212
WARCOM_blu_attack_wave_avalaible = true;

source/WARCOM/WARCOM_blu_patrol.sqf

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
_loop = true;
22

33
WARCOM_blu_patrol_type = "";
4+
diag_log format ["WARCOM_blufor_ap_patrol: %1", WARCOM_blufor_ap];
45

56
// Type of attack wave
67
[] spawn {
8+
diag_log "spawn1";
79
WARCOM_blu_patrol_type = (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam");
810

911
waitUntil {sleep 1; WARCOM_blufor_ap>40};
@@ -36,25 +38,25 @@ WARCOM_blu_patrol_type = "";
3638

3739
while {true} do {
3840
if (count WARCOM_zones_controled_by_BLUFOR > 1) then { // make sure blufor is controlling at least 2 zones
39-
sleep 2;
40-
41-
// find a zone where to spawn OPF wave *** BEGIN
42-
_found = false;
43-
_randomZone = [];
44-
_failSafe = 0;
41+
sleep 2;
42+
43+
// find a zone where to spawn OPF wave *** BEGIN
44+
_found = false;
45+
_randomZone = [];
46+
_failSafe = 0;
4547
while {!_found} do {
46-
_randomZone = WARCOM_zones_controled_by_BLUFOR call BIS_fnc_selectRandom;
47-
if (_randomZone distance player > 2000) then {_found=true;};
48-
sleep 0.2;
48+
_randomZone = WARCOM_zones_controled_by_BLUFOR call BIS_fnc_selectRandom;
49+
if (_randomZone distance player > 2000) then {_found=true;};
50+
sleep 0.2;
4951
// player sidechat format["Failsafe: %1",_failsafe];
50-
_failSafe = _failSafe + 1;
51-
if (_failsafe > 10) then {sleep 300; _failsafe = 0;}
52+
_failSafe = _failSafe + 1;
53+
if (_failsafe > 10) then {sleep 300; _failsafe = 0;}
5254
};
5355
// find a zone *** end
54-
_randomZone = [(_randomZone select 0)+40,_randomZone select 1];
55-
_group = [_randomZone, WEST, WARCOM_blu_patrol_type,[],[],WARCOM_blu_ai_skill_range] call BIS_fnc_spawnGroup;
56-
_opf_assault = [_group] execVM "WARCOM\WARCOM_wp_blu_patrol.sqf";
57-
// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf";
56+
_randomZone = [(_randomZone select 0)+40,_randomZone select 1];
57+
_group = [_randomZone, WEST, WARCOM_blu_patrol_type,[],[],WARCOM_blu_ai_skill_range] call BIS_fnc_spawnGroup;
58+
_opf_assault = [_group] execVM "WARCOM\WARCOM_wp_blu_patrol.sqf";
59+
// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf";
5860

5961
// spawn armored
6062
if (WARCOM_blufor_ap>50) then {
@@ -69,3 +71,4 @@ WARCOM_blu_patrol_type = "";
6971
sleep (random 1200); // patrol delay
7072
};
7173
};
74+

source/WARCOM/WARCOM_init.sqf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,25 @@ _WARCOM_zones_controled_by_OPFOR = WARCOM_createdZones;
4444
WARCOM_zones_controled_by_OPFOR = [] + _WARCOM_zones_controled_by_OPFOR;
4545

4646
// Init BLU patrols
47+
diag_log "Init BLU patrols";
4748
_blu_patrol = [] execVM "WARCOM\WARCOM_blu_patrol.sqf";
48-
waitUntil {scriptDone _blu_patrol};
49+
//waitUntil {scriptDone _blu_patrol};
4950

5051
// Init OPF patrols
52+
diag_log "Init OPF patrols";
5153
_opf_patrol = [] execVM "WARCOM\WARCOM_opf_patrol.sqf";
52-
waitUntil {scriptDone _opf_patrol};
54+
//waitUntil {scriptDone _opf_patrol};
5355

5456
// Initialize the BLU attack waves
57+
diag_log "Initialize the BLU attack waves";
5558
_blu_assault = [] execVM "WARCOM\WARCOM_blu_assault.sqf";
56-
waitUntil {scriptDone _blu_assault};
59+
//waitUntil {scriptDone _blu_assault};
5760

5861

5962
// Init the OPF attack waves
63+
diag_log "Init the OPF attack waves";
6064
_opf_assault = [] execVM "WARCOM\WARCOM_opf_assault.sqf";
61-
waitUntil {scriptDone _opf_assault};
65+
//waitUntil {scriptDone _opf_assault};
6266

6367

6468

source/dialog/startup/startup_common.sqf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,17 @@ switch (_index) do {
387387
if (zones_max_radius <= zones_min_radius) exitWith {Hint "Unable to generate campaign:\nMaximum radius of a zone\nmust be superior to\nMinimum radius of a zone"};
388388

389389
zones_spacing = zones_max_radius + 200;
390+
publicVariable "chosen_settings";
391+
publicVariable "zones_max_radius";
392+
publicVariable "zones_min_radius";
393+
publicVariable "zones_number";
390394
publicVariable "commandpointsblu1";
391395
publicVariable "weather_type";
392396
publicVariable "blufor_ai_skill";
393397
publicVariable "opfor_ai_skill";
398+
publicVariable "opfor_ap";
399+
publicVariable "blufor_ap";
394400
publicVariable "enableChopperFastTravel";
401+
publicVariable "enable_fast_travel";
402+
publicVariable "zones_max_dist_from_hq";
403+

0 commit comments

Comments
 (0)