V37 changes

This commit is contained in:
second_coming 2016-05-06 10:30:41 +01:00
parent 4c3bd98321
commit cb56ee0134
6 changed files with 88 additions and 22 deletions

View File

@ -1,3 +1,8 @@
=================================================================================
V37 (05-05-2016)
=================================================================================
Added limit checks for the amount of each class of vehicle in Sky, Sea and Vehicle modules
=================================================================================
V36 (05-05-2016)
=================================================================================

View File

@ -192,36 +192,36 @@ SC_maximumCrewAmount = 4; // Maximum amount of AI allowed in a vehicl
// Settings for roaming ground vehicle AI
SC_maxNumberofVehicles = 4;
// Array of ground vehicles which can be used by AI patrols
// Array of arrays of ground vehicles which can be used by AI patrols (the number next to next vehicle is the maximum amount of that class allowed, 0 for no limit)
SC_VehicleClassToUse = [
"Exile_Car_LandRover_Green",
"Exile_Bike_QuadBike_Black",
"Exile_Car_UAZ_Open_Green"
["Exile_Car_LandRover_Green",0],
["Exile_Bike_QuadBike_Black",2],
["Exile_Car_UAZ_Open_Green",2]
];
SC_VehicleClassToUseRare = [
"Exile_Car_Hunter",
"Exile_Car_HEMMT",
"Exile_Car_Zamak",
"Exile_Car_Offroad_Armed_Guerilla12",
"Exile_Car_Offroad_Armed_Guerilla03",
"Exile_Car_Tempest"
["Exile_Car_Hunter",1],
["Exile_Car_HEMMT",1],
["Exile_Car_Zamak",1],
["Exile_Car_Offroad_Armed_Guerilla12",1],
["Exile_Car_Offroad_Armed_Guerilla03",1],
["Exile_Car_Tempest",1]
];
// Settings for roaming airborne AI (non armed helis will just fly around)
SC_maxNumberofHelis = 1;
// Array of aircraft which can be used by AI patrols
SC_HeliClassToUse = [ "Exile_Chopper_Huey_Armed_Green" ];
// Array of aircraft which can be used by AI patrols (the number next to next vehicle is the maximum amount of that class allowed, 0 for no limit)
SC_HeliClassToUse = [ ["Exile_Chopper_Huey_Armed_Green",0] ];
// Settings for roaming seaborne AI (non armed boats will just sail around)
SC_maxNumberofBoats = 1;
// Array of boats which can be used by AI patrols
// Array of boats which can be used by AI patrols (the number next to next vehicle is the maximum amount of that class allowed, 0 for no limit)
SC_BoatClassToUse = [
"B_Boat_Armed_01_minigun_F",
"I_Boat_Armed_01_minigun_F",
"O_Boat_Transport_01_F",
"Exile_Boat_MotorBoat_Police"
["B_Boat_Armed_01_minigun_F",1],
["I_Boat_Armed_01_minigun_F",1],
["O_Boat_Transport_01_F",0],
["Exile_Boat_MotorBoat_Police",1]
];
// Arrays of names used to generate names for AI
@ -266,6 +266,8 @@ CIVILIAN setFriend[EAST,0];
CIVILIAN setFriend[WEST,0];
EAST setFriend[CIVILIAN,0];
WEST setFriend[CIVILIAN,0];
EAST setFriend[WEST,0];
WEST setFriend[EAST,0];
SC_SurvivorSide = CIVILIAN;
SC_BanditSide = EAST;

View File

@ -2,7 +2,7 @@
//
// Server Occupation script by second_coming
//
SC_occupationVersion = "v36 (05-05-2016)";
SC_occupationVersion = "v37 (06-05-2016)";
//
// http://www.exilemod.com/profile/60-second_coming/
//

View File

@ -45,7 +45,23 @@ for "_i" from 1 to _vehiclesToSpawn do
private["_group"];
_spawnLocation = [ 250, 0, 1, 1000, 1000, 1000, 1000, 1000, true, true ] call DMS_fnc_findSafePos;
_group = createGroup SC_BanditSide;
_VehicleClassToUse = SC_BoatClassToUse call BIS_fnc_selectRandom;
_VehicleClass = SC_BoatClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
boatOkToSpawn = false;
while{!boatOkToSpawn} do
{
_VehicleClass = SC_BoatClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
_VehicleClassAllowedCount = _VehicleClass select 1;
_vehicleCount = 0;
{
if(_VehicleClassToUse == typeOf _x) then { _vehicleCount = _vehicleCount + 1; };
}forEach SC_liveHelisArray;
if(_vehicleCount < _VehicleClassAllowedCount OR _VehicleClassAllowedCount == 0) then { boatOkToSpawn = true; };
};
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNull _vehicle) then

View File

@ -70,7 +70,23 @@ for "_i" from 1 to _vehiclesToSpawn do
_spawnLocation = [_safePos select 0, _safePos select 1, _height];
_group = createGroup SC_BanditSide;
_VehicleClassToUse = SC_HeliClassToUse call BIS_fnc_selectRandom;
_VehicleClass = SC_HeliClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
heliOkToSpawn = false;
while{!heliOkToSpawn} do
{
_VehicleClass = SC_HeliClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
_VehicleClassAllowedCount = _VehicleClass select 1;
_vehicleCount = 0;
{
if(_VehicleClassToUse == typeOf _x) then { _vehicleCount = _vehicleCount + 1; };
}forEach SC_liveHelisArray;
if(_vehicleCount < _VehicleClassAllowedCount OR _VehicleClassAllowedCount == 0) then { heliOkToSpawn = true; };
};
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNull _vehicle) then

View File

@ -119,13 +119,40 @@ if(_vehiclesToSpawn >= 1) then
_group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side];
_VehicleClassToUse = SC_VehicleClassToUse call BIS_fnc_selectRandom;
_VehicleClass = SC_VehicleClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
vehicleOkToSpawn = false;
// Percentage chance to spawn a rare vehicle
_rareChance = round (random 100);
if(_rareChance >= 90) then
{
_VehicleClassToUse = SC_VehicleClassToUseRare call BIS_fnc_selectRandom;
while{!vehicleOkToSpawn} do
{
_VehicleClass = SC_VehicleClassToUseRare call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
_VehicleClassAllowedCount = _VehicleClass select 1;
_vehicleCount = 0;
{
if(_VehicleClassToUse == typeOf _x) then { _vehicleCount = _vehicleCount + 1; };
}forEach SC_liveVehiclesArray;
if(_vehicleCount < _VehicleClassAllowedCount OR _VehicleClassAllowedCount == 0) then { vehicleOkToSpawn = true; };
};
}
else
{
while{!vehicleOkToSpawn} do
{
_VehicleClass = SC_VehicleClassToUse call BIS_fnc_selectRandom;
_VehicleClassToUse = _VehicleClass select 0;
_VehicleClassAllowedCount = _VehicleClass select 1;
_vehicleCount = 0;
{
if(_VehicleClassToUse == typeOf _x) then { _vehicleCount = _vehicleCount + 1; };
}forEach SC_liveVehiclesArray;
if(_vehicleCount < _VehicleClassAllowedCount OR _VehicleClassAllowedCount == 0) then { vehicleOkToSpawn = true; };
};
};