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) 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 // Settings for roaming ground vehicle AI
SC_maxNumberofVehicles = 4; 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 = [ SC_VehicleClassToUse = [
"Exile_Car_LandRover_Green", ["Exile_Car_LandRover_Green",0],
"Exile_Bike_QuadBike_Black", ["Exile_Bike_QuadBike_Black",2],
"Exile_Car_UAZ_Open_Green" ["Exile_Car_UAZ_Open_Green",2]
]; ];
SC_VehicleClassToUseRare = [ SC_VehicleClassToUseRare = [
"Exile_Car_Hunter", ["Exile_Car_Hunter",1],
"Exile_Car_HEMMT", ["Exile_Car_HEMMT",1],
"Exile_Car_Zamak", ["Exile_Car_Zamak",1],
"Exile_Car_Offroad_Armed_Guerilla12", ["Exile_Car_Offroad_Armed_Guerilla12",1],
"Exile_Car_Offroad_Armed_Guerilla03", ["Exile_Car_Offroad_Armed_Guerilla03",1],
"Exile_Car_Tempest" ["Exile_Car_Tempest",1]
]; ];
// Settings for roaming airborne AI (non armed helis will just fly around) // Settings for roaming airborne AI (non armed helis will just fly around)
SC_maxNumberofHelis = 1; SC_maxNumberofHelis = 1;
// Array of aircraft which can be used by AI patrols // 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" ]; SC_HeliClassToUse = [ ["Exile_Chopper_Huey_Armed_Green",0] ];
// Settings for roaming seaborne AI (non armed boats will just sail around) // Settings for roaming seaborne AI (non armed boats will just sail around)
SC_maxNumberofBoats = 1; 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 = [ SC_BoatClassToUse = [
"B_Boat_Armed_01_minigun_F", ["B_Boat_Armed_01_minigun_F",1],
"I_Boat_Armed_01_minigun_F", ["I_Boat_Armed_01_minigun_F",1],
"O_Boat_Transport_01_F", ["O_Boat_Transport_01_F",0],
"Exile_Boat_MotorBoat_Police" ["Exile_Boat_MotorBoat_Police",1]
]; ];
// Arrays of names used to generate names for AI // Arrays of names used to generate names for AI
@ -266,6 +266,8 @@ CIVILIAN setFriend[EAST,0];
CIVILIAN setFriend[WEST,0]; CIVILIAN setFriend[WEST,0];
EAST setFriend[CIVILIAN,0]; EAST setFriend[CIVILIAN,0];
WEST setFriend[CIVILIAN,0]; WEST setFriend[CIVILIAN,0];
EAST setFriend[WEST,0];
WEST setFriend[EAST,0];
SC_SurvivorSide = CIVILIAN; SC_SurvivorSide = CIVILIAN;
SC_BanditSide = EAST; SC_BanditSide = EAST;

View File

@ -2,7 +2,7 @@
// //
// Server Occupation script by second_coming // 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/ // http://www.exilemod.com/profile/60-second_coming/
// //

View File

@ -45,7 +45,23 @@ for "_i" from 1 to _vehiclesToSpawn do
private["_group"]; private["_group"];
_spawnLocation = [ 250, 0, 1, 1000, 1000, 1000, 1000, 1000, true, true ] call DMS_fnc_findSafePos; _spawnLocation = [ 250, 0, 1, 1000, 1000, 1000, 1000, 1000, true, true ] call DMS_fnc_findSafePos;
_group = createGroup SC_BanditSide; _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"]; _vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNull _vehicle) then 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]; _spawnLocation = [_safePos select 0, _safePos select 1, _height];
_group = createGroup SC_BanditSide; _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"]; _vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNull _vehicle) then if(!isNull _vehicle) then

View File

@ -119,13 +119,40 @@ if(_vehiclesToSpawn >= 1) then
_group setVariable ["DMS_SpawnedGroup",true]; _group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side]; _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 // Percentage chance to spawn a rare vehicle
_rareChance = round (random 100); _rareChance = round (random 100);
if(_rareChance >= 90) then 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; };
};
}; };