V60 Fixes & Tweaks

This commit is contained in:
second_coming 2016-08-15 12:34:38 +01:00
parent c6fee10125
commit 8cd1d19700
7 changed files with 52 additions and 77 deletions

View File

@ -1,3 +1,8 @@
=================================================================================
V60 (15-08-2016)
=================================================================================
Bug fixes and tweaks
================================================================================= =================================================================================
V59 (12-08-2016) V59 (12-08-2016)
================================================================================= =================================================================================

View File

@ -4,7 +4,7 @@ class CfgPatches
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = 0.1; requiredVersion = 0.1;
a3_exile_occupation_version = "V59 (12-08-2016)"; a3_exile_occupation_version = "V60 (15-08-2016)";
requiredAddons[] = {"a3_dms"}; requiredAddons[] = {"a3_dms"};
author[]= {"second_coming"}; author[]= {"second_coming"};
}; };

View File

@ -46,7 +46,7 @@ SC_occupyStatic = false; // true if you want to add AI in specifi
SC_occupyTransport = true; // true if you want pubic transport (travels between traders) SC_occupyTransport = true; // true if you want pubic transport (travels between traders)
SC_occupyLootCrates = true; // true if you want to have random loot crates with guards SC_occupyLootCrates = true; // true if you want to have random loot crates with guards
SC_occupyRandomSpawn = true; // (WORK IN PROGRESS) true if you want random spawning AI that hunt for nearby players SC_occupyRandomSpawn = true; // (WORK IN PROGRESS) true if you want random spawning AI that hunt for nearby players
SC_occupyMilitary = false; // true if you want military buildings patrolled SC_occupyMilitary = true; // true if you want military buildings patrolled
SC_occupyVehicle = true; // true if you want to have roaming AI land vehicles SC_occupyVehicle = true; // true if you want to have roaming AI land vehicles
SC_occupySky = true; // true if you want to have roaming AI helis SC_occupySky = true; // true if you want to have roaming AI helis
SC_occupySea = false; // true if you want to have roaming AI boats SC_occupySea = false; // true if you want to have roaming AI boats
@ -243,11 +243,11 @@ SC_maximumCrewAmount = 3; // Maximum amount of AI allowed in a vehi
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SC_maxNumberofVehicles = 3; // How many roaming vehicles to spawn SC_maxNumberofVehicles = 3; // How many roaming vehicles to spawn
SC_occupyVehicleIgnoreCount = true; // true if you want spawn vehicles regardless of overall AI count SC_occupyVehicleIgnoreCount = false; // true if you want spawn vehicles regardless of overall AI count
SC_occupyVehiclesLocked = false; // true if AI vehicles to stay locked until all the linked AI are dead SC_occupyVehiclesLocked = false; // true if AI vehicles to stay locked until all the linked AI are dead
SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option)
SC_occupyVehicleUseFixedPos = true; // True if you want to specify the patrol positions and radius of the area to patrol / false for random SC_occupyVehicleUseFixedPos = false; // True if you want to specify the patrol positions and radius of the area to patrol / false for random
// if you set SC_maxNumberofVehicles higher than the number of static positions, the remainder will be random // if you set SC_maxNumberofVehicles higher than the number of static positions, the remainder will be random
// they will also ignore any blacklisted areas // they will also ignore any blacklisted areas
@ -410,19 +410,20 @@ if (worldName == 'Namalsk' AND SC_useMapOverrides) then
if (worldName == 'Napf' AND SC_useMapOverrides) then if (worldName == 'Napf' AND SC_useMapOverrides) then
{ {
SC_maxAIcount = 160; SC_maxAIcount = 120;
SC_maxNumberofVehicles = 5; SC_maxNumberofVehicles = 5;
}; };
if (worldName == 'Chernarus' AND SC_useMapOverrides) then if (worldName == 'Chernarus' AND SC_useMapOverrides) then
{ {
SC_maxAIcount = 160; SC_maxAIcount = 120;
SC_maxNumberofVehicles = 5; SC_maxNumberofVehicles = 5;
}; };
if (worldName == 'Tanoa' AND SC_useMapOverrides) then if (worldName == 'Tanoa' AND SC_useMapOverrides) then
{ {
SC_useApexClasses = true; SC_useApexClasses = true;
}; };
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -458,18 +459,18 @@ if (SC_debug) then
SC_extendedLogging = true; SC_extendedLogging = true;
SC_processReporter = true; SC_processReporter = true;
SC_mapMarkers = true; SC_mapMarkers = true;
SC_occupyPlaces = false; SC_occupyPlaces = true;
SC_occupyVehicle = false; SC_occupyVehicle = true;
SC_occupyMilitary = false; SC_occupyMilitary = true;
SC_occupyRandomSpawn = true; SC_occupyRandomSpawn = true;
SC_occupyStatic = false; SC_occupyStatic = false;
SC_occupySky = false; SC_occupySky = true;
SC_occupySea = false; SC_occupySea = false;
SC_occupyTraders = false; SC_occupyTraders = true;
SC_occupyTransport = false; SC_occupyTransport = true;
SC_occupyLootCrates = false; SC_occupyLootCrates = true;
SC_occupyHeliCrashes = false; SC_occupyHeliCrashes = true;
SC_maxAIcount = 200; SC_maxAIcount = 100;
SC_maxNumberofVehicles = 5; SC_maxNumberofVehicles = 5;
SC_maxNumberofBoats = 5; SC_maxNumberofBoats = 5;
SC_maxNumberofHelis = 5; SC_maxNumberofHelis = 5;

View File

@ -16,7 +16,6 @@ if(SC_debug) then
}; };
// Select a replacement driver // Select a replacement driver
_vehicle removeAllMPEventHandlers "mphit";
_group = group _vehicle; _group = group _vehicle;
// Remove dead units from the group // Remove dead units from the group
@ -32,7 +31,6 @@ if(count units _group > 0) then
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
}; };
_groupMembers = units _group; _groupMembers = units _group;
_driver = _groupMembers call BIS_fnc_selectRandom; _driver = _groupMembers call BIS_fnc_selectRandom;
@ -69,4 +67,5 @@ else
_vehicle lock 0; _vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED"; _vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true]; _vehicle setVariable ["ExileIsLocked", 0, true];
[_vehicle] call SC_fnc_vehicleDestroyed;
}; };

View File

@ -2,7 +2,12 @@
// Attempts to get the current vehicle driver to repair the vehicle // Attempts to get the current vehicle driver to repair the vehicle
_vehicle = _this select 0; _vehicle = _this select 0;
_vehicle removeAllMPEventHandlers "mphit"; _repairStatus = _vehicle getVariable "SC_repairStatus";
if(_repairStatus) exitWith {};
// Mark the vehicle as currently being repaired
_vehicle setVariable ["SC_repairStatus",true];
_vehicleDamage = damage _vehicle; _vehicleDamage = damage _vehicle;
_damagedWheels = 0; _damagedWheels = 0;
@ -36,7 +41,6 @@ if(isNil "_assignedDriver") then
_assignedDriver setVariable ["SC_drivenVehicle", _vehicle,true]; _assignedDriver setVariable ["SC_drivenVehicle", _vehicle,true];
_assignedDriver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"]; _assignedDriver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
_vehicle setVariable ["SC_assignedDriver", _assignedDriver,true]; _vehicle setVariable ["SC_assignedDriver", _assignedDriver,true];
}; };
@ -67,13 +71,9 @@ if ((_vehicle getHitPointDamage "HitFuel") > 0) then { _fueltankDamage = true; }
if(_wheelDamage OR _engineDamage OR _fueltankDamage) then if(_wheelDamage OR _engineDamage OR _fueltankDamage) then
{
if(SC_extendedLogging) then
{ {
_logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 repairing vehicle at %1",time,_assignedDriver]; _logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 repairing vehicle at %1",time,_assignedDriver];
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
};
[_vehicle,_assignedDriver ] spawn [_vehicle,_assignedDriver ] spawn
{ {
@ -111,12 +111,9 @@ if(_wheelDamage OR _engineDamage OR _fueltankDamage) then
_driver assignAsDriver _vehicle; _driver assignAsDriver _vehicle;
_driver moveInDriver _vehicle; _driver moveInDriver _vehicle;
_driver action ["movetodriver", _vehicle]; _driver action ["movetodriver", _vehicle];
if(SC_extendedLogging) then
{
_logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 finished repairing vehicle %3 at %1",time,_driver,_vehicle]; _logDetail = format ["[OCCUPATION:repairVehicle]:: Unit %2 finished repairing vehicle %3 at %1",time,_driver,_vehicle];
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
}; };
};
_wp = _group addWaypoint [position _vehicle, 0] ; _wp = _group addWaypoint [position _vehicle, 0] ;
_wp setWaypointFormation "Column"; _wp setWaypointFormation "Column";
_wp setWaypointCompletionRadius 1; _wp setWaypointCompletionRadius 1;
@ -132,8 +129,9 @@ if(_wheelDamage OR _engineDamage OR _fueltankDamage) then
_group setCombatMode "RED"; _group setCombatMode "RED";
_driver enableAI "MOVE"; _driver enableAI "MOVE";
_driver enableAI "FSM"; _driver enableAI "FSM";
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_hitLand;"];
}; };
// Mark the vehicle as not currently being repaired
_vehicle setVariable ["SC_repairStatus",false];
} }
else else
{ {
@ -141,9 +139,4 @@ else
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
_logDetail = format ["[OCCUPATION:repairVehicle]:: Vehicle: %1 damage: %2 engine: %3 fuelTank: %4",_vehicle,_vehicleDamage,_engineDamage,_fueltankDamage]; _logDetail = format ["[OCCUPATION:repairVehicle]:: Vehicle: %1 damage: %2 engine: %3 fuelTank: %4",_vehicle,_vehicleDamage,_engineDamage,_fueltankDamage];
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
[] spawn
{
sleep 2;
};
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_hitLand;"];
}; };

View File

@ -6,11 +6,6 @@ _logDetail = format['[OCCUPATION:Vehicle] Started'];
// set the default side for bandit AI // set the default side for bandit AI
_side = "bandit"; _side = "bandit";
if(SC_occupyVehicleSurvivors) then
{
if(!isNil "DMS_Enable_RankChange") then { DMS_Enable_RankChange = true; };
};
// more than _scaleAI players on the server and the max AI count drops per additional player // more than _scaleAI players on the server and the max AI count drops per additional player
_currentPlayerCount = count playableUnits; _currentPlayerCount = count playableUnits;
_maxAIcount = SC_maxAIcount; _maxAIcount = SC_maxAIcount;
@ -34,36 +29,17 @@ if((_aiActive > _maxAIcount) && !SC_occupyVehicleIgnoreCount) exitWith
}; };
if(SC_liveVehicles >= SC_maxNumberofVehicles) exitWith if(SC_liveVehicles >= SC_maxNumberofVehicles) exitWith
{
if(SC_extendedLogging) then
{ {
_logDetail = format['[OCCUPATION:Vehicle] End check %1 currently active (max %2) @ %3',SC_liveVehicles,SC_maxNumberofVehicles,time]; _logDetail = format['[OCCUPATION:Vehicle] End check %1 currently active (max %2) @ %3',SC_liveVehicles,SC_maxNumberofVehicles,time];
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;
}; };
};
_vehiclesToSpawn = (SC_maxNumberofVehicles - SC_liveVehicles); _vehiclesToSpawn = (SC_maxNumberofVehicles - SC_liveVehicles);
if(SC_extendedLogging) then
{
if(_vehiclesToSpawn > 0) then
{
_logDetail = format['[OCCUPATION:Vehicle] Started %2 currently active (max %3) spawning %1 extra vehicle(s) @ %4',_vehiclesToSpawn,SC_liveVehicles,SC_maxNumberofVehicles,time];
[_logDetail] call SC_fnc_log;
}
else
{
_logDetail = format['[OCCUPATION:Vehicle] Started %2 currently active (max %3) @ %4',_vehiclesToSpawn,SC_liveVehicles,SC_maxNumberofVehicles,time];
[_logDetail] call SC_fnc_log;
};
};
_middle = worldSize/2; _middle = worldSize/2;
_spawnCenter = [_middle,_middle,0]; _spawnCenter = [_middle,_middle,0];
_maxDistance = _middle; _maxDistance = _middle;
if(_vehiclesToSpawn >= 1) then if(_vehiclesToSpawn > 0) then
{ {
if(SC_occupyVehicleSurvivors) then if(SC_occupyVehicleSurvivors) then
{ {
@ -89,7 +65,7 @@ if(_vehiclesToSpawn >= 1) then
{ {
{ {
_vehLocation = _x getVariable "SC_vehicleSpawnLocation"; _vehLocation = _x getVariable "SC_vehicleSpawnLocation";
_locationArray = _locationArray - _vehLocation; _locationArray = _locationArray - [_vehLocation];
}forEach SC_liveVehiclesArray; }forEach SC_liveVehiclesArray;
if(count _locationArray > 0) then if(count _locationArray > 0) then
@ -98,7 +74,7 @@ if(_vehiclesToSpawn >= 1) then
diag_log format["_randomLocation: %1",_randomLocation]; diag_log format["_randomLocation: %1",_randomLocation];
_spawnLocation = _randomLocation select 0; _spawnLocation = _randomLocation select 0;
_radius = _randomLocation select 1; _radius = _randomLocation select 1;
_locationArray = _locationArray - _randomLocation; _locationArray = _locationArray - [_randomLocation];
} }
else else
{ {
@ -120,7 +96,7 @@ if(_vehiclesToSpawn >= 1) then
_group = createGroup SC_SurvivorSide; _group = createGroup SC_SurvivorSide;
}; };
_group setVariable ["DMS_AllowFreezing",false]; _group setVariable ["DMS_AllowFreezing",false];
_group setVariable ["DMS_LockLocality",true]; _group setVariable ["DMS_LockLocality",false];
_group setVariable ["DMS_SpawnedGroup",true]; _group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side]; _group setVariable ["DMS_Group_Side", _side];
@ -171,6 +147,7 @@ if(_vehiclesToSpawn >= 1) then
SC_liveVehiclesArray = SC_liveVehiclesArray + [_vehicle]; SC_liveVehiclesArray = SC_liveVehiclesArray + [_vehicle];
_vehicle setVariable ["vehPos",_spawnLocation,true]; _vehicle setVariable ["vehPos",_spawnLocation,true];
_vehicle setVariable ["SC_repairStatus",false];
_vehicle setVariable ["vehClass",_VehicleClassToUse,true]; _vehicle setVariable ["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true]; _vehicle setVariable ["SC_vehicleSpawnLocation", [_spawnLocation,_radius,worldName],true];
_vehicle setFuel 1; _vehicle setFuel 1;