V31 Roll Back

Problems with versions after this which caused out of memory errors
This commit is contained in:
second_coming 2016-05-04 09:57:54 +01:00
parent f5bf34af1b
commit 1c48de5f5e
23 changed files with 643 additions and 649 deletions

View File

@ -1,37 +0,0 @@
=================================================================================
V35 (03-05-2016)
=================================================================================
Fixed typo in an eventhandler
=================================================================================
V34 (03-05-2016)
=================================================================================
Altered a lot of the eventhandler in an attempt to stop the out of memory errors
=================================================================================
V33 (30-04-2016)
=================================================================================
Added server thread monitoring option for diagnosing server issues
=================================================================================
V32 (29-04-2016)
=================================================================================
Added checks for valide vehicles in Sky, Sea and Vehicle modules
=================================================================================
V28-V31 (27-04-2016)
=================================================================================
Altereed a few eventhandlers
Fixed multiple static spawns so they are independent of each other
=================================================================================
V27 (26-04-2016)
=================================================================================
Added the option fully control the gear assigned to bandit and survivor units
Added the option for helicopters as public transport, the heli travels between traders and lands for about 60 seconds. Setting SC_occupyTransportClass to a helicopter classname will switch it over to using a helicopter, if you want to continue using the land vehicle set SC_occupyTransportClass to a land vehicle.
Added the option to set the maximum crew (crew count will be a random number between the max and min). The applies for all AI vehicles.
Added a separate SC_VehicleClassToUseRare list of vehicles which spawn 10% of the time in place of the standard SC_VehicleClassToUse list.

View File

@ -13,9 +13,8 @@
// Shared Config for each occupation monitor
SC_debug = false; // set to true to turn on debug features (not for live servers)
SC_extendedLogging = false; // set to true for additional logging
SC_processReporter = true; // true if you want to log server threads every 60 seconds (useful to spot problems on the server)
SC_debug = false; // set to true to turn on debug features (not for live servers)
SC_extendedLogging = false; // set to true for additional logging
SC_infiSTAR_log = true; // true Use infiSTAR logging, false logs to server rpt
SC_maxAIcount = 100; // the maximum amount of AI, if the AI count is above this then additional AI won't spawn
SC_mapMarkers = false; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false

View File

@ -2,7 +2,7 @@
//
// Server Occupation script by second_coming
//
SC_occupationVersion = "v35 (03-05-2016)";
SC_occupationVersion = "v31 (04-05-2016) Roll back";
//
// http://www.exilemod.com/profile/60-second_coming/
//
@ -24,7 +24,7 @@ SC_occupationVersion = "v35 (03-05-2016)";
{
diag_log format ["[OCCUPATION]:: Occupation %2 Giving the server time to start before starting [OCCUPATION] (%1)",time,SC_occupationVersion];
waitUntil { !(isNil "DMS_MinMax_Y_Coords") };
sleep 10;
diag_log format ["[OCCUPATION MOD]:: Occupation %2 Loading Config at %1",time,SC_occupationVersion];

11
readme.txt Normal file
View File

@ -0,0 +1,11 @@
An AI spawner and monitor to be used in conjunction with DMS and will not work without it: http://www.exilemod.com/topic/61-dms-defents-mission-system/
Download the pbo version here: https://www.dropbox.com/s/dxy44l4mfu6ys53/a3_exile_occupation.pbo?dl=0
To install place the pbo into the @ExileServer/addons folder
For more info: http://www.exilemod.com/topic/12517-release-exile-occupation-roaming-ai
I do not give permission for anyone to sell or charge for the installation of any part of this set of scripts.
second_coming 2016

View File

@ -3,7 +3,25 @@ private["_newUniform","_newVest","_newHeadgear","_arrowClass"];
_side = _this select 0;
_unit = _this select 1;
if(_side == "survivor") then
_unit removeAllMPEventHandlers "mphit";
switch (_side) do
{
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
case "survivor":
{
_arrowClass = "Sign_Arrow_Green_F";
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
};
case "bandit":
{
_arrowClass = "Sign_Arrow_F";
};
};
if(SC_debug) then
{
_tag = createVehicle [_arrowClass, position _unit, [], 0, "CAN_COLLIDE"];
_tag attachTo [_unit,[0,0,0.6],"Head"];
};
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];

View File

@ -24,7 +24,7 @@ switch (_side) do
for "_i" from 1 to _amountOfMagazines do
{
_newMagazine = SC_SurvivorMagazines call BIS_fnc_selectRandom;
_quantity = 1;
_quantity = 1 + round random (2);
_magazines pushBack [_newMagazine,_quantity];
};
};
@ -63,7 +63,7 @@ _pistolAttachmentsChance = round (random 100);
if(_pistolAttachmentsChance < 50) then { _pistolAttachments = [""]; };
_backpackChance = round (random 100);
if(_backpackChance < 20) then { _backpack = ""; };
if(_backpackChance < 40) then { _backpack = ""; };
_launcherChance = round (random 100);
if(_launcherChance < 40 OR isNil "_launcher") then { _launcher = ""; };

View File

@ -2,9 +2,7 @@
_logDetail = _this select 0;
if(isNil "INFISTARVERSION") then { SC_infiSTAR_log = false; };
if(SC_infiSTAR_log) then
if(SC_infiSTAR_log && !isNil "INFISTARVERSION") then
{
['A3_EXILE_OCCUPATION',_logDetail] call FNC_A3_CUSTOMLOG;
}

View File

@ -2,52 +2,35 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time];
[_logDetail] call SC_fnc_log;
{
if(!isNull _x) then
_logDetail = format ["[OCCUPATION:Unstick]:: Air: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
sleep 5;
_originalSpawnLocation = _x getVariable "SC_vehicleSpawnLocation";
_pos = position _x;
_nearestMarker = [allMapMarkers, _pos] call BIS_fnc_nearestPosition; // Nearest Marker to the Location
_posNearestMarker = getMarkerPos _nearestMarker;
if(_pos distance _posNearestMarker < 750) then
{
_logDetail = format ["[OCCUPATION:Unstick]:: Air: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}
else
{
SC_liveHelis = SC_liveHelis - 1;
SC_liveHelisArray = SC_liveHelisArray - [_x];
};
_GroupLeader = leader (group _x);
_GroupLeader doMove _originalSpawnLocation;
};
}forEach SC_liveHelisArray;
{
if(!isNull _x) then
{
_logDetail = format ["[OCCUPATION:Unstick]:: Land: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}
else
{
SC_liveVehicles = SC_liveVehicles - 1;
SC_liveVehiclesArray = SC_liveVehiclesArray - [_x];
};
_logDetail = format ["[OCCUPATION:Unstick]:: Land: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}forEach SC_liveVehiclesArray;
{
if(!isNull _x) then
{
_logDetail = format ["[OCCUPATION:Unstick]:: Sea: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}
else
{
SC_liveBoats = SC_liveBoats - 1;
SC_liveBoatsArray = SC_liveBoatsArray - [_x];
};
_logDetail = format ["[OCCUPATION:Unstick]:: Sea: %1 is active",_x];
[_logDetail] call SC_fnc_log;
_x setFuel 1;
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}forEach SC_liveBoatsArray;

View File

@ -44,162 +44,153 @@ 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;
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
_vehicle setPosASL _spawnLocation;
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
if(!isNil "_vehicle") then
// Remove the overpowered weapons from boats
_vehicle removeWeaponTurret ["HMG_01",[0]];
_vehicle removeWeaponTurret ["GMG_40mm",[0]];
SC_liveBoats = SC_liveBoats + 1;
SC_liveBoatsArray = SC_liveBoatsArray + [_vehicle];
_vehicle setVehiclePosition [_spawnLocation, [], 0, "NONE"];
_vehicle setVariable ["vehicleID", _spawnLocation, true];
_vehicle setFuel 1;
_vehicle setDamage 0;
_vehicle engineOn true;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
_vehicle action ["LightOn", _vehicle];
sleep 0.2;
_group addVehicle _vehicle;
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_group = createGroup SC_BanditSide;
_vehicle setPosASL _spawnLocation;
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
// Remove the overpowered weapons from boats
_vehicle removeWeaponTurret ["HMG_01",[0]];
_vehicle removeWeaponTurret ["GMG_40mm",[0]];
SC_liveBoats = SC_liveBoats + 1;
SC_liveBoatsArray = SC_liveBoatsArray + [_vehicle];
_vehicle setVehiclePosition [_spawnLocation, [], 0, "NONE"];
_vehicle setVariable ["vehicleID", _spawnLocation, true];
_vehicle setFuel 1;
_vehicle setDamage 0;
_vehicle engineOn true;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
_vehicle action ["LightOn", _vehicle];
sleep 0.2;
_group addVehicle _vehicle;
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "Turret") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "Turret") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
} forEach _vehicleRoles;
{
_unit = _x;
[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
}foreach units _group;
if(SC_infiSTAR_log) then
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sea] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation];
_logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
};
} forEach _vehicleRoles;
{
_unit = _x;
[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
}foreach units _group;
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
if(SC_infiSTAR_log) then
{
_logDetail = format['[OCCUPATION:Sea] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation];
[_logDetail] call SC_fnc_log;
};
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"srifle_DMR_01_F",
"srifle_DMR_02_camo_F",
"srifle_DMR_02_F",
"srifle_DMR_02_sniper_F",
"srifle_DMR_03_F",
"srifle_DMR_03_khaki_F",
"srifle_DMR_03_multicam_F",
"srifle_DMR_03_tan_F",
"srifle_DMR_03_woodland_F",
"srifle_DMR_04_F",
"srifle_DMR_04_Tan_F",
"srifle_DMR_05_blk_F",
"srifle_DMR_05_hex_F",
"srifle_DMR_05_tan_f",
"srifle_DMR_06_camo_F",
"srifle_DMR_06_olive_F",
"srifle_EBR_F",
"srifle_GM6_camo_F",
"srifle_GM6_F",
"srifle_LRR_camo_F",
"srifle_LRR_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
[_group, _spawnLocation, 4000] call bis_fnc_taskPatrol;
_group setBehaviour "AWARE";
_group setCombatMode "RED";
_vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_boatHit;"];
_vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2;
}
else
{
_logDetail = format['[OCCUPATION:Sea] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
};
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"srifle_DMR_01_F",
"srifle_DMR_02_camo_F",
"srifle_DMR_02_F",
"srifle_DMR_02_sniper_F",
"srifle_DMR_03_F",
"srifle_DMR_03_khaki_F",
"srifle_DMR_03_multicam_F",
"srifle_DMR_03_tan_F",
"srifle_DMR_03_woodland_F",
"srifle_DMR_04_F",
"srifle_DMR_04_Tan_F",
"srifle_DMR_05_blk_F",
"srifle_DMR_05_hex_F",
"srifle_DMR_05_tan_f",
"srifle_DMR_06_camo_F",
"srifle_DMR_06_olive_F",
"srifle_EBR_F",
"srifle_GM6_camo_F",
"srifle_GM6_F",
"srifle_LRR_camo_F",
"srifle_LRR_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
[_group, _spawnLocation, 4000] call bis_fnc_taskPatrol;
_group setBehaviour "AWARE";
_group setCombatMode "RED";
_vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_boatHit;"];
_vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2;
};
_logDetail = format['[OCCUPATION:Sea] Running'];
[_logDetail] call SC_fnc_log;

View File

@ -68,162 +68,155 @@ for "_i" from 1 to _vehiclesToSpawn do
_safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos;
_height = 350 + (round (random 200));
_spawnLocation = [_safePos select 0, _safePos select 1, _height];
_group = createGroup SC_BanditSide;
_VehicleClassToUse = SC_HeliClassToUse call BIS_fnc_selectRandom;
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNil "_vehicle") then
{
_group = createGroup SC_BanditSide;
_group addVehicle _vehicle;
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
_group addVehicle _vehicle;
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
SC_liveHelis = SC_liveHelis + 1;
SC_liveHelisArray = SC_liveHelisArray + [_vehicle];
SC_liveHelis = SC_liveHelis + 1;
SC_liveHelisArray = SC_liveHelisArray + [_vehicle];
_vehicle setVehiclePosition [_spawnLocation, [], 0, "FLY"];
_vehicle setVariable ["vehicleID", _spawnLocation, true];
_vehicle setFuel 1;
_vehicle setDamage 0;
_vehicle engineOn true;
_vehicle flyInHeight 150;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
_vehicle action ["LightOn", _vehicle];
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
//_vehicle lockDriver true;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "Turret") then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(SC_extendedLogging) then
{
_logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
} forEach _vehicleRoles;
_vehicle setVehiclePosition [_spawnLocation, [], 0, "FLY"];
_vehicle setVariable ["vehicleID", _spawnLocation, true];
_vehicle setFuel 1;
_vehicle setDamage 0;
_vehicle engineOn true;
_vehicle flyInHeight 150;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
_vehicle action ["LightOn", _vehicle];
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
//_vehicle lockDriver true;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "Turret") then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_loadOut = ["bandit"] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random","bandit","Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(SC_extendedLogging) then
{
_logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
} forEach _vehicleRoles;
{
_unit = _x;
[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
}foreach units _group;
{
_unit = _x;
[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
}foreach units _group;
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sky] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation];
[_logDetail] call SC_fnc_log;
};
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"srifle_DMR_01_F",
"srifle_DMR_02_camo_F",
"srifle_DMR_02_F",
"srifle_DMR_02_sniper_F",
"srifle_DMR_03_F",
"srifle_DMR_03_khaki_F",
"srifle_DMR_03_multicam_F",
"srifle_DMR_03_tan_F",
"srifle_DMR_03_woodland_F",
"srifle_DMR_04_F",
"srifle_DMR_04_Tan_F",
"srifle_DMR_05_blk_F",
"srifle_DMR_05_hex_F",
"srifle_DMR_05_tan_f",
"srifle_DMR_06_camo_F",
"srifle_DMR_06_olive_F",
"srifle_EBR_F",
"srifle_GM6_camo_F",
"srifle_GM6_F",
"srifle_LRR_camo_F",
"srifle_LRR_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "AWARE";
_group setCombatMode "RED";
_vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"];
_vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2;
}
else
{
_logDetail = format['[OCCUPATION:Sky] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sky] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation];
[_logDetail] call SC_fnc_log;
};
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"srifle_DMR_01_F",
"srifle_DMR_02_camo_F",
"srifle_DMR_02_F",
"srifle_DMR_02_sniper_F",
"srifle_DMR_03_F",
"srifle_DMR_03_khaki_F",
"srifle_DMR_03_multicam_F",
"srifle_DMR_03_tan_F",
"srifle_DMR_03_woodland_F",
"srifle_DMR_04_F",
"srifle_DMR_04_Tan_F",
"srifle_DMR_05_blk_F",
"srifle_DMR_05_hex_F",
"srifle_DMR_05_tan_f",
"srifle_DMR_06_camo_F",
"srifle_DMR_06_olive_F",
"srifle_EBR_F",
"srifle_GM6_camo_F",
"srifle_GM6_F",
"srifle_LRR_camo_F",
"srifle_LRR_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "AWARE";
_group setCombatMode "RED";
_vehicle addEventHandler ["getin", "_this call SC_fnc_claimVehicle;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"];
_vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2;
};

View File

@ -103,11 +103,22 @@ if(_vehiclesToSpawn >= 1) then
_pos = [_position,10,250,5,0,20,0] call BIS_fnc_findSafePos;
// Get position of nearest roads
_nearRoads = _pos nearRoads 2000;
_nearRoads = _pos nearRoads 500;
_nearestRoad = _nearRoads select 0;
_nearestRoad = position (_nearRoads select 0);
_spawnLocation = [_nearestRoad select 0, _pos select 1, 0];
_group = createGroup SC_BanditSide;
if(_side == "survivor") then
{
deleteGroup _group;
_group = createGroup SC_SurvivorSide;
};
_group setVariable ["DMS_LockLocality",nil];
_group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side];
_VehicleClassToUse = SC_VehicleClassToUse call BIS_fnc_selectRandom;
// Percentage chance to spawn a rare vehicle
@ -119,170 +130,154 @@ if(_vehiclesToSpawn >= 1) then
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
_group addVehicle _vehicle;
SC_liveVehicles = SC_liveVehicles + 1;
SC_liveVehiclesArray = SC_liveVehiclesArray + [_vehicle];
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
_vehicle setFuel 1;
_vehicle engineOn true;
if(!isNil "_vehicle") then
if(SC_occupyVehiclesLocked) then
{
_group = createGroup SC_BanditSide;
if(_side == "survivor") then
{
deleteGroup _group;
_group = createGroup SC_SurvivorSide;
};
_group setVariable ["DMS_LockLocality",nil];
_group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side];
_group addVehicle _vehicle;
SC_liveVehicles = SC_liveVehicles + 1;
SC_liveVehiclesArray = SC_liveVehiclesArray + [_vehicle];
_vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true];
_vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
_vehicle setFuel 1;
_vehicle engineOn true;
if(SC_occupyVehiclesLocked) then
{
_vehicle lock 2;
_vehicle setVehicleLock "LOCKED";
_vehicle setVariable ["ExileIsLocked", 1, true];
}
else
{
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
};
_vehicle setSpeedMode "LIMITED";
_vehicle limitSpeed 60;
_vehicle action ["LightOn", _vehicle];
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit disableAI "FSM";
[_side,_unit] call SC_fnc_addMarker;
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mpkilled";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit disableAI "AUTOCOMBAT";
_unit disableAI "COVER";
_unit disableAI "SUPPRESSION";
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit setVariable ["SC_drivenVehicle", _vehicle,true];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
_vehicle setVariable ["SC_assignedDriver", _unit,true];
_vehicle addEventHandler ["getin", "_this call SC_fnc_getIn;"];
_vehicle addEventHandler ["getout", "_this call SC_fnc_getOut;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"];
};
if(_vehicleRole == "Turret" && _amountOfCrew < _crewRequired) then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
[_side,_unit] call SC_fnc_addMarker;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
[_side,_unit] call SC_fnc_addMarker;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
_unitPlaced = true;
};
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Vehicle] %1 %2 added to vehicle %3',_side,_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
if(_amountOfCrew == _crewRequired) exitWith{};
} forEach _vehicleRoles;
// Get the AI to shut the fuck up :)
enableSentences false;
enableRadio false;
_logDetail = format['[OCCUPATION:Vehicle] %3 vehicle %1 spawned @ %2',_VehicleClassToUse,_spawnLocation,_side];
[_logDetail] call SC_fnc_log;
sleep 15;
{
_x enableAI "FSM";
}forEach units _group;
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "SAFE";
_group setCombatMode "RED";
sleep 0.2;
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"arifle_MX_SW_Black_F",
"arifle_MX_SW_F",
"LMG_Mk200_F",
"LMG_Zafir_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
_vehicle lock 2;
_vehicle setVehicleLock "LOCKED";
_vehicle setVariable ["ExileIsLocked", 1, true];
}
else
{
_logDetail = format['[OCCUPATION:Vehicle] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
};
_vehicle setSpeedMode "LIMITED";
_vehicle limitSpeed 60;
_vehicle action ["LightOn", _vehicle];
// Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
{
_crewRequired = floor(random[SC_minimumCrewAmount,SC_maximumCrewAmount-SC_minimumCrewAmount,SC_maximumCrewAmount]);
};
_amountOfCrew = 0;
_unitPlaced = false;
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit disableAI "FSM";
[_side,_unit] call SC_fnc_addMarker;
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mpkilled";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit disableAI "AUTOCOMBAT";
_unit disableAI "COVER";
_unit disableAI "SUPPRESSION";
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit setVariable ["SC_drivenVehicle", _vehicle,true];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
_vehicle setVariable ["SC_assignedDriver", _unit,true];
_vehicle addEventHandler ["getin", "_this call SC_fnc_getIn;"];
_vehicle addEventHandler ["getout", "_this call SC_fnc_getOut;"];
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"];
};
if(_vehicleRole == "Turret" && _amountOfCrew < _crewRequired) then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
[_side,_unit] call SC_fnc_addMarker;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO" && _amountOfCrew < _crewRequired) then
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_group,_spawnLocation,"custom","random",_side,"Vehicle",_loadOut] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
[_side,_unit] call SC_fnc_addMarker;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
_unitPlaced = true;
};
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Vehicle] %1 %2 added to vehicle %3',_side,_vehicleRole,_vehicle];
[_logDetail] call SC_fnc_log;
};
if(_amountOfCrew == _crewRequired) exitWith{};
} forEach _vehicleRoles;
// Get the AI to shut the fuck up :)
enableSentences false;
enableRadio false;
_logDetail = format['[OCCUPATION:Vehicle] %3 vehicle %1 spawned @ %2',_VehicleClassToUse,_spawnLocation,_side];
[_logDetail] call SC_fnc_log;
sleep 15;
{
_x enableAI "FSM";
}forEach units _group;
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "SAFE";
_group setCombatMode "RED";
sleep 0.2;
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
_vehicle addMagazineCargoGlobal ["HandGrenade", (random 2)];
_vehicle addItemCargoGlobal ["ItemGPS", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_vehicle addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_vehicle addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
// Add weapons with ammo to the vehicle
_possibleWeapons =
[
"arifle_MXM_Black_F",
"arifle_MXM_F",
"arifle_MX_SW_Black_F",
"arifle_MX_SW_F",
"LMG_Mk200_F",
"LMG_Zafir_F"
];
_amountOfWeapons = 1 + (random 3);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_vehicle addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
};
};
};

View File

@ -1,31 +0,0 @@
if(!isNil "INFISTARVERSION") then
{
_logDetail = "=======================================================================================================";
['A3_EXILE_PROCESSREPORTER',_logDetail] call FNC_A3_CUSTOMLOG;
_logDetail = format['[processReporter] Started @ %4 : [FPS: %1|PLAYERS: %2|THREADS: %3]',diag_fps,count allplayers,count diag_activeSQFScripts,time];
['A3_EXILE_PROCESSREPORTER',_logDetail] call FNC_A3_CUSTOMLOG;
_logDetail = "=======================================================================================================";
['A3_EXILE_PROCESSREPORTER',_logDetail] call FNC_A3_CUSTOMLOG;
{
_logDetail = format ["[processReporter] %1 @ %2",_x,time];
['A3_EXILE_PROCESSREPORTER',_logDetail] call FNC_A3_CUSTOMLOG;
} forEach diag_activeSQFScripts;
_logDetail = format ["[processReporter] Ended @ %1",time];
['A3_EXILE_PROCESSREPORTER',_logDetail] call FNC_A3_CUSTOMLOG;
}
else
{
diag_log "=======================================================================================================";
diag_log format['[processReporter] Started @ %4 : [FPS: %1|PLAYERS: %2|THREADS: %3]',diag_fps,count allplayers,count diag_activeSQFScripts,time];
diag_log "=======================================================================================================";
{
diag_log format ["[processReporter] %1 @ %2",_x,time];
} forEach diag_activeSQFScripts;
diag_log format ["[processReporter] Ended @ %1",time];
};

View File

@ -16,7 +16,31 @@ if(SC_extendedLogging) then
};
_ejectChance = round (random 100) + (_heliDamage * 100);
if(_heliDamage > 0.2 && !_crewEjected && _ejectChance > 100) then
_essentials = [ "HitAvionics","HitEngine1","HitEngine2","HitEngine","HitHRotor","HitVRotor","HitTransmission",
"HitHydraulics","HitGear","HitHStabilizerL1","HitHStabilizerR1","HitVStabilizer1","HitFuel"];
_damagedEssentials = 0;
{
if ((_heli getHitPointDamage _x) > 0) then
{
if(_x == "HitFuel" && _heliDamage < 1) then
{
_heli setHitPointDamage ["HitFuel", 0];
_heli setFuel 1;
};
_damage = _heli getHitPointDamage _x;
if(SC_extendedLogging) then
{
_logDetail = format ["[OCCUPATION:Sky]:: Heli %1 checking part %2 (damage: %4) @ %3",_heli, _x, time,_damage];
[_logDetail] call SC_fnc_log;
};
if(_damage > 0) then { _damagedEssentials = _damagedEssentials + 1; };
};
} forEach _essentials;
if(_heliDamage > 0.2 && _damagedEssentials > 0 && !_crewEjected && _ejectChance > 100) then
{
_target = _this select 1;
[_heli, _target] spawn
@ -57,10 +81,9 @@ if(_heliDamage > 0.2 && !_crewEjected && _ejectChance > 100) then
};
if(_heliDamage > 0.7) then
if(_heliDamage > 0.7 && _damagedEssentials > 0) then
{
_heli = _this select 0;
if(SC_extendedLogging) then
if(SC_extendedLogging) then
{
_logDetail = format ["[OCCUPATION:Sky]:: Air unit %2 damaged and force landing at %3 (time: %1)",time,_this select 0,_this select 1,_heliPosition];
[_logDetail] call SC_fnc_log;
@ -86,14 +109,11 @@ if(_heliDamage > 0.7) then
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointCompletionRadius 10;
_wp setWaypointType "TR UNLOAD";
_wp setWaypointType "GETOUT";
[_group2, _destination, 250] call bis_fnc_taskPatrol;
_group2 setBehaviour "COMBAT";
_group2 setCombatMode "RED";
};
if(_heliDamage <= 0.7) then
{
_heli addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"];
};
_heli addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"];

View File

@ -33,11 +33,6 @@ if(count(crew _vehicle) > 0)then
_vehicle setVectorUp [0,0,1];
_originalSpawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation";
if(isNil "_originalSpawnLocation") then
{
_originalSpawnLocation = [_curPos, 50, 1000, 3, 2, 20, 0] call BIS_fnc_findSafePos;
};
_group = group _vehicle;
_vehClass = typeOf _vehicle;
@ -73,14 +68,17 @@ if(count(crew _vehicle) > 0)then
_vehicle setVariable["vehPos",_newPos];
};
// Remove dead units from the group
_group = group _vehicle;
// Remove dead units from the group
{
if(!alive _x) then { [_x] join grpNull; };
}forEach units _group;
if(count units _group < 1) then
if(count units _group > 0) then
{
_vehicle call SC_fnc_vehicleDestroyed;
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
};

View File

@ -50,6 +50,12 @@ if(count units _group > 0) then
_driver removeAllMPEventHandlers "mphit";
_driver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
if(SC_debug) then
{
_tag = createVehicle ["Sign_Arrow_Yellow_F", position _driver, [], 0, "CAN_COLLIDE"];
_tag attachTo [_driver,[0,0,0.6],"Head"];
};
_driver doMove (position _vehicle);
_driver action ["movetodriver", _vehicle];

View File

@ -1,11 +1,11 @@
// Triggered if a player gets in a captured AI vehicle
// Marks the vehicle as claimed by a player and frees up a slot to spawn another AI controlled vehicle
_vehicle = _this select 0;
_unit = _this select 2;
_unit = _this select 0;
if(isPlayer _unit) then
{
_vehicle = vehicle _unit;
[_vehicle] call SC_fnc_vehicleDestroyed;
if(SC_extendedLogging) then
@ -16,6 +16,12 @@ if(isPlayer _unit) then
}
else
{
if(SC_debug) then
{
{ deleteVehicle _x; } forEach attachedObjects _unit;
};
if(damage _vehicle > 0) then
{
[_vehicle] call SC_fnc_repairVehicle;

View File

@ -0,0 +1,32 @@
// Triggered if an AI unit leaves an AI vehicle
_unit = _this select 0;
_vehicle = _this select 2;
_driver = _vehicle getVariable "SC_assignedDriver";
_arrowClass = "Sign_Arrow_F";
if(!alive _unit) exitWith {};
if(side _unit == SC_SurvivorSide) then
{
_arrowClass = "Sign_Arrow_Green_F";
}
else
{
_arrowClass = "Sign_Arrow_F";
};
if(_unit == _driver) then
{
_arrowClass = "Sign_Arrow_Yellow_F";
};
if(SC_debug && alive _unit && vehicle _unit != _unit) then
{
_tag = createVehicle [_arrowClass, position _unit, [], 0, "CAN_COLLIDE"];
_tag attachTo [_unit,[0,0,0.6],"Head"];
}
else
{
{ deleteVehicle _x; } forEach attachedObjects _unit;
};

View File

@ -0,0 +1,18 @@
// Triggered when a vehicle runs out of fuel but only if not damaged
_vehicle = _this select 0;
_fuel = _this select 1;
diag_log format["[OCCUPATION:refuelcheck] _vehicle: %1 ---- _fuel: %2 ",_vehicle,_fuel];
/*
if(!isNil "_vehicle" && !isNil "_fuel") then
{
_damage = getdammage _vehicle;
if(_damage <> 0 && !_fuel) then
{
_vehicle setFuel 1;
_vehicle engineOn true;
};
};
*/

View File

@ -64,29 +64,28 @@ if(_damagedWheels > 0 OR _engineDamage OR _fueltankDamage) then
_driver playMoveNow "Acts_carFixingWheel";
sleep 8;
_driver switchMove "";
if(!alive _driver) exitWith{};
_driver playMoveNow "Acts_carFixingWheel";
sleep 2;
_vehicle setDamage 0;
_driver switchMove "";
_driver assignAsDriver _vehicle;
_driver moveInDriver _vehicle;
_driver action ["movetodriver", _vehicle];
if(alive _driver) then
{
_vehicle setDamage 0;
_driver playMoveNow "Acts_carFixingWheel";
sleep 2;
_driver switchMove "";
_driver assignAsDriver _vehicle;
_driver moveInDriver _vehicle;
_driver action ["movetodriver", _vehicle];
};
_wp = _group addWaypoint [position _vehicle, 0] ;
_wp setWaypointFormation "Column";
_wp setWaypointCompletionRadius 1;
_wp setWaypointType "GETIN";
sleep 5;
_spawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation";
if(!isNil "_spawnLocation") then
{
_driver action ["movetodriver", _vehicle];
_vehicle forceSpeed -1;
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "SAFE";
_group setCombatMode "RED";
};
_spawnLocation = _vehicle getVariable "SC_vehicleSpawnLocation";
_driver action ["movetodriver", _vehicle];
_vehicle forceSpeed -1;
[_group, _spawnLocation, 2000] call bis_fnc_taskPatrol;
_group setBehaviour "SAFE";
_group setCombatMode "RED";
};
}
else

View File

@ -13,7 +13,7 @@ if (side _aggressor == RESISTANCE) then
_group = createGroup WEST;
{
_unit = _x;
[_unit] joinSilent grpNull;
//[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
_unit removeAllMPEventHandlers "mphit";
}foreach units _initialGroup;

View File

@ -0,0 +1,12 @@
// Get the variables from the event handler
_unit = _this select 0;
_killer = _this select 1;
// remove all eventhandlers from the dead unit
_unit removeAllMPEventHandlers "mphit";
[_unit] join grpNull;
if(SC_debug) then
{
{ deleteVehicle _x; } forEach attachedObjects _unit;
};

View File

@ -2,33 +2,25 @@
// SC_liveVehiclesArray = array of active vehicles
_vehicle = _this select 0;
_vehicle removeAllMPEventHandlers "mphit";
_vehicle removeAllMPEventHandlers "mpkilled";
_vehicle removeAllEventHandlers "getin";
_vehicle removeAllEventHandlers "getout";
if(!isNil "_vehicle") then
if(_vehicle isKindOf "LandVehicle") then
{
_vehicle = _this select 0;
_vehicle removeAllMPEventHandlers "mphit";
_vehicle removeAllMPEventHandlers "mpkilled";
_vehicle removeAllEventHandlers "getin";
_vehicle removeAllEventHandlers "getout";
_vehicle lock 0;
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["ExileIsLocked", 0, true];
if(_vehicle isKindOf "LandVehicle") then
{
SC_liveVehicles = SC_liveVehicles - 1;
SC_liveVehiclesArray = SC_liveVehiclesArray - [_vehicle];
};
SC_liveVehicles = SC_liveVehicles - 1;
SC_liveVehiclesArray = SC_liveVehiclesArray - [_vehicle];
};
if(_vehicle isKindOf "Air") then
{
SC_liveHelis = SC_liveHelis - 1;
SC_liveHelisArray = SC_liveHelisArray - [_vehicle];
};
if(_vehicle isKindOf "Air") then
{
SC_liveHelis = SC_liveHelis - 1;
SC_liveHelisArray = SC_liveHelisArray - [_vehicle];
};
if(_vehicle isKindOf "Ship") then
{
SC_liveBoats = SC_liveBoats - 1;
SC_liveBoatsArray = SC_liveBoatsArray - [_vehicle];
};
};
if(_vehicle isKindOf "Ship") then
{
SC_liveBoatss = SC_liveBoatss - 1;
SC_liveBoatsArray = SC_liveBoatsArray - [_vehicle];
};

View File

@ -10,18 +10,9 @@ if(SC_debug) then { SC_refreshTime = 60; }else{ SC_refreshTime = 300; };
// Add selected occupation scripts to Exile Threading System
if(SC_processReporter) then
{
fnc_processReporter = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\processReporter.sqf";
diag_log format ["[processReporter]:: Initialised at %1",time];
[60, fnc_processReporter, [], true] call ExileServer_system_thread_addTask;
};
if (SC_fastNights) then
{
fnc_checkMultiplier = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationFastNights.sqf";
diag_log format ["[OCCUPATION:FastNights]:: Initialised at %1",time];
[60, fnc_checkMultiplier, [], true] call ExileServer_system_thread_addTask;
};
@ -57,35 +48,35 @@ if(SC_occupyStatic) then
if(SC_occupySky) then
{
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationSky = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSky.sqf";
[SC_refreshTime, fnc_occupationSky, [], true] call ExileServer_system_thread_addTask;
};
if(SC_occupySea) then
{
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationSea = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSea.sqf";
[SC_refreshTime, fnc_occupationSea, [], true] call ExileServer_system_thread_addTask;
};
if(SC_occupyVehicle) then
{
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationVehicle.sqf";
[SC_refreshTime, fnc_occupationVehicle, [], true] call ExileServer_system_thread_addTask;
};
if(SC_occupyPlaces) then
{
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationPlaces = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationPlaces.sqf";
[SC_refreshTime, fnc_occupationPlaces, [], true] call ExileServer_system_thread_addTask;
};
if(SC_occupyMilitary) then
{
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationMilitary = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMilitary.sqf";
[SC_refreshTime, fnc_occupationMilitary, [], true] call ExileServer_system_thread_addTask;
};
@ -95,7 +86,7 @@ if(SC_occupyTransport) then
[] execVM "\x\addons\a3_exile_occupation\scripts\occupationTransport.sqf";
};
uiSleep 30; // delay the start
uiSleep 15; // delay the start
fnc_occupationMonitor = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMonitor.sqf";
[SC_refreshTime, fnc_occupationMonitor, [], true] call ExileServer_system_thread_addTask;