v30 changes & fixes

This commit is contained in:
second_coming 2016-04-27 01:05:03 +01:00
parent 97d25d6d6f
commit 9ebc92a382
12 changed files with 143 additions and 72 deletions

View File

@ -21,6 +21,8 @@ SC_mapMarkers = false; // Place map markers at the occupied areas (o
SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn
SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra player
SC_removeUserMapMarkers = true; // true to delete map markers place by players every 10 seconds
SC_fastNights = true; // true if you want night time to go faster than daytime
SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm
SC_fastNightsMultiplierNight= 16; // the time multiplier to use at night (12 = 12x speed)
@ -34,13 +36,13 @@ SC_minDistanceToSpawnZones = 500; // Distance in metres (Briti
SC_minDistanceToTraders = 500; // Distance in metres (British spelling, sue me :p ) Only used by occupy Places
SC_occupyVehicle = true; // true if you want to have roaming AI vehicles
SC_occupyVehiclesLocked = true; // 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_occupyTraders = false; // (WORK IN PROGRESS, NOT WORKING YET) true if you want to create trader camps at positions specified in SC_occupyTraderDetails
SC_occupyTraderDetails = [
["Test Trader1",[23718,16223,0],true],
["Test Trader2",[10666,10262,0],true]
]; //["Name",[x,y,z],true] trader name, location, safezone true/false
["Test Trader1",[23718,16223,0],"trader1.sqf",true],
["Test Trader2",[10666,10262,0],"trader1.sqf",true]
]; //["Name",[x,y,z],"filename",true] trader name, location, safezone true/false
SC_SurvivorsChance = 20; // chance in % to spawn survivors instead of bandits (for places and land vehicles)
SC_occupyPlacesSurvivors = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyPlaces must be true to use this option)
@ -68,10 +70,10 @@ SC_BanditUniforms = ["U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Gueri
SC_BanditVests = ["V_BandollierB_blk","V_BandollierB_cbr","V_BandollierB_khk","V_BandollierB_oli"];
SC_BanditHeadgear = ["H_Shemag_khk","H_Shemag_olive","H_Shemag_olive_hs","H_Shemag_tan","H_ShemagOpen_khk","H_ShemagOpen_tan"];
SC_BanditWeapon = ["LMG_Zafir_F","arifle_Katiba_C_F","arifle_Katiba_F","arifle_Katiba_GL_F","arifle_MXC_Black_F","arifle_MXC_F","arifle_TRG20_F","arifle_TRG21_F","arifle_TRG21_GL_F"];
SC_BanditWeaponAttachments = ["optic_MRCO","optic_ACO_grn"];
SC_BanditWeaponAttachments = [];
SC_BanditMagazines = ["Exile_Item_InstaDoc","Exile_Item_Vishpirin","Exile_Item_Bandage","Exile_Item_DuctTape","Exile_Item_PlasticBottleFreshWater","Exile_Item_Energydrink","Exile_Item_EMRE","Exile_Item_Cheathas","Exile_Item_Noodles","Exile_Item_BBQSandwich","Exile_Item_Catfood"];
SC_BanditPistol = ["hgun_ACPC2_F","hgun_P07_F","hgun_Pistol_heavy_01_F","hgun_Pistol_heavy_02_F","hgun_Rook40_F"];
SC_BanditPistolAttachments = ["optic_MRD","muzzle_snds_acp"];
SC_BanditPistolAttachments = [];
SC_BanditAssignedItems = ["ItemMap","ItemCompass","ItemRadio","ItemWatch"]; // all these items will be added
SC_BanditLauncher = [];
SC_BanditBackpack = ["B_HuntingBackpack","B_Kitbag_cbr","B_Kitbag_mcamo","B_Kitbag_sgg","B_OutdoorPack_blk","B_OutdoorPack_blu","B_OutdoorPack_tan","B_TacticalPack_blk","B_TacticalPack_mcamo","B_TacticalPack_ocamo","B_TacticalPack_oli","B_TacticalPack_rgr"];
@ -283,4 +285,8 @@ publicVariable "SC_transportArray";
publicVariable "SC_SurvivorSide";
publicVariable "SC_BanditSide";
// Override a few DMS settings
//DMS_Show_Kill_Poptabs_Notification = false;
//DMS_Show_Kill_Respect_Notification = false;
SC_CompiledOkay = true;

View File

@ -2,7 +2,7 @@
//
// Server Occupation script by second_coming
//
SC_occupationVersion = "v27 (26-04-2016)";
SC_occupationVersion = "v30 (27-04-2016)";
//
// http://www.exilemod.com/profile/60-second_coming/
//
@ -49,12 +49,14 @@ SC_occupationVersion = "v27 (26-04-2016)";
SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf";
SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf";
SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf";
SC_fnc_staticUnitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\staticUnitMPKilled.sqf";
SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf";
SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf";
SC_fnc_addMarker = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_addMarker.sqf";
SC_fnc_spawnstatics = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_spawnStatics.sqf";
SC_fnc_selectGear = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\functions\fnc_selectGear.sqf";
_logDetail = "=============================================================================================================";
[_logDetail] call SC_fnc_log;

View File

@ -7,8 +7,8 @@ for "_i" from 1 to SC_numberofLootCrates do
if(!isNil "_pos") then
{
_nearPlayers = (count (_pos nearEntities [['Exile_Unit_Player'],15]));
if(_nearPlayers > 0) then
if([_pos, 15] call ExileClient_util_world_isAlivePlayerInRange) then
{
deleteMarker _markerName;
_logDetail = format ["[OCCUPATION:LootCrates]:: marker %1 removed at %2",_markerName,time];
@ -16,4 +16,14 @@ for "_i" from 1 to SC_numberofLootCrates do
};
};
};
};
if(SC_removeUserMapMarkers) then
{
{
if(_x find '_USER_DEFINED' > -1)then
{
deleteMarker _x;
}
} forEach allMapMarkers;
};

View File

@ -4,7 +4,7 @@ _side = _this select 0;
_unit = _this select 1;
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mpkilled";
switch (_side) do
{

View File

@ -5,6 +5,7 @@ _currentSide = SC_BanditSide;
_debug = SC_debug;
_useLaunchers = DMS_ai_use_launchers;
_scaleAI = SC_scaleAI;
_staticUID = 1;
if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
@ -24,18 +25,21 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
while{_okToSpawn} do
{
// Don't spawn additional AI if there are already AI in for that side in range
_nearAI = { side _x == _currentSide AND _x distance _spawnPosition < 250 } count allUnits;
if(_nearAI > 0) exitwith
{
// Don't spawn if a previous round of AI are already in place
_newStatic = [_staticUID,_spawnPosition];
if(_staticUID in SC_liveStaticGroups) exitwith
{
_okToSpawn = false;
if(_debug) then
{
_logDetail = format ["[OCCUPATION Static]:: %1 already has %2 active AI patrolling",_spawnPosition,_nearAI];
[_logDetail] call SC_fnc_log;
};
};
};
};
// Don't spawn additional AI if there are players in range
if([_spawnPosition, 250] call ExileClient_util_world_isAlivePlayerInRange) exitwith
{
@ -62,6 +66,9 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
{
_loadOut = [_side] call SC_fnc_selectGear;
_unit = [_initialGroup,_spawnPosition,"custom","random",_side,"soldier",_loadOut] call DMS_fnc_SpawnAISoldier;
_unit setVariable ["SC_staticUID",_staticUID];
_unit setVariable ["SC_staticSpawnPos",_spawnPosition];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_staticUnitMPKilled;"];
};
DMS_ai_use_launchers = _useLaunchers;
@ -73,7 +80,7 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
_group setVariable ["DMS_SpawnedGroup",true];
_group setVariable ["DMS_Group_Side", _side];
SC_liveStaticGroups = SC_liveStaticGroups + [_group,_spawnPosition];
SC_liveStaticGroups = SC_liveStaticGroups + [_staticUID,_spawnPosition];
{
_unit = _x;
@ -150,5 +157,5 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide };
_okToSpawn = false;
};
};
_staticUID = _staticUID + 1;
}forEach _statics;

View File

@ -33,6 +33,7 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time];
sleep 5;
}forEach SC_liveBoatsArray;
/*
{
_logDetail = format ["[OCCUPATION:Unstick]:: Transport: %1 is active",_x];
[_logDetail] call SC_fnc_log;
@ -40,6 +41,7 @@ _logDetail = format ["[OCCUPATION:Unstick]:: Initialised at %1",time];
[_x] call SC_fnc_comeUnstuck;
sleep 5;
}forEach SC_transportArray;
*/
_logDetail = format ["[OCCUPATION:Unstick]:: Finished at %1",time];
[_logDetail] call SC_fnc_log;

View File

@ -20,7 +20,7 @@ if(_currentPlayerCount > _scaleAI) then
};
// Don't spawn additional AI if the server fps is below 8
// Don't spawn additional AI if the server fps is below _minFPS
if(diag_fps < _minFPS) exitWith
{
_logDetail = format ["[OCCUPATION Static]:: Held off spawning more AI as the server FPS is only %1",diag_fps];

View File

@ -68,9 +68,12 @@ else
_transport = createVehicle [SC_occupytransportClass, _spawnLocation, [], 0, "CAN_COLLIDE"];
};
_transport setObjectTextureGlobal[0,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
_transport setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
_transport setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.518,0.519,0.455,0.2)"];
_transport addEventHandler ["handleDamage", { false }];
_transport allowdamage false;
_transport setObjectTextureGlobal[0,"#(argb,8,8,3)color(0.518,0.519,0.7,0.2)"];
_transport setObjectTextureGlobal [1,"#(argb,8,8,3)color(0.518,0.519,0.7,0.2)"];
_transport setObjectTextureGlobal [2,"#(argb,8,8,3)color(0.518,0.519,0.7,0.2)"];
_group addVehicle _transport;
_transport enableCopilot false;
@ -91,43 +94,7 @@ _transportDriver assignasdriver _transport;
_transportDriver moveInDriver _transport;
[_transportDriver] orderGetin true;
_transport lockDriver true;
/*
// Calculate the gunners requried
// adding gunners to helicopters stops them landing to pickup players
_gunnerCount = 0;
_vehicleRoles = (typeOf _transport) call bis_fnc_vehicleRoles;
{
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Turret" && _gunnerCount < 2) then
{
_unit = _group createUnit [DMS_AI_Classname, _spawnLocation, [], 0,"FORM"];
_unit moveInTurret [_transport, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_transport];
_unit forceAddUniform "U_BG_leader";
_unit addVest "V_TacVest_blk_POLICE";
_unit addHeadgear "H_Cap_blk";
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unit allowDamage false;
[_unit] orderGetin true;
_gunnerCount = _gunnerCount + 1;
_unitPlaced = true;
};
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Transport] %1 added to %2',_vehicleRole,_transport];
[_logDetail] call SC_fnc_log;
};
if(_gunnerCount == 2) exitWith{};
} forEach _vehicleRoles;
_transport lockturret [[0],true];
_transport lockturret [[1],true];
_transport lockturret [[2],true];
*/
_transport lockTurret [[0],true];
SC_transportArray = SC_transportArray + [_transport];
_transport setVariable ["SC_assignedDriver", _transportDriver,true];
@ -147,10 +114,6 @@ _transport setFuel 1;
_logDetail = format['[OCCUPATION:transport] Vehicle spawned @ %1',_spawnLocation];
[_logDetail] call SC_fnc_log;
_transport addEventHandler ["HandleDamage", { _amountOfDamage = 0; _amountOfDamage }];
{
_markerName = _x;
@ -218,10 +181,12 @@ while {true} do
_transport setFuel 1;
_transport setVehicleAmmo 1;
uiSleep 3;
_transportDriver enableAI "MOVE";
if(!Alive _transportDriver) exitWith {};
_transportDriver enableAI "MOVE";
};
if(!Alive _transportDriver) exitWith {};
uiSleep 5;
};
deleteMarker _mk;
_logDetail = format ["[OCCUPATION:transport]:: Ended @ %1",time];
[_logDetail] call SC_fnc_log;

View File

@ -47,7 +47,7 @@ if(count units _group > 0) then
_driver setVariable ["SC_drivenVehicle", _vehicle,true];
_vehicle setVariable ["SC_assignedDriver", _driver,true];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"];
_driver removeAllMPEventHandlers "mpkilled";
_driver removeAllMPEventHandlers "mphit";
_driver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
if(SC_debug) then
@ -59,7 +59,6 @@ if(count units _group > 0) then
_driver doMove (position _vehicle);
_driver action ["movetodriver", _vehicle];
if(SC_extendedLogging) then
{
_logDetail = format ["[OCCUPATION:Vehicle]:: Replacement Driver found (%1) for vehicle %2",_driver,_vehicle];

View File

@ -20,8 +20,13 @@ if(_unit == _driver) then
{
_arrowClass = "Sign_Arrow_Yellow_F";
};
if(SC_debug && alive _unit) then
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,12 @@
// Get the variables from the event handler
_unit = _this select 0;
_staticUID = _unit getVariable "SC_staticUID";
_spawnPosition = _unit getVariable "SC_staticSpawnPos";
_group = group _unit;
if((count (units _group)) == 0) then
{
SC_liveStaticGroups = SC_liveStaticGroups - [_staticUID,_spawnPosition];
};

63
trader/trader1.sqf Normal file
View File

@ -0,0 +1,63 @@
private ["_obj"];
_obj = [
["Flag_Green_F",[6784.61,2234.17,0],0,[[0,1,0],[0,0,1]],true],
["Land_LampHalogen_F",[6781.62,2236.18,4.76837e-007],0,[[0,1,0],[0,0,1]],true],
["Land_BagBunker_Tower_F",[6785.5,2236.32,0],0,[[0,1,0],[0,0,1]],true],
["Land_HBarrierWall_corridor_F",[6792.26,2215.3,0],90.8969,[[0.999877,-0.0156535,0],[0,-0,1]],true],
["Land_HBarrierWall_corner_F",[6787.26,2218.83,0],180,[[-8.74228e-008,-1,0],[-0,0,1]],true],
["Land_HBarrierWall4_F",[6802.85,2219.04,0],181.56,[[-0.0272239,-0.999629,0],[-0,0,1]],true],
["Land_HBarrierWall4_F",[6808.37,2219.03,0],181.56,[[-0.0272239,-0.999629,0],[-0,0,1]],true],
["Land_HBarrierWall4_F",[6786.7,2223.28,0],271.56,[[-0.999629,0.027224,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6797.38,2219.01,0],181.56,[[-0.0272239,-0.999629,0],[-0,0,1]],true],
["Land_HBarrierWall4_F",[6786.6,2228.88,0],271.56,[[-0.999629,0.027224,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6813.69,2219.18,0],181.56,[[-0.0272239,-0.999629,0],[-0,0,1]],true],
["Land_BagBunker_Small_F",[6797.94,2212.17,0],0,[[0,1,0],[0,0,1]],true],
["WaterPump_01_forest_F",[6812.35,2222.43,0.0008564],0.00101824,[[1.75769e-005,1,0],[0,0,1]],true],
["Land_Pipes_large_F",[6802.52,2223.54,0],180,[0,0,1],true],
["Land_Pipes_large_F",[6802.98,2225.14,0],180,[0,0,1],true],
["Land_Pipes_large_F",[6802.32,2221.82,0],180,[0,0,1],true],
["Land_WaterTank_F",[6809.06,2221.62,-4.76837e-006],359.999,[0,0,1],true],
["Land_Pallets_F",[6784.61,2234.17,0],0,[[0,1,0],[0,0,1]],true],
["Land_Sign_WarningMilitaryArea_F",[6787.54,2212.37,0],8.19623e-005,[[1.5979e-006,1,0],[0,0,1]],true],
["Land_BagFence_Round_F",[6786.37,2238.76,2.78],220,[[-0.642788,-0.766044,0],[-0,0,1]],true],
["Land_BagFence_Round_F",[6784.2,2238.49,2.78],125,[[0.819152,-0.573576,0],[0,-0,1]],true],
["Land_Pallet_F",[6784.56,2235.6,0.0981288],3.03364,[[0.0529221,0.998599,0],[0,0,1]],true],
["Land_Pallet_F",[6784.55,2236.99,0.0814247],356.286,[[-0.0647757,0.9979,0],[0,0,1]],true],
["Land_Pallet_F",[6784.54,2238.55,-4.76837e-007],360,[[1.74846e-007,1,0],[0,0,1]],true],
["Land_PaperBox_closed_F",[6794.19,2226.73,0],320,[[-0.642787,0.766045,0],[0,0,1]],true],
["Land_PaperBox_closed_F",[6791.38,2226.37,0],255,[[-0.965926,-0.258819,0],[-0,0,1]],true],
["Land_PaperBox_closed_F",[6793.82,2224.24,0],280,[[-0.984808,0.173649,0],[0,0,1]],true],
["Land_PaperBox_closed_F",[6791.46,2224.07,0],90,[[1,-4.37114e-008,0],[0,-0,1]],true],
["Land_LampHalogen_F",[6802.4,2215.7,4.76837e-007],270,[[-1,4.88762e-007,0],[0,0,1]],true],
["Land_HBarrierTower_F",[6787.46,2256.03,0],140,[[0.642787,-0.766045,0],[0,-0,1]],true],
["Land_HBarrierWall6_F",[6786.93,2244.97,0],270,[[-1,4.88762e-007,0],[0,0,1]],true],
["Land_HBarrierWall6_F",[6794.56,2256.56,0],3.15003,[[0.0549506,0.998489,0],[0,0,1]],true],
["Land_HBarrierWall_corridor_F",[6811.83,2260.33,0],90.8969,[[0.999877,-0.0156535,0],[0,-0,1]],true],
["Land_HBarrierWall4_F",[6806.85,2256.56,0],1.56032,[[0.0272296,0.999629,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6786.79,2250.58,0],271.56,[[-0.999629,0.027224,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6801.41,2256.53,0],1.56,[[0.0272237,0.999629,0],[0,0,1]],true],
["Land_BagBunker_Small_F",[6805.37,2261.99,0],180,[[-8.74228e-008,-1,0],[-0,0,1]],true],
["Land_FieldToilet_F",[6806.4,2242.7,4.24385e-005],270,[[-1,4.88762e-007,0],[0,0,1]],true],
["Land_Pallet_MilBoxes_F",[6811.32,2247.61,0],0,[[0,1,0],[0,0,1]],true],
["Land_PaperBox_open_full_F",[6806.73,2251.91,0],0,[[0,1,0],[0,0,1]],true],
["Land_PaperBox_open_full_F",[6809.12,2247.42,0],0,[[0,1,0],[0,0,1]],true],
["Land_PaperBox_open_empty_F",[6809.19,2251.86,0],0,[[0,1,0],[0,0,1]],true],
["Land_PaperBox_closed_F",[6809.15,2249.86,0],0,[[0,1,0],[0,0,1]],true],
["Land_PaperBox_closed_F",[6806.56,2247.15,0],255,[[-0.965926,-0.258819,0],[-0,0,1]],true],
["Land_PaperBox_closed_F",[6806.51,2249.71,0],0,[[0,1,0],[0,0,1]],true],
["Land_Pallets_stack_F",[6808.97,2245.2,-4.76837e-007],360,[[1.74846e-007,1,0],[0,0,1]],true],
["Land_Pallet_vertical_F",[6808.94,2246.27,0.000220776],0.000954998,[[1.65116e-005,1,0],[0,0,1]],true],
["Land_LampHalogen_F",[6800.11,2260.46,4.76837e-007],90,[[1,-4.37114e-008,0],[0,-0,1]],true],
["Land_BagBunker_Large_F",[6821.33,2237.75,0],270,[[-1,4.88762e-007,0],[0,0,1]],true],
["Land_HBarrierTower_F",[6817.26,2219.4,0],315,[[-0.707107,0.707107,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6817,2224.9,0],91.5603,[[0.999629,-0.0272291,0],[0,-0,1]],true],
["Land_HBarrierWall4_F",[6816.92,2230.47,0],91.5603,[[0.999629,-0.0272291,0],[0,-0,1]],true],
["Land_LampHalogen_F",[6819.85,2232.55,4.76837e-007],180,[[-8.74228e-008,-1,0],[-0,0,1]],true],
["Land_HBarrierWall_corner_F",[6816.66,2256.74,0],0,[[0,1,0],[0,0,1]],true],
["Land_HBarrierWall4_F",[6817.16,2252.26,0],91.5603,[[0.999629,-0.0272291,0],[0,-0,1]],true],
["Land_Sign_WarningMilitaryArea_F",[6816.03,2262.96,0],180,[[-8.74228e-008,-1,0],[-0,0,1]],true],
["Land_HBarrierWall6_F",[6817.3,2246.33,0],90,[[1,-4.37114e-008,0],[0,-0,1]],true]
];
_obj