Guest User

build_list.sqf

a guest
Oct 16th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.35 KB | None | 0 0
  1. /*
  2. Build list by Daimyo Client side
  3. Add and remove recipes, Objects(classnames), requirments to build, and town restrictions + extras
  4. This method is used because we are referencing magazines from player inventory as buildables.
  5. Main DEFAULT array (_buildlist) consist of 34 arrays within. These arrays contains parameters for player_build.sqf
  6. From left to right, each array contains 1st: [Recipe Array], 2nd: "Classname", [3rd: Requirements array].
  7. Check comments below for more info on parameters
  8. */
  9. private["_isDestructable","_isSimulated","_disableSims","_objectSims","_objectSim","_requirements","_isStructure","_structure","_wallType","_removable","_buildlist","_build_townsrestrict"];
  10. // Count is 34
  11. // Info on Parameters (Copy and Paste to add more recipes and their requirments!):
  12. //[TankTrap, SandBags, Wires, Logs, Scrap Metal, Grenades, Jerry Can], "Classname", [_attachCoords, _startPos, _modDir, _toolBox, _eTool, _medWait, _longWait, _inBuilding, _roadAllowed, _inTown, _removable, _isStructure, _isSimulated, _isDestructable];
  13. _buildlist = [
  14. [[0, 1, 0, 0, 1, 1, 0], "Grave", [[0,2.5,.1],[0,2,0], 0, true, true, true, false, false, true, true, false, false, true, false]],//Booby Traps --1
  15. [[2, 0, 0, 3, 1, 0, 0], "Concrete_Wall_EP1", [[0,5,1.75],[0,2,0], 0, true, false, true, false, false, true, false, false, false, true, false]],//Gate Concrete Wall --2
  16. [[1, 0, 1, 0, 1, 0, 0], "Infostand_2_EP1", [[0,2.5,.6],[0,2,0], 0, true, false, true, false, false, false, false, false, false, false, false]],//Gate Panel w/ KeyPad --3
  17. [[3, 3, 2, 2, 0, 0, 0], "WarfareBDepot", [[0,18,2], [0,15,0], 90, true, true, false, true, false, false, false, false, true, true, false]],//WarfareBDepot --4
  18. [[4, 1, 2, 2, 0, 0, 0], "Base_WarfareBBarrier10xTall", [0,10,1], [0,10,0], 0, true, true, false, true, false, false, false, false, false, true, false]],//Base_WarfareBBarrier10xTall --5
  19. [[2, 1, 2, 1, 0, 0, 0], "WarfareBCamp", [[0,12,1], [0,10,0], 0, true, true, false, true, false, false, false, false, true, true, false]],//WarfareBCamp --6
  20. [[2, 1, 1, 1, 0, 0, 0], "Base_WarfareBBarrier10x", [[0,10,.6], [0,10,0], 0, true, true, false, true, false, false, false, false, false, true, false]],//Base_WarfareBBarrier10x --7
  21. [[2, 2, 0, 2, 0, 0, 0], "Land_fortified_nest_big", [[0,12,1], [2,8,0], 180,true, true, false, true, false, false, false, false, true, true, false]],//Land_fortified_nest_big --8
  22. [[2, 1, 2, 2, 0, 0, 0], "Land_Fort_Watchtower", [[0,10,2.2],[0,8,0], 90, true, true, false, true, false, false, false, false, true, true, false]],//Land_Fort_Watchtower --9
  23. [[4, 1, 1, 3, 0, 0, 0], "Land_fort_rampart_EP1", [[0,7,.2], [0,8,0], 0, true, true, false, true, false, false, false, true, false, true, false]],//Land_fort_rampart_EP1 --10
  24. [[2, 1, 1, 0, 0, 0, 0], "Land_HBarrier_large", [[0,7,1], [0,4,0], 0, true, true, true, false, false, false, false, false, false, true, false]],//Land_HBarrier_large --11
  25. [[2, 1, 0, 1, 0, 0, 0], "Land_fortified_nest_small", [[0,7,1], [0,3,0], 90, true, true, true, false, false, false, false, false, true, true, false]],//Land_fortified_nest_small --12
  26. [[0, 1, 1, 0, 0, 0, 0], "Land_BagFenceRound", [[0,4,.5], [0,2,0], 180,true, true, false, false, false, false, false, true, false, true, false]],//Land_BagFenceRound --13
  27. [[0, 1, 0, 0, 0, 0, 0], "Land_fort_bagfence_long", [[0,4,.3], [0,2,0], 0, true, true, false, false, false, false, false, true, false, true, false]],//Land_fort_bagfence_long --14
  28. [[6, 0, 0, 0, 2, 0, 0], "Land_Misc_Cargo2E", [[0,7,2.6], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Land_Misc_Cargo2E --15
  29. [[5, 0, 0, 0, 1, 0, 0], "Misc_Cargo1Bo_military", [[0,7,1.3], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Misc_Cargo1Bo_military --16
  30. [[3, 0, 0, 0, 1, 0, 0], "Ins_WarfareBContructionSite", [[0,7,1.3], [0,5,0], 90, true, false, false, true, false, false, false, false, false, true, false]],//Ins_WarfareBContructionSite --17
  31. [[1, 1, 0, 2, 1, 0, 0], "Land_pumpa", [[0,3,.4], [0,3,0], 0, true, true, true, false, false, false, false, true, false, true, false]],//Land_pumpa --18
  32. [[1, 0, 0, 0, 0, 0, 0], "Land_CncBlock", [[0,3,.4], [0,2,0], 0, true, false, false, false, false, true, true, true, false, true, false]],//Land_CncBlock --19
  33. [[4, 0, 0, 0, 0, 0, 0], "Hhedgehog_concrete", [[0,5,.6], [0,4,0], 0, true, true, false, true, false, true, false, false, false, true, false]],//Hhedgehog_concrete --20
  34. [[1, 0, 0, 0, 1, 0, 0], "Misc_cargo_cont_small_EP1", [[0,5,1.3], [0,4,0], 90, true, false, false, false, false, false, false, true, false, true, false]],//Misc_cargo_cont_small_EP1 --21
  35. [[1, 0, 0, 2, 0, 0, 0], "Land_prebehlavka", [[0,6,.7], [0,3,0], 90, true, false, false, false, false, false, false, true, false, true, true]],//Land_prebehlavka(Ramp) --22
  36. [[2, 0, 0, 0, 0, 0, 0], "Fence_corrugated_plate", [[0,4,.6], [0,3,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//Fence_corrugated_plate --23
  37. [[2, 0, 1, 0, 0, 0, 0], "ZavoraAnim", [[0,5,4.0], [0,5,0], 0, true, false, false, false, false, true, false, true, false, true, true]],//ZavoraAnim --24
  38. [[0, 0, 7, 0, 1, 0, 0], "Land_tent_east", [[0,8,1.7], [0,6,0], 0, true, false, false, true, false, false, false, false, true, true, true]],//Land_tent_east --25
  39. [[0, 0, 6, 0, 1, 0, 0], "Land_CamoNetB_EAST", [[0,10,2], [0,10,0], 0, true, false, false, true, false, false, false, true, true, true, true]],//Land_CamoNetB_EAST --26
  40. [[0, 0, 5, 0, 1, 0, 0], "Land_CamoNetB_NATO", [[0,10,2], [0,10,0], 0, true, false, false, true, false, false, false, true, true, true, true]],//Land_CamoNetB_NATO --27
  41. [[0, 0, 4, 0, 1, 0, 0], "Land_CamoNetVar_EAST", [[0,10,1.2],[0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNetVar_EAST --28
  42. [[0, 0, 3, 0, 1, 0, 0], "Land_CamoNetVar_NATO", [[0,10,1.2],[0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNetVar_NATO --29
  43. [[0, 0, 2, 0, 1, 0, 0], "Land_CamoNet_EAST", [[0,8,1.2], [0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNet_EAST --30
  44. [[0, 0, 1, 0, 1, 0, 0], "Land_CamoNet_NATO", [[0,8,1.2], [0,7,0], 0, true, false, true, false, false, false, false, true, false, true, true]],//Land_CamoNet_NATO --31
  45. [[0, 0, 2, 2, 0, 0, 0], "Fence_Ind_long", [[0,5,.6], [-4,1.5,0], 0, true, false, true, false, false, false, false, true, false, true, true]], //Fence_Ind_long --32
  46. [[0, 0, 2, 0, 0, 0, 0], "Fort_RazorWire", [[0,5,.8], [0,4,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//Fort_RazorWire --33
  47. [[0, 0, 3, 1, 0, 1, 0], "SignM_UN_Base_EP1", [[0,5,.8], [0,4,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//UN Base sign FOR NO ZOMBIES
  48. [[1, 0, 0, 0, 2, 0, 0], "Land_Wall_Gate_Ind2Rail_L", [[0,5,.8], [0,4,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//UN Base sign FOR NO ZOMBIES
  49. [[0, 0, 0, 0, 2, 0, 2], "Land_Ind_Tank_Small", [[0,5,.8], [0,4,0], 0, true, false, false, false, false, false, false, true, false, true, true]],//UN Base sign FOR NO ZOMBIES
  50. [[0, 0, 1, 0, 0, 0, 0], "Fence_Ind", [[0,4,.7], [0,2,0], 0, true, false, false, false, false, false, true, true, false, true, true]] //Fence_Ind --34 *** Remember that the last element in array does not get comma ***
  51. ];
  52.  
  53. // Build allremovables array for remove action
  54. for "_i" from 0 to ((count _buildlist) - 1) do
  55. {
  56. _removable = (_buildlist select _i) select _i - _i + 1;
  57. if (_removable != "Grave") then { // Booby traps have disarm bomb
  58. allremovables set [count allremovables, _removable];
  59. };
  60. };
  61. // Build classnames array for use later
  62. for "_i" from 0 to ((count _buildlist) - 1) do
  63. {
  64. _classname = (_buildlist select _i) select _i - _i + 1;
  65. allbuildables_class set [count allbuildables_class, _classname];
  66. };
  67.  
  68. /*
  69. *** Remember that the last element in ANY array does not get comma ***
  70. Notice lines 47 and 62
  71. */
  72. // Towns to restrict from building in. (Type exact name as shown on map, NOT Case-Sensitive but spaces important)
  73. // ["Classname", range restriction];
  74. // This is an example of Tavi town restrictions!
  75. /* << REMOVE THIS IF YOU WANT TO ENABLE (remove bottom one too!)
  76. _build_townsrestrict = [
  77. ["Lyepestok", 1000],
  78. ["Sabina", 900],
  79. ["Branibor", 600],
  80. ["Bilfrad na moru", 400],
  81. ["Mitrovice", 350],
  82. ["Seven", 300],
  83. ["Blato", 300]
  84. ];
  85. */ // << REMOVE THIS IF YOU WANT TO ENABLE (remove top one too!)
  86. // Here we are filling the global arrays with this local list
  87. allbuildables = _buildlist;
  88. allbuild_notowns = _build_townsrestrict;
  89.  
  90.  
  91. /*
  92. This Area is for extra arrays that need to be built via above arrays
  93. */
  94. //Determine Structure buildables to build structures array
  95. for "_i" from 0 to ((count _buildlist) - 1) do
  96. {
  97. _requirements = (_buildlist select _i) select _i - _i + 2;
  98. _isStructure = _requirements select 11;
  99. _structure = (_buildlist select _i) select _i - _i + 1;
  100. if (_isStructure) then {
  101. structures set [count structures, _structure];
  102. };
  103. };
  104.  
  105. //Build all buildables (not just walls) for antiWall script
  106. for "_i" from 0 to ((count _buildlist) - 1) do
  107. {
  108. _wallType = (_buildlist select _i) select _i - _i + 1;
  109. //Add more exceptions here so that when players get out of vehicles, they wont call anti-wall with these objects
  110. if (_walltype != "Grave" && _walltype != "Infostand_2_EP1" && _walltype != "Land_pumpa" && _walltype != "ZavoraAnim") then {
  111. wallarray set [count wallarray, _wallType];
  112. };
  113. };
  114. //Disable physics locally on objects that we dont want moving (for now, gate panel)
  115. _objectSims = [];
  116. for "_i" from 0 to ((count _buildlist) - 1) do
  117. {
  118. _requirements = (_buildlist select _i) select _i - _i + 2;
  119. _isSimulated = _requirements select 12;
  120. _objectSim = (_buildlist select _i) select _i - _i + 1;
  121. //Add more exceptions here so that when players get out of vehicles, they wont call anti-wall with these objects
  122. if (!_isSimulated) then {
  123. _objectSims set [count _objectSims, _objectSim];
  124. };
  125. };
  126. //Now we have array, lets disable simulation locally on all objects that require it (basically disabling physics for these)
  127. _disableSims = nearestObjects [player, _objectSims, 30000];
  128. {
  129. _x enableSimulation false;
  130. } foreach _disableSims;
Advertisement
Add Comment
Please, Sign In to add comment