Skip to content

Commit e01649b

Browse files
committed
chance for modded vehicles to spawn
1 parent e303774 commit e01649b

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

addons/overthrow_main.pbo

572 Bytes
Binary file not shown.

addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ if((server getVariable "StartupType") == "NEW" || (server getVariable ["NATOvers
9999
if(_diff == 2) then {_numHVTs = 8};
100100

101101
//Find military objectives
102+
_groundvehs = OT_allBLUOffensiveVehicles select {!((_x isKindOf "Air") || (_x isKindOf "Tank") || (_x isKindOf "Ship"))};
102103
{
103104
_x params ["_pos","_name","_worth"];
104105
if !(_name in _abandoned) then {
@@ -115,8 +116,10 @@ if((server getVariable "StartupType") == "NEW" || (server getVariable ["NATOvers
115116
_base = 24;
116117
_statics = OT_NATO_StaticGarrison_LevelThree;
117118
};
119+
if((random 100) < ((count _groundvehs)+_base)) then {
120+
_statics pushbackUnique (selectRandom _groundvehs);
121+
};
118122
private _garrison = floor(_base + random(8));
119-
server setVariable [format ["vehgarrison%1",_name],+_statics,true];
120123

121124
if(_name isEqualTo OT_NATO_HQ) then {
122125
_garrison = 48;
@@ -137,6 +140,7 @@ if((server getVariable "StartupType") == "NEW" || (server getVariable ["NATOvers
137140
};
138141
}else{
139142
server setVariable [format ["airgarrison%1",_name],[],true];
143+
server setVariable [format ["vehgarrison%1",_name],_statics,true];
140144
};
141145
server setVariable [format ["garrison%1",_name],_garrison,true];
142146

@@ -177,13 +181,13 @@ if((server getVariable "StartupType") == "NEW" || (server getVariable ["NATOvers
177181
_x params ["_pos","_name","_worth"];
178182
if(_name != OT_NATO_HQ) then {
179183
_prilist pushback _name;
180-
if(_worth > 500) then {
184+
if(_worth > 900) then {
181185
_prilist pushback _name;
182186
};
183-
if(_worth > 800) then {
187+
if(_worth > 1200) then {
184188
_prilist pushback _name;
185189
};
186-
if(_worth > 1000) then {
190+
if(_worth > 2500) then {
187191
_prilist pushback _name;
188192
};
189193
};
@@ -201,13 +205,25 @@ if((server getVariable "StartupType") == "NEW" || (server getVariable ["NATOvers
201205
};
202206
}foreach(OT_NATO_Vehicles_AirGarrison);
203207

208+
//Distribute some random Air vehicles
209+
_airvehs = OT_allBLUOffensiveVehicles select {_x isKindOf "Air"};
210+
{
211+
_name = _x;
212+
if((random 100) < (count _airvehs)) then {
213+
_type = selectRandom _airvehs;
214+
private _garrison = server getVariable [format["airgarrison%1",_name],[]];
215+
_garrison pushback _type;
216+
server setVariable [format ["airgarrison%1",_name],_garrison,true];
217+
};
218+
}foreach(_prilist);
219+
204220
//Distribute static AA to airfields
205221
{
206-
_x params ["_pos","_name"];
222+
_name = _x;
207223
_vehs = server getVariable [format ["vehgarrison%1",_name],[]];
208224
_vehs = _vehs + OT_NATO_Vehicles_StaticAAGarrison;
209225
server setVariable [format ["vehgarrison%1",_name],_vehs,true];
210-
}foreach(OT_airportData);
226+
}foreach(_prilist);
211227

212228
diag_log "Overthrow: Setting up NATO checkpoints";
213229
{

addons/overthrow_main/functions/virtualization/spawners/fn_spawnNATOObjective.sqf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private _airgarrison = server getVariable [format["airgarrison%1",_name],[]];
216216
{
217217
private _vehtype = _x;
218218

219-
_pos = [_pos,42,_dir+90] call BIS_fnc_relPos;
219+
_pos = [_pos,20,_dir+90] call BIS_fnc_relPos;
220220

221221
private _veh = _vehtype createVehicle _pos;
222222
_veh setVariable ["airgarrison",_name,false];
@@ -233,14 +233,12 @@ private _road = objNull;
233233
_groups pushback _vgroup;
234234
private _vehtype = _x;
235235
private _got = false;
236-
private _pos = _posTown findEmptyPosition [10,100,_vehtype];
236+
private _pos = _posTown findEmptyPosition [25,250,_vehtype];
237237
private _dir = random 360;
238238

239-
_roads = _pos nearRoads 15;
240239
private _loops = 0;
241-
while {((count _roads) > 0) && (_loops < 50)} do {
242-
_pos = _posTown findEmptyPosition [15,150,_vehtype];
243-
_roads = _pos nearRoads 15;
240+
while {(isOnRoad _pos) && (_loops < 50)} do {
241+
_pos = _posTown findEmptyPosition [25,250,_vehtype];
244242
_loops = _loops + 1;
245243
};
246244

0 commit comments

Comments
 (0)