Skip to content

Commit 8a11f6e

Browse files
committed
Fixed artillery patrols, added config options
Random vehicle patrols did not check for artillery vehicles.
1 parent 306a87d commit 8a11f6e

File tree

3 files changed

+54
-40
lines changed

3 files changed

+54
-40
lines changed

source/DUWS_CONFIG.sqf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Blufor_Taxi_Helo = "B_Heli_Transport_01_camo_F";
8383
// Format: ["classname", amount]
8484
// classname can be of types: item, weapons, magazine
8585
// For more info, see https://community.bistudio.com/wiki/addItemCargo
86-
Blufor_Ammobox_Contents =
86+
Blufor_Ammobox_Contents =
8787
[
8888
["30Rnd_65x39_caseless_mag", 70],
8989
["30Rnd_65x39_caseless_mag_Tracer", 70],
@@ -144,7 +144,7 @@ Opfor_Faction = "OPF_F";
144144

145145
// Opfor Soldiers
146146
Opfor_Officer = "O_officer_F";
147-
Opfor_Squadleader = "O_Soldier_SL_F";
147+
Opfor_Squadleader = "O_Soldier_SL_F";
148148
Opfor_Teamleader = "O_Soldier_TL_F";
149149
Opfor_Medic = "O_medic_F";
150150
Opfor_Rifleman = "O_Soldier_F";
@@ -175,6 +175,12 @@ Opfor_WARCOM_Weapons_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F"
175175
Opfor_WARCOM_Mech_Inf_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInfSquad");
176176
Opfor_WARCOM_Mech_Wpn_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInf_AT");
177177

178+
// Indfor faction
179+
Indfor_Faction = "IND_F";
180+
181+
// Civilian faction
182+
Civilian_Faction = "CIV_F";
183+
178184
///////Special Operatives///////
179185
duws_operator_list=[
180186
[0.35,0.62,0.67,0.48,0.66,0.32,"Scout","Ready","Matthew 'Ghost' Norton","ghost","B_recon_F","H_Shemag_olive_hs",0,0],
@@ -216,4 +222,4 @@ duws_operator_list=[
216222
11: hat
217223
12: time before heal
218224
13: available spendable points
219-
*/
225+
*/

source/functions/WARCOM/fn_random_veh_opf_patrol.sqf

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,40 @@ _found = false;
1212

1313
_foundVeh = "";
1414
while {!_found} do {
15-
_checked_veh = _cfgVehicles select round (random _realentries); // RANDOMLY SELECT AN ENTRY
16-
_classname = configName _checked_veh;
17-
if (isClass _checked_veh) then { // CHECK IF THE SELECTED ENTRY IS A CLASS
18-
//hintSilent format["%1",_classname];
19-
sleep 0.005;
20-
_actual_vehclass = getText (_checked_veh >> "vehicleClass");
21-
_actual_faction = getText (_checked_veh >> "faction");
22-
_scope = getNumber (_checked_veh >> "scope"); // check if actually present in editor
23-
_simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute
24-
25-
26-
if (_actual_vehclass == _vehClass && _actual_faction == _faction && _scope != 0 && _simulation_paracheck != "parachute") exitWith {
27-
// hintSilent format["%1",_classname];
28-
// _veh = createVehicle [_classname, _position, [], 0, _vehClass];
29-
_foundVeh = _classname;
30-
_found = true;
31-
};
32-
};
33-
}; // --- VEHICLE FOUND --> _foundVeh
15+
// RANDOMLY SELECT AN ENTRY
16+
_checked_veh = _cfgVehicles select round (random _realentries);
17+
_classname = configName _checked_veh;
18+
19+
// CHECK IF THE SELECTED ENTRY IS A CLASS
20+
if (isClass _checked_veh) then {
21+
//hintSilent format["%1",_classname];
22+
sleep 0.005;
23+
_actual_vehclass = getText (_checked_veh >> "vehicleClass");
24+
_actual_faction = getText (_checked_veh >> "faction");
25+
_scope = getNumber (_checked_veh >> "scope"); // check if actually present in editor
26+
_simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute
27+
_artilleryScanner = getNumber (_checked_veh >> "artilleryScanner"); //Check if it is an artillery unit
28+
29+
if (_actual_vehclass == _vehClass
30+
&& _actual_faction == _faction
31+
&& _scope != 0
32+
&& _simulation_paracheck != "parachute"
33+
&& _artilleryScanner == 0) exitWith {
34+
35+
//hintSilent format["%1",_classname];
36+
//_veh = createVehicle [_classname, _position, [], 0, _vehClass];
37+
_foundVeh = _classname;
38+
_found = true;
39+
};
40+
};
41+
};// --- VEHICLE FOUND --> _foundVeh
3442

3543
// DETERMINE LA FACTION
36-
_side = EAST;
37-
if(_faction=="BLU_F") then {_side=WEST};
38-
if(_faction==Opfor_Faction) then {_side=EAST};
39-
if(_faction=="IND_F") then {_side=RESISTANCE};
40-
if(_faction=="CIV_F") then {_side=CIVILIAN};
44+
_side = EAST;
45+
if(_faction == Blufor_Faction) then {_side=WEST};
46+
if(_faction == Opfor_Faction) then {_side=EAST};
47+
if(_faction == Indfor_Faction) then {_side=RESISTANCE};
48+
if(_faction == Civilian_Faction) then {_side=CIVILIAN};
4149

4250
_createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle;
4351

source/functions/generic/fn_random_veh.sqf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ while {!_found} do {
2626
_simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute
2727
_artilleryScanner = getNumber (_checked_veh >> "artilleryScanner"); //Check if it is an artillery unit
2828

29-
if (_actual_vehclass == _vehClass
30-
&& _actual_faction == _faction
31-
&& _scope != 0
32-
&& _simulation_paracheck != "parachute"
33-
&& _artilleryScanner == 0) exitWith {
29+
if (_actual_vehclass == _vehClass
30+
&& _actual_faction == _faction
31+
&& _scope != 0
32+
&& _simulation_paracheck != "parachute"
33+
&& _artilleryScanner == 0) exitWith {
3434

3535
//hintSilent format["%1",_classname];
3636
//_veh = createVehicle [_classname, _position, [], 0, _vehClass];
3737
_foundVeh = _classname;
3838
_found = true;
3939
};
40-
};
40+
};
4141
};// --- VEHICLE FOUND --> _foundVeh
4242

43-
// DETERMINE LA FACTION
44-
_side = EAST;
45-
if(_faction=="BLU_F") then {_side=WEST};
46-
if(_faction==Opfor_Faction) then {_side=EAST};
47-
if(_faction=="IND_F") then {_side=RESISTANCE};
48-
if(_faction=="CIV_F") then {_side=CIVILIAN};
43+
// DETERMINE FACTION
44+
_side = EAST;
45+
if(_faction == Blufor_Faction) then {_side=WEST};
46+
if(_faction == Opfor_Faction) then {_side=EAST};
47+
if(_faction == Indfor_Faction) then {_side=RESISTANCE};
48+
if(_faction == Civilian_Faction) then {_side=CIVILIAN};
4949

5050
_createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle;
5151

@@ -56,4 +56,4 @@ _patrolRadius = round(_radius/2);
5656

5757
//_crews = _createdVehFnc select 1; //
5858
//_driver = _crews select 0; //DEBUG
59-
//addSwitchableUnit _driver; //
59+
//addSwitchableUnit _driver; //

0 commit comments

Comments
 (0)