Advertisement
Guest User

chernarus_replace.sqf JakeHekesFists[DMD]

a guest
Dec 3rd, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.37 KB | None | 0 0
  1. /*
  2.     file:   chernarus_replace.sqf
  3.     Original Script Here: http://forums.bistudio.com/showthread.php?190404-Chernarus-Takistan
  4.  
  5.     Script edited by jakehekesfists[dmd] 08/05/2015
  6.     -rev 2.4b (for Arma III)   
  7.         11/10/2016 Updated for A3 Exile w/ CUP Terrains - 21DMD Zerkforge edit
  8.         28/11/2016 (ANNOYING SHIT ARRAY REMOVAL + GLOBAL SIM DISABLE ON REPLACED BUILDINGS FOR HOPEFULLY BETTER PERFORMANCE)
  9.         29/11/2016
  10.             *   Code Streamline & pushback replaces set.
  11.             *   disable global sim on all map objects except lamps.
  12.             *   hideObjectGlobal used on Server, no longer need anything to run on client
  13.         04/12/2016
  14.             *   fuel pumps require simulation to auto refuel - fixed (add classes to _DMD_FuelPumps array if using non-chernarus map)
  15. */
  16. if (isServer) then {   
  17.     private _DMD_CloseHouse = [
  18.         // DELETE ONLY
  19.         "CUP_A2_boots_ep1","CUP_A2_drevo_hromada","CUP_A2_haystack","CUP_A2_metalcase_01","CUP_A2_metalcase_02","CUP_A2_woodpile","Land_fuel_tank_small","Land_Hut06","Land_Ind_BoardsPack1","Land_Ind_BoardsPack2","Land_Ind_Timbers","Land_Kontejner","Land_loco_742_blue","Land_Misc_GContainer_Big","Land_Nasypka","Land_seno_balik","Land_Shed_M01","Land_Shed_M02","Land_Shed_M03","Land_Shed_W03","Land_SignB_Hotel_CZ2","Land_SignB_PostOffice","Land_SignB_Pub_CZ2","Land_SignB_Pub_CZ3","Land_SignB_Pub_RU3","Land_Sign_Bar_RU","Land_Tec","Land_wagon_box",
  20.         // REPLACE
  21.         "Land_A_Office02","Land_Church_01","Land_Ind_SawMill","Land_Church_02","Land_Church_02a","Land_HouseV2_01A","Land_HouseV2_01B","Land_HouseV2_02_Interier","Land_HouseV2_03","Land_HouseV2_03B","Land_HouseV2_04_interier","Land_HouseV2_05","Land_HouseV_1I1","Land_HouseV_1I2","Land_HouseV_1I3","Land_HouseV_1L2","Land_HouseV_1L1","Land_HouseV_1T","Land_HouseV_2I","Land_HouseV_2L","Land_houseV_2T1","Land_houseV_2T2","Land_HouseV_3I1","Land_HouseV_3I2","Land_HouseV_3I3","Land_HouseV_3I4","Land_Ind_Workshop01_03","Land_Mil_Barracks","Land_Mil_Barracks_L","Land_Mil_Guardhouse","Land_Misc_WaterStation","Land_Shed_W4","Land_Shed_W02"
  22.     ];
  23.  
  24.     /*
  25.         to display object IDs in 3Den editor, execute the code below and exit back into the editor.
  26.         do3DENAction "ToggleMapIDs";
  27.     */
  28.     //  the _DMD_AnnoyingShit array will remove some random benches, junk piles & other assorted items around chernarus. edit it however you see fit
  29.     // List of Locations and Map IDs to remove
  30.     // format [[_position],OBJID]
  31.  
  32.     private _DMD_AnnoyingShit = [
  33.         [[8672,2467,0],357998],[[8672,2467,0],357948],[[8672,2467,0],358030],[[8672,2425,0],358098],[[8672,2425,0],358099],[[8672,2425,0],358074],[[9423,8929,0],244751],[[9423,8929,0],244752],[[9423,8929,0],244744],[[9423,8929,0],244746],[[9423,8929,0],244747],[[9423,8929,0],244749],[[9423,8929,0],244750],[[9423,8929,0],244753],[[9423,8929,0],244754],[[9423,8929,0],244755],[[9423,8929,0],244756],[[9423,8929,0],244757],[[9423,8929,0],244758],[[9423,8929,0],244759],[[9423,8929,0],244745],[[9423,8929,0],244743],[[9423,8929,0],244742],[[12016,9078,0],262014],[[12016,9078,0],262127],[[12016,9078,0],262126],[[12016,9078,0],262522],[[12016,9078,0],262196],[[12016,9078,0],261912],[[12016,9078,0],262527],[[12016,9078,0],262159],[[12016,9078,0],262160],[[12016,9078,0],262161],[[12016,9078,0],262162],[[12016,9078,0],262163],[[12016,9078,0],262164],[[12016,9078,0],262165],[[12016,9078,0],262166],[[12016,9078,0],262158],[[12016,9078,0],262167],[[12016,9078,0],262168],[[12016,9078,0],963460],[[6203,10405,0],993525],[[6203,10405,0],993526],[[10371,7427,0],275286],[[10371,7427,0],275287],[[10371,7427,0],275293],[[10453,8894,0],249766],[[6726,9263,0],965108],[[6726,9263,0],965159],[[6726,9263,0],965069],[[6726,9263,0],965070],[[6726,9263,0],965169],[[6726,9263,0],965190],[[6726,9263,0],965167],[[6726,9263,0],965166],[[6726,9263,0],965127],[[6820,2777,0],966603],[[6820,2777,0],966594],[[6820,2777,0],966502],[[6820,2777,0],966631],[[6820,2777,0],966554],[[6820,2777,0],966513],[[6820,2777,0],966504],[[6820,2777,0],966555],[[6820,2777,0],966605],[[6820,2777,0],966604],[[6820,2777,0],966514],[[6820,2777,0],966606],[[6820,2777,0],966556],[[4564,9595,0],145259],[[4564,9595,0],145260]
  34.     ];
  35.  
  36.     /* Buildings to Replace */
  37.     // Format:  [[Building to Replace],[Replacement Building]] 
  38.     private _DMD_Replacement_List = [
  39.         [["Land_HouseV_1I2"],["Land_i_Stone_Shed_V3_F"]],
  40.         [["Land_Ind_SawMill"],["Land_dp_mainFactory_F"]],
  41.         [["Land_HouseV_1I1"],["Land_i_House_Small_02_V1_F"]],
  42.         [["Land_Shed_W4"],["Land_Slum_House03_F"]],
  43.         [["Land_HouseV_1I3"],["Land_i_House_Small_03_V1_F"]],
  44.         [["Land_HouseV_1L2"],["Land_i_House_Big_02_V1_F"]],
  45.         [["Land_Misc_WaterStation"],["Land_ReservoirTank_V1_F"]],
  46.         [["Land_HouseV_2I"],["Land_i_House_Big_01_V3_F"]],
  47.         [["Land_Mil_Barracks_L"],["Land_Cargo_HQ_V1_F"]],
  48.         [["Land_Mil_Barracks"],["Land_Unfinished_building_01_F"]],
  49.         [["Land_A_Office02"],["Land_Offices_01_V1_F"]],
  50.         [["Land_Ind_Workshop01_03"],["Land_Ind_Workshop01_04"]],
  51.         [["Land_Shed_W02"],["Land_Slum_House01_F"]],
  52.         [["Land_HouseV_3I3"],["Land_i_Shop_01_V1_F"]],
  53.         [["Land_HouseV_3I1"],["Land_i_Shop_01_V2_F"]],
  54.         [["Land_HouseV_3I4"],["Land_i_Shop_02_V1_F"]],
  55.         [["Land_HouseV_3I2"],["Land_i_Shop_02_V3_F"]],
  56.         [["Land_HouseV_1L1"],["Land_i_Stone_HouseBig_V2_F"]],
  57.         [["Land_houseV_2T1"],["Land_i_Stone_HouseBig_V3_F"]],
  58.         [["Land_houseV_2T2"],["Land_i_Stone_HouseSmall_V1_F"]],
  59.         [["Land_HouseV_1T"],["Land_i_Stone_HouseSmall_V1_F"]],
  60.         [["Land_HouseV_2L"],["Land_cwa_ryb_domek"]],
  61.         [["Land_HouseV2_03B"],["Land_i_Stone_HouseSmall_V3_F"]],
  62.         [["Land_HouseV2_01A"],["CUP_A1_Cihlovej_dum_in"]],
  63.         [["Land_HouseV2_01B"],["Land_i_House_Small_01_V3_F"]],
  64.         [["Land_HouseV2_03"],["Land_i_House_Big_01_V3_F"]],
  65.         [["Land_HouseV2_02_Interier"],["Land_i_House_Big_02_V2_dam_F"]],
  66.         [["Land_HouseV2_04_interier"],["Land_i_Shop_01_V3_dam_F"]],
  67.         [["Land_HouseV2_05"],["Land_CarService_F"]],
  68.         [["Land_Church_01"],["Land_Chapel_V1_F"]],
  69.         [["Land_Church_02"],["Land_Chapel_V1_F"]],
  70.         [["Land_Church_02a"],["Land_Chapel_V1_F"]],
  71.         [["Land_Mil_Guardhouse"],["Land_Cargo_Tower_V1_No5_F"]]
  72.     ];
  73.    
  74.     private _FFA_LHOUSEV =  [];
  75.     private _FFA_HOUSES =   [];
  76.     private _DMD_FuelPumps = ["Land_A_FuelStation_Feed"];
  77.  
  78.     _FFA_LHOUSEV = nearestObjects [getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition"),["ALL"],15000];
  79.    
  80.     for "_i" from 0 to (count _FFA_LHOUSEV)-1 do {
  81.         private _housev = _FFA_LHOUSEV select _i;
  82.         if !(_housev isKindOf "Lamps_Base_F") then { _housev enableSimulationGlobal false; };
  83.         if ((typeOf _housev) in _DMD_FuelPumps) then {  _housev enableSimulationGlobal true; };
  84.         if ((typeOf _housev) in _DMD_CloseHouse) then { _FFA_HOUSES pushback _housev; };
  85.     };
  86.    
  87.     for "_i" from 0 to (count _FFA_HOUSES)-1 do {
  88.         private _nBuilding = _FFA_HOUSES select _i;
  89.         private _dirVector = vectorDir _nBuilding;
  90.         private _objVector = vectorUp _nBuilding;
  91.         private _worldPos = ASLtoATL getPosASL _nBuilding;
  92.         _nBuilding hideObjectGlobal true;
  93.         deleteVehicle _nBuilding;
  94.        
  95.         _type = "x";
  96.         call {
  97.             { if ((typeof _nbuilding) in (_x select 0)) exitWith { _type = (_x select 1) select 0; }; } forEach _DMD_Replacement_List;
  98.         };
  99.        
  100.         if !(_type isEqualTo "x") then {
  101.             private _house = createVehicle [_type, _worldPos, [], 0, "CAN_COLLIDE"];
  102.             _house setVectorDirAndUp [ _dirVector, _objVector];
  103.             _house enableSimulationGlobal false;
  104.         };
  105.     };
  106.    
  107.     {
  108.         private _posX = _x select 0;
  109.         private _objX = _x select 1;
  110.         private _delObj1 = (_posX nearestObject _objX);
  111.         deleteVehicle _delObj1;
  112.         _delObj1 hideObjectGlobal true;
  113.     } foreach _DMD_AnnoyingShit;
  114. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement