Skip to content

Commit 954edd2

Browse files
authored
Merge pull request #128 from ultranoobian/master
2 parents 803c1c9 + 5908b10 commit 954edd2

File tree

96 files changed

+1765
-6425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1765
-6425
lines changed

deployLocalBuild.ps1

1.53 KB
Binary file not shown.

source/INIT.sqf

Lines changed: 47 additions & 193 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
};
@@ -170,11 +27,9 @@ if (isMultiplayer) then {
17027
_revive_activated = paramsArray select 0; // Revives, true or false
17128
DUWSMP_CP_death_cost = paramsArray select 1;
17229
if (support_armory_available) then {
173-
hq_blu1 addaction ["<t color='#ff0066'>Armory 1 (VAS)</t>","VAS\open.sqf", "", 0, true, true, "", "_this == player"];
174-
hq_blu1 addaction ["<t color='#ff0066'>Armory 2 (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
30+
hq_blu1 addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
17531
{
176-
_x addaction ["<t color='#ff0066'>Armory 1 (VAS)</t>","VAS\open.sqf", "", 0, true, true, "", "_this == player"];
177-
_x addaction ["<t color='#ff0066'>Armory 2 (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
32+
_x addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
17833
} forEach (Array_of_FOBS);
17934
};
18035

@@ -185,11 +40,9 @@ if (isMultiplayer) then {
18540
}];
18641
"support_specialized_training_available" addPublicVariableEventHandler {lbSetColor [2103, 11, [0, 1, 0, 1]];};
18742
"support_armory_available" addPublicVariableEventHandler {
188-
hq_blu1 addaction ["<t color='#ff0066'>Armory 1 (VAS)</t>","VAS\open.sqf", "", 0, true, true, "", "_this == player"];
189-
hq_blu1 addaction ["<t color='#ff0066'>Armory 2 (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
43+
hq_blu1 addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
19044
{
191-
_x addaction ["<t color='#ff0066'>Armory 1 (VAS)</t>","VAS\open.sqf", "", 0, true, true, "", "_this == player"];
192-
_x addaction ["<t color='#ff0066'>Armory 2 (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
45+
_x addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
19346
} forEach (Array_of_FOBS);
19447
lbSetColor [2103, 5, [0, 1, 0, 1]];
19548
};
@@ -220,32 +73,41 @@ if (isMultiplayer) then {
22073
if (!isServer) then {
22174
"finishedMissionsNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_missions_total.sqf";}; // change the shown CP for request dialog
22275
};
76+
77+
player globalChat format ["gamemaster: %1", game_master];
78+
player globalChat format ["HQ_pos_found_generated: %1", HQ_pos_found_generated];
22379

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-
};
80+
if (!isDedicated && !HQ_pos_found_generated) then { // SERVER INIT
81+
if (((vehiclevarname player) in game_master)) then {
82+
DUWS_host_start = false;
83+
publicVariable "DUWS_host_start";
84+
waitUntil {time > 0.1};
85+
getsize_script = [player] execVM "mapsize.sqf";
86+
DUWS_host_start = true;
87+
publicVariable "DUWS_host_start";
88+
89+
// init High Command
90+
_handle = [] execVM "dialog\hc_init.sqf";
91+
waitUntil {scriptDone getsize_script};
92+
};
93+
};
23694
};
23795

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-
};
96+
if (!isDedicated && !HQ_pos_found_generated) then {
97+
if (((vehiclevarname player) in game_master)) then {
98+
_null = [] execVM "dialog\startup\hq_placement\placement.sqf";
99+
waitUntil {chosen_hq_placement};
100+
player globalChat format ["hq_manually_placed: %1", hq_manually_placed];
101+
player globalChat format ["player_is_choosing_hqpos: %1", player_is_choosing_hqpos];
102+
// create random HQ
103+
if (!hq_manually_placed && !player_is_choosing_hqpos) then {
104+
player globalChat "lance recherche position...";
105+
hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf";
106+
waitUntil {scriptDone hq_create};
107+
};
108+
};
247109
};
248-
110+
249111
/*
250112
//////// DEBUG LOOP /////////////
251113
[] spawn {
@@ -272,7 +134,7 @@ if (isServer) then {
272134
] execVM 'repetitive_cleanup.sqf';
273135
};
274136

275-
if (!isServer) then {
137+
if (hasInterface) then {
276138
// WHEN CLIENT CONNECTS INIT (might need sleep)
277139
waitUntil {isPlayer Player};
278140
hintsilent "Waiting for the host to find an HQ...";
@@ -296,13 +158,9 @@ if (!isMultiplayer) then {
296158
_handle = [] execVM "dialog\hc_init.sqf";
297159
};
298160

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

304-
// init the bonuses you get when capturing zones
305-
_basepoint = [] execVM "zones_bonus.sqf";
162+
163+
306164

307165
// INIT the operative list
308166
execVM "dialog\operative\operator_init.sqf";
@@ -359,11 +217,7 @@ if (isMultiplayer) then {
359217
["island_captured_win",true,true] call BIS_fnc_endMission;
360218
};
361219

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-
};
220+
367221

368222
if (mission_DUWS_firstlaunch) then {
369223
waitUntil {chosen_settings};

source/VAS/cfgfunctions.hpp

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)