Merge remote-tracking branch 'refs/remotes/origin/development'

This commit is contained in:
second_coming 2016-04-30 12:46:32 +01:00
commit 9a23f920d5
8 changed files with 468 additions and 519 deletions

View File

@ -1,3 +1,8 @@
=================================================================================
V32 (29-04-2016)
=================================================================================
Added checks for valide vehicles in Sky, Sea and Vehicle modules
================================================================================= =================================================================================
V28-V31 (27-04-2016) V28-V31 (27-04-2016)
================================================================================= =================================================================================

View File

@ -2,7 +2,7 @@
// //
// Server Occupation script by second_coming // Server Occupation script by second_coming
// //
SC_occupationVersion = "v31 (27-04-2016)"; SC_occupationVersion = "v32 (29-04-2016)";
// //
// http://www.exilemod.com/profile/60-second_coming/ // http://www.exilemod.com/profile/60-second_coming/
// //

View File

@ -1,14 +0,0 @@
V28-V31 (27-04-2016)
Altereed a few eventhandlers
Fixed multiple static spawns so they are independent of each other
V27 (26-04-2016) Development Update
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

@ -44,9 +44,13 @@ 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;
_VehicleClassToUse = SC_BoatClassToUse call BIS_fnc_selectRandom; _VehicleClassToUse = SC_BoatClassToUse call BIS_fnc_selectRandom;
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"]; _vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNil "_vehicle") then
{
_group = createGroup SC_BanditSide;
_vehicle setPosASL _spawnLocation; _vehicle setPosASL _spawnLocation;
_vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true];
@ -189,8 +193,13 @@ for "_i" from 1 to _vehiclesToSpawn do
_vehicle setVariable ["SC_crewEjected", false,true]; _vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2; sleep 0.2;
}
else
{
_logDetail = format['[OCCUPATION:Sea] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
};
}; };
_logDetail = format['[OCCUPATION:Sea] Running']; _logDetail = format['[OCCUPATION:Sea] Running'];
[_logDetail] call SC_fnc_log; [_logDetail] call SC_fnc_log;

View File

@ -68,10 +68,12 @@ for "_i" from 1 to _vehiclesToSpawn do
_safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos; _safePos = [_position,10,100,5,0,20,0] call BIS_fnc_findSafePos;
_height = 350 + (round (random 200)); _height = 350 + (round (random 200));
_spawnLocation = [_safePos select 0, _safePos select 1, _height]; _spawnLocation = [_safePos select 0, _safePos select 1, _height];
_group = createGroup SC_BanditSide;
_VehicleClassToUse = SC_HeliClassToUse call BIS_fnc_selectRandom; _VehicleClassToUse = SC_HeliClassToUse call BIS_fnc_selectRandom;
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"]; _vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNil "_vehicle") then
{
_group = createGroup SC_BanditSide;
_group addVehicle _vehicle; _group addVehicle _vehicle;
_vehicle setVariable["vehPos",_spawnLocation,true]; _vehicle setVariable["vehPos",_spawnLocation,true];
_vehicle setVariable["vehClass",_VehicleClassToUse,true]; _vehicle setVariable["vehClass",_VehicleClassToUse,true];
@ -216,7 +218,12 @@ for "_i" from 1 to _vehiclesToSpawn do
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"]; _vehicle addMPEventHandler ["mphit", "_this call SC_fnc_airHit;"];
_vehicle setVariable ["SC_crewEjected", false,true]; _vehicle setVariable ["SC_crewEjected", false,true];
sleep 0.2; sleep 0.2;
}
else
{
_logDetail = format['[OCCUPATION:Sky] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
};
}; };

View File

@ -103,22 +103,11 @@ if(_vehiclesToSpawn >= 1) then
_pos = [_position,10,250,5,0,20,0] call BIS_fnc_findSafePos; _pos = [_position,10,250,5,0,20,0] call BIS_fnc_findSafePos;
// Get position of nearest roads // Get position of nearest roads
_nearRoads = _pos nearRoads 500; _nearRoads = _pos nearRoads 2000;
_nearestRoad = _nearRoads select 0; _nearestRoad = _nearRoads select 0;
_nearestRoad = position (_nearRoads select 0); _nearestRoad = position (_nearRoads select 0);
_spawnLocation = [_nearestRoad select 0, _pos select 1, 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; _VehicleClassToUse = SC_VehicleClassToUse call BIS_fnc_selectRandom;
// Percentage chance to spawn a rare vehicle // Percentage chance to spawn a rare vehicle
@ -130,6 +119,20 @@ if(_vehiclesToSpawn >= 1) then
_vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"]; _vehicle = createVehicle [_VehicleClassToUse, _spawnLocation, [], 0, "NONE"];
if(!isNil "_vehicle") 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; _group addVehicle _vehicle;
SC_liveVehicles = SC_liveVehicles + 1; SC_liveVehicles = SC_liveVehicles + 1;
@ -158,10 +161,6 @@ if(_vehiclesToSpawn >= 1) then
_vehicle limitSpeed 60; _vehicle limitSpeed 60;
_vehicle action ["LightOn", _vehicle]; _vehicle action ["LightOn", _vehicle];
// Calculate the number of seats in the vehicle and fill the required amount // Calculate the number of seats in the vehicle and fill the required amount
_crewRequired = SC_minimumCrewAmount; _crewRequired = SC_minimumCrewAmount;
if(SC_maximumCrewAmount > SC_minimumCrewAmount) then if(SC_maximumCrewAmount > SC_minimumCrewAmount) then
@ -278,6 +277,12 @@ if(_vehiclesToSpawn >= 1) then
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines"); _magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3]; _vehicle addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 3];
}; };
}
else
{
_logDetail = format['[OCCUPATION:Vehicle] Vehicle %1 failed to spawn @ %2',_VehicleClassToUse, _spawnLocation];
[_logDetail] call SC_fnc_log;
};
}; };
}; };

View File

@ -48,35 +48,35 @@ if(SC_occupyStatic) then
if(SC_occupySky) then if(SC_occupySky) then
{ {
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationSky = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSky.sqf"; fnc_occupationSky = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSky.sqf";
[SC_refreshTime, fnc_occupationSky, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationSky, [], true] call ExileServer_system_thread_addTask;
}; };
if(SC_occupySea) then if(SC_occupySea) then
{ {
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationSea = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSea.sqf"; fnc_occupationSea = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationSea.sqf";
[SC_refreshTime, fnc_occupationSea, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationSea, [], true] call ExileServer_system_thread_addTask;
}; };
if(SC_occupyVehicle) then if(SC_occupyVehicle) then
{ {
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationVehicle.sqf"; fnc_occupationVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationVehicle.sqf";
[SC_refreshTime, fnc_occupationVehicle, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationVehicle, [], true] call ExileServer_system_thread_addTask;
}; };
if(SC_occupyPlaces) then if(SC_occupyPlaces) then
{ {
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationPlaces = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationPlaces.sqf"; fnc_occupationPlaces = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationPlaces.sqf";
[SC_refreshTime, fnc_occupationPlaces, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationPlaces, [], true] call ExileServer_system_thread_addTask;
}; };
if(SC_occupyMilitary) then if(SC_occupyMilitary) then
{ {
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationMilitary = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMilitary.sqf"; fnc_occupationMilitary = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMilitary.sqf";
[SC_refreshTime, fnc_occupationMilitary, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationMilitary, [], true] call ExileServer_system_thread_addTask;
}; };
@ -86,7 +86,7 @@ if(SC_occupyTransport) then
[] execVM "\x\addons\a3_exile_occupation\scripts\occupationTransport.sqf"; [] execVM "\x\addons\a3_exile_occupation\scripts\occupationTransport.sqf";
}; };
uiSleep 15; // delay the start uiSleep 30; // delay the start
fnc_occupationMonitor = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMonitor.sqf"; fnc_occupationMonitor = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMonitor.sqf";
[SC_refreshTime, fnc_occupationMonitor, [], true] call ExileServer_system_thread_addTask; [SC_refreshTime, fnc_occupationMonitor, [], true] call ExileServer_system_thread_addTask;

View File

@ -1,63 +0,0 @@
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