mmmyum

0.51a

May 2nd, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.54 KB | None | 0 0
  1. ///// ///// ///// ///// ///// ///// ///// ///// /////
  2. /////////////////////////////////////////////////////////////////////////////////////
  3. ///////////////mmmyum's random animated air raid dayz////////////////////////////////
  4. /////////////////////////////////////////////////////////////////////////////////////
  5. // v0.5a may 1 2013
  6. // decided to get you guys some kind of update with some of the requested features.
  7. // non-animated version will not be updated at this time, maybe later if there is demand.
  8. // to do following the code
  9. // don't forget to read the readme! (below)
  10. //
  11. //-------------------------------------------------------------------------------------------------------------
  12. // README
  13. // README
  14. // README
  15. // change SETUP sections
  16. // change SETUP section later in code if you want custom bomber spawn in and spawn out locations
  17. // change SET UP AI CODE section if you want AI spawns
  18. // read further comments if you'd like to customize further
  19. //
  20. //IMPORTANT SETUP VALUES: MUST SET THESE FOR CODE TO WORK PROPERLY FOR YOU
  21. //_rmodyn ----- _useRandChoice ---------- _useRandBomb ------------ _spawnynAI -------------_spawnnumAI
  22. //locations list - change if you want less/different locations - if you change me, random(##) must represent number of cases.
  23. //
  24. //---------------------------------------------------------------------------------------------------------------
  25. ///////////////////////////////////////////////////INITIALIZE (DONT CHANGE THIS)
  26.  
  27. private ["_preWaypointPos","_spawnMarker","_spawnRadius","_x","_wp","_espl","_sound","_duration","_aispawncoords","_aispawn","_rndSel","_loc","_city","_z","_xx","_y","_coords","_target","_posdebug","_heliModel","_heliStart","_safetyPoint","_bomberName","_positionLand","_startTime","_bomber","_landingzone2","_aigroup2","_helipilot2","_wp2","_pos","_siren","_pos1","_bombardStart","_bombardDone","_wp3","_repeat","_break","_choice","_rmodyn","_preWaypoints","_sounddist","_ray","_pos2","_targetpos","_poswhistl","_sirenB","_citySwing","_wpT","_citySwing2","_wpT2","_wpLand","_rndSlp","_esp2","_useRandChoice","_useRandBomb","_aiSpawnX","_aiSpawnY","_spawnynAI","_spawnnumAI","_wpLandSpawn","_numbeofBombs","_esp3","_posEsp3","_debugPosEs","_debugPosEs1","_bomberDisT"];
  28. _loc = ["BalottaAirstrip",1.5,4829.9868,2450.1104];
  29. _city = "BalottaAirstrip";
  30. _xx = 4829.9868;
  31. _y = 2450.1104;
  32. _z = 1.5;
  33. _coords = [_xx,_y,_z];
  34. diag_log format ["RANDOM WORLDSPACE: Initializing defaults... %1 | %2 %3 %4|",_city,_xx,_y,_z];
  35. sleep 5;
  36.  
  37.  
  38. ////////////////////////////////////////////////////SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP//SETUP SETUP SETUP
  39. _repeat = 30; //times to repeat//number of times to cycle complete code (pick new place to bomb)
  40. _break = 120; //time to break between attacks, in seconds (time between cycles)
  41. _choice = 1; //type of bombing 1 light, 2 medium, 3 heavy
  42. _useRandChoice = true; //true if you want random choice of type of bomb per bomb
  43. _useRandBomb = true; //true if you want an extra random bomb
  44. _numbeofBombs = 60; // how many bombs are dropped assuming 1 per cycle
  45. _rmodyn = true; //true if you have rMod, 0 if you don't (choice of heli bomber)
  46. _preWaypoints = 0; //add waypoints before arriving at location.
  47. _sounddist = 6000; //distance sounds are audible at
  48. _ray = 120; //ray of bombing
  49. _spawnynAI = true; //true if you want AIs to spawn (sometimes) //MUST SET UP AI CODE for your particular method of spawning AI
  50. _spawnnumAI = 7; //number of times you want AIs to spawn MUST SET UP AI CODE
  51. ////////////////////////////////////////////////////END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP//END SETUP
  52.  
  53.  
  54.  
  55. //BEGIN LOOP! //change to While {true} do... for infinite loops
  56. While {_repeat > 1} do {
  57. _duration = _numbeofBombs;
  58. _rndSel=floor(random 49); //select random number 0-49, then set loc based on the case number//change locations if you'd like, format ["name",z,x,y]//change random number to number of last case
  59. _loc=
  60. switch (_rndSel) do {
  61. case 0: {["BalottaAirstrip",1.5,4829.9868,2450.1104]};
  62. case 1: {["Berenzino",1.5,12954.624,9783.1533]};
  63. case 2: {["Bereznio2",1.5,12043.963,9091.3477]};
  64. case 3: {["BlackMountain",1.5,10276.416,12049.6640]};
  65. case 4: {["Bor",1.5,3320.1643,3938.3496]};
  66. case 5: {["Cherno",1.5,6743.8853,2581.1865]};
  67. case 6: {["DevilsCastle",1.5,6891.9189,11438.73]};
  68. case 7: {["DonsCamp",1.5,7788.2856,12613.048]};
  69. case 8: {["Drozhino",1.5,3442.2849,4955.7129]};
  70. case 9: {["Dubrovka",1.5,10445.011,9868.9912]};
  71. case 10: {["Electro",1.5,10480.69,2217.8027]};
  72. case 11: {["Factory",1.5,13060.078,7094.0596]};
  73. case 12: {["Gorka",1.5,9659.084,8795.334]};
  74. case 13: {["Grishno",1.5,5979.6953,10343.341]};
  75. case 14: {["Guglovo",1.5,8517.8682,6676.3276]};
  76. case 15: {["Gvozdno",1.5,8614.4316,11868.967]};
  77. case 16: {["Kabanino",1.5,5318.8369,8602.6328]};
  78. case 17: {["Kamyshovo",1.5,12127.406,3496.2185]};
  79. case 18: {["Khelm",1.5,12290.833,10904.328]};
  80. case 19: {["Komarovo",1.5,3654.0908,2475.9468]};
  81. case 20: {["Kozlovka",1.5,4483.6777,4616.1675]};
  82. case 21: {["Krastonav",1.5,11212.624,12256.609]};
  83. case 22: {["Lopatino",1.5,2780.3135,10018.82]};
  84. case 23: {["Moglievka",1.5,7544.5845,5148.7822]};
  85. case 24: {["Msta",1.5,11275.323,5495.4053]};
  86. case 25: {["Myshkino",1.5,2019.2487,7327.7178]};
  87. case 26: {["Nadezhdino",1.5,5846.4434,4706.708]};
  88. case 27: {["NEAF",1.5,12073.906,12724.305]};
  89. case 28: {["Nizhnoye",1.5,13002.393,8285.8574]};
  90. case 29: {["NovySobor",1.5,7074.4854,7683.4883]};
  91. case 30: {["NWAF",1.5,4480.0781,10375.544]};
  92. case 31: {["Orlovets",1.5,12146.174,7266.5801]};
  93. case 32: {["Pavlovo",1.5,1693.9392,3845.0657]};
  94. case 33: {["Petrovka",1.5,5014.1143,12493.039]};
  95. case 34: {["Pogorevka",1.5,4473.5957,6411.3198]};
  96. case 35: {["Polana",1.5,10753.393,8132.6606]};
  97. case 36: {["Prigorodki",1.5,7976.5557,3299.5386]};
  98. case 37: {["Pulkovo",1.5,4915.0903,5605.6401]};
  99. case 38: {["Pusta",1.5,9156.2549,3897.7598]};
  100. case 39: {["Pustoshka",1.5,3072.9629,7945.4404]};
  101. case 40: {["Rogovo",1.5,4808.0024,6805.0518]};
  102. case 41: {["Shakhovka",1.5,9654.5244,6555.2583]};
  103. case 42: {["Solnichny",1.5,13454.279,6233.647]};
  104. case 43: {["Soosnovka",1.5,2528.7561,6354.9839]};
  105. case 44: {["Staroye",1.5,10140.659,5434.4302]};
  106. case 45: {["StarySobor",1.5,6143.6167,7721.5176]};
  107. case 46: {["Tulga",1.5,12803.296,4450.7466]};
  108. case 47: {["Vybor",1.5,3815.0635,8865.0938]};
  109. case 48: {["Vyshnoye",1.5,6590.3159,6029.1128]};
  110. case 49: {["Zelenogorsk",1.5,2758.7144,5304.3457]};
  111. };
  112. _city = _loc select 0;
  113. _z = _loc select 1;
  114. _xx = _loc select 2;
  115. _y = _loc select 3;
  116. _coords = [_xx,_y,_z]; ////////////////////////////////////////////////does this need spaces?
  117. diag_log format ["RANDOM WORLDSPACE: %1 | %2",_city,_coords];
  118. sleep 1;
  119. diag_log format ["RANDOM WORLDSPACE SELECTED: %1 | City: %2 | Coords: %3 %4 |||Try %5",_rndSel,_city,_xx,_y,_repeat];
  120.  
  121. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  122. //above ---- the worldpace is selected, coordinates stored in _coords = [_xx,_y,_z]/////////////////////////////////////////////////////////
  123. //below ---- chopper is created, flies to waypoint _coords while sirens play, hangs around till bombs are done flies off and is deleted/////////////
  124. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  125.  
  126. //CREATE TARGET///////////////
  127. _loc = createVehicle ["HeliHEmpty", _coords,[], 0, "NONE"];
  128. _target = createVehicle ["HeliHEmpty",position _loc,[], 0, "NONE"];
  129. _posdebug = position _target;
  130. diag_log format ["AIRRAID: SEL: %1 | TARGET: %2",_posdebug,_coords];
  131. sleep 2;
  132. //Random Heli-Type
  133. if (_rmodyn) then {
  134. _heliModel = ["Mi24_D","MV22"] call BIS_fnc_selectRandom;
  135. } else {
  136. _heliModel = ["UH1H_DZ","Mi17_DZ"] call BIS_fnc_selectRandom;
  137. };
  138.  
  139. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////SETUP//SETUP//SETUP
  140. //Random-Startposition - change to where you want the bomber to come from
  141. _heliStart = [[6993.7007,173.05298,300],[1623.715,218.18848,300]] call BIS_fnc_selectRandom;
  142. //A Backup Waypoint, change to whatever you like - goes here after bombing
  143. _safetyPoint = [7492.6675, 15263.042];
  144. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////SETUP//SETUP//SETUP
  145.  
  146. _bomberName = getText (configFile >> "CfgVehicles" >> _heliModel >> "displayName");
  147. diag_log(format["AIRRAID: BOMBER: %1 | TYPE: %4 Start at %2 | Backup %3",_bomberName,str(_heliStart),str(_safetyPoint),_heliModel]);
  148. _positionLand = [position _target,0,200,5,0,2000,0] call BIS_fnc_findSafePos; //set chopper destination
  149. diag_log(format["AIRRAID: BOMBER: %1 moving from %2 to %3 NOW!( TIME: %4 )", _bomberName, str(_heliStart), str(_positionLand), round(time)]);
  150. //Build bomber
  151. _startTime = time;
  152. _bomber = createVehicle [_heliModel,_heliStart, [], 0, "FLY"];
  153. _bomber setVariable["Sarge",1,true];
  154. _bomber engineOn true;
  155. _bomber flyInHeight 350;
  156. _bomber forceSpeed 180;
  157. //Create an Invisibile Landingpad near place to be bombed
  158. _landingzone2 = createVehicle ["HeliHEmpty", [_positionLand select 0, _positionLand select 1,0], [], 0, "CAN_COLLIDE"]; //_targets x,y
  159. diag_log(format["AIRRAID: BOMBER: LANDINGZONE: %1 | BOMBER POS: %2 | POS LAND: %3 | TARGET: %4",str(getPosATL _landingzone2),str(getPosATL _bomber),str(_positionLand),str(getPosATL _target)]);
  160. //Bandit woman pilot
  161. _aigroup2 = creategroup civilian;
  162. _helipilot2 = _aigroup2 createUnit ["SurvivorW2_DZ",getPos _bomber,[],0,"FORM"];
  163. _helipilot2 moveindriver _bomber;
  164. _helipilot2 assignAsDriver _bomber;
  165. sleep 0.5;
  166. if(_preWaypoints > 0) then {
  167. for "_x" from 1 to _preWaypoints do {
  168. _preWaypointPos = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
  169. };
  170. diag_log(format["AIRRAID: BOMBER: Adding Pre-POC-Waypoint #%1 on %2", _x,str(_preWaypointPos)]);
  171. _wp = _aigroup2 addWaypoint [_preWaypointPos, 0];
  172. _wp setWaypointType "MOVE";
  173. //_wp setWaypointBehaviour "CARELESS";
  174. };
  175. //Tell bomber to move to target
  176. _wp2 = _aigroup2 addWaypoint [position _target, 0];
  177. _wp2 setWaypointType "MOVE";
  178.  
  179.  
  180. waituntil {(_bomber distance _positionLand) <= 4000 || not alive _bomber};
  181. _bomber flyInHeight 300;
  182. _bomber forceSpeed 260;
  183. _bomber setspeedmode "NORMAL";
  184. ///////////////////////////////////////////////////////////////////START SIRENS/////////////////////////////////////////////////////
  185. _pos = position _target;
  186. diag_log format ["AIRRAID: INCOMING ATTACK: Sounding Siren at: %1 %2",_pos,_wp2];
  187. //Create sirens
  188. _siren = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
  189. _sirenB = createVehicle ["HeliHEmpty",position _target,[], 0, "NONE"];
  190. _pos1 = position _siren;
  191. diag_log format ["AIRRAID: DEBUG: SIREN: %1 | TARGET: %2 | POS_TARGET %3",_pos1,_coords,_pos];
  192. diag_log(format["AIRRAID: BOMBER: %1 is at %2!, ", _bomberName, str(getPosATL _bomber)]);
  193. [nil,_siren,rSAY,['eve', _sounddist]] call RE;
  194. sleep 2;
  195. [nil,_sirenB,rSAY,['puk', _sounddist]] call RE;
  196.  
  197. _bomberDisT = _bomber distance _target;
  198. diag_log(format["AIRRAID: BOMBER: DISTANCE: %1 | POSITION: %2",_bomberDisT,str(getPosATL _bomber)]);
  199. while {(_bomberDisT < 2500) and (_bomberDisT > 500)} do {
  200. diag_log(format["AIRRAID: Playing Siren at %1 | Siren Nam %2",str(getPosATL _siren),_sounddist]);
  201. [nil,_siren,rSAY,['nam', _sounddist]] call RE;
  202. sleep 9;
  203. _rndSlp = floor(random 3);
  204. sleep _rndSlp;
  205. _bomberDisT = _bomber distance _pos;
  206. sleep 1;
  207. };
  208.  
  209. [nil,_siren,rSAY,['eve', _sounddist]] call RE;
  210. sleep 4;
  211. sleep _rndSlp;
  212. [nil,_sirenB,rSAY,['puk', _sounddist]] call RE;
  213. sleep 7;
  214.  
  215.  
  216. //waituntil {(_bomber distance _positionLand) <= 1500 || not alive _bomber};
  217. _bomber flyInHeight 350;
  218. _bomber forceSpeed 180;
  219. _bomber setspeedmode "NORMAL";
  220. diag_log(format["AIRRAID: BOMBER: %1 is at %2!, ", _bomberName, str(getPosATL _bomber)]);
  221. [nil,_siren,rSAY,['eve', _sounddist]] call RE;
  222. sleep 12;
  223. [nil,_sirenB,rSAY,['puk', _sounddist]] call RE;
  224. sleep 3;
  225.  
  226. waituntil {(_bomber distance _pos) <= 400 || not alive _bomber};
  227. _bomber flyInHeight 360;
  228. _bomber forceSpeed 90;
  229. _bomber setspeedmode "NORMAL";
  230. [nil,_siren,rSAY,['nam', _sounddist]] call RE;
  231. _citySwing = [position _target,15,25,1,0,2000,0] call BIS_fnc_findSafePos; //set chopper cycle move back and forth over city
  232. _wpT = _aigroup2 addWaypoint [_citySwing, 0];
  233. _wpT setWaypointType "MOVE";
  234. [nil,_siren,rSAY,['eve', _sounddist]] call RE;
  235. _citySwing2 = [position _target,15,25,1,0,2000,0] call BIS_fnc_findSafePos; //set chopper cycle move back and forth over city
  236. _wpT2 = _aigroup2 addWaypoint [_citySwing2, 0];
  237. _wpT2 setWaypointType "MOVE";
  238. _bombardStart = true;
  239. diag_log(format["AIRRAID: BOMBER: %1 Bombing Initialize: arrived at %2!, ", _bomberName, str(getPosATL _bomber)]);
  240. [nil,_siren,rSAY,['nam', _sounddist]] call RE;
  241.  
  242. ///////////////////////////////////////////////////START BOMBING////////////////////////////////////////////////////////////////////
  243. _pos2 = getPosATL _target;
  244. diag_log format ["AIRRAID: Bombing Area: %1 | ATL debug: %2",_posdebug,_pos2];
  245. _debugPosEs = [getPosATL _bomber];
  246. _debugPosEs1 = _debugPosEs select 0;
  247. _debugPosEs1 set [2, 0.1];
  248. sleep 0.2;
  249. _esp3 = createVehicle ["SH_105_HE",_debugPosEs1,[], 0, "NONE"];
  250. _posEsp3 = position _esp3;
  251. diag_log format ["AIRRAID: DEBUG ESP3: %1 | debugPosEs: %2 | debugPosEs1: %3",_posEsp3,_debugPosEs,_debugPosEs1];
  252. ///////////////////////////debug
  253. [nil,_sirenB,rSAY,['puk', _sounddist]] call RE;
  254. sleep 1;
  255. [nil,_siren,rSAY,['nam', _sounddist]] call RE;
  256.  
  257. While {_duration > 0} do {
  258. if (not alive _bomber) exitWith{diag_log format ["AIRRAID: BOMBER DESTROYED: %1",_bomberName]};
  259. if (_useRandChoice) then {
  260. _choice = floor(random 3);
  261. };
  262. sleep 0.1;
  263. _sound = createVehicle ["HeliHEmpty",position _target,[], _ray, "NONE"];
  264. [nil,_sound,rSAY,['mortar1', _sounddist]] call RE;
  265. sleep 2;
  266. If (_choice == 0) then {
  267. _espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
  268. };
  269. If (_choice == 1) then {
  270. _espl = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
  271. };
  272. If (_choice == 2) then {
  273. _espl = createVehicle ["SH_125_HE",position _sound,[], 0, "NONE"];
  274. };
  275. If (_choice == 3) then {
  276. _espl = createVehicle ["BO_GBU12_LGB",position _sound,[], 0, "NONE"];
  277. };
  278.  
  279. if (_duration > 57 || _duration < 3) then {
  280. _pos2 = getPosATL _espl;
  281. _poswhistl = getPosATL _sound;
  282. _targetpos = getPosATL _target;
  283. diag_log format ["AIRRAID: BOMB: %1 | TARGET: %2 | NUMBER: %3 | SOUND %4 | CHOICE %5",str(_pos2),_targetpos,_duration,_poswhistl,_choice];
  284. };
  285. _duration = _duration - 1;
  286. deletevehicle _sound;
  287. sleep (random 2);
  288. if (_useRandBomb) then {
  289. _esp2 = createVehicle ["SH_105_HE",position _sound,[], 0, "NONE"];
  290. };
  291. }; // Close while loop. loop while _duration >1
  292. _bombardDone = true; //set done bombing
  293. ///////////////////////////////////////////////////END SIRENS AND BOMBING, HELI LOWER TO GROUND, (SPAWN AIs), FLY AWAY//////////////////////////////////////////////////////////////
  294.  
  295. //waituntil {_bombardDone}; ///////////////////hover over town until town is bombed to shit
  296. sleep 2;
  297. _wpLandSpawn = [position _landingzone2,5,120,4,0,2000,0] call BIS_fnc_findSafePos; //set chopper cycle move back and forth over city
  298. _wpLand = _aigroup2 addWaypoint [_wpLandSpawn, 0];
  299. _wpLand setWaypointType "MOVE";
  300. _bomber flyInHeight 80;
  301. _bomber forceSpeed 140;
  302. _bomber setspeedmode "NORMAL";
  303. sleep 35;
  304. _bomber flyInHeight 15;
  305. _bomber forceSpeed 0;
  306. _bomber setspeedmode "NORMAL";
  307. sleep 16;
  308. diag_log(format["AIRRAID: BOMBER: %1 has Completed Bombing at %2!", _bomberName, str(getPosATL _bomber)]);
  309. if (_spawnynAI) then {
  310. if (_spawnnumAI > 0) then {
  311. _aispawncoords = position _bomber;
  312. sleep 15;
  313. diag_log(format["AIRRAID: BOMBER: AISPAWN: %1 | NUMBER %2",_aispawncoords,_spawnnumAI]);
  314. _aiSpawnX = _aispawncoords select 0;
  315. _aiSpawnY = _aispawncoords select 1;
  316. _spawnnumAI = _spawnnumAI - 1;
  317.  
  318. /////////////////////////////////////////////////////////////////// //SET UP AI CODE//SET UP AI CODE//SETUP SETUP SETUP//SETUP SETUP SETUP
  319. _aispawn = [[_aiSpawnX,_aiSpawnY,0],5000,20,5] execVM "units\add_unit_server_band.sqf"; //whole map waypoints//SETUP AI CODE HERE SETUP AI CODE HERE SETUP AI CODE HERE
  320. //THIS is how I call AI spawns on my server, you will need to set it up for your own code
  321. //use _aiSpawnX for x coords and _aiSpawnY for y coords - copy how you call AI spawn coords
  322. //SARGE's AI setup example coming soon - when I got time to install it
  323. /////////////////////////////////////////////////////////////// //SET UP AI CODE//SET UP AI CODE//SETUP SETUP SETUP//SETUP SETUP SETUP END SETUP
  324.  
  325. };
  326. };
  327. //Giving the bomber some time to leave
  328. sleep 15;
  329.  
  330. //Adding a last Waypoint up in the North, to send bomber away after completion. Chane this location (_safetypoint) to where you want the AI to seem to originate from
  331. _wp3 = _aigroup2 addWaypoint [_safetyPoint, 0];
  332. _wp3 setWaypointType "MOVE";
  333. //Get position of the helis
  334. //_posBomb = [getpos _bomber select 0, getpos _bomber select 1,0];
  335. sleep 2;
  336. _bomber forceSpeed 200;
  337. _bomber flyInHeight 300;
  338. _bomber setspeedmode "NORMAL";
  339. diag_log(format["AIRRAID: BOMBER: %1 Leaving Area %2!, ", _bomberName, str(getPosATL _bomber)]);
  340.  
  341. //////////////////////////////////////////////////////////CLEAN UP//CLEAN UP//CLEAN UP//
  342. sleep 15;
  343. waituntil {(_bomber distance _safetyPoint) <= 1500 || not alive _bomber};
  344. _bomber setspeedmode "NORMAL";
  345. sleep 3;
  346. deletevehicle _bomber;
  347. sleep 0.1;
  348. deletevehicle _landingzone2;
  349. sleep 0.1;
  350. deletevehicle _helipilot2;
  351. _repeat = _repeat - 1;
  352. sleep 0.1;
  353. deletevehicle _siren;
  354. sleep 0.1;
  355. deletevehicle _loc;
  356. sleep 0.1;
  357. deletevehicle _target;
  358. diag_log format ["AIRRAID: Going down for sleep: Repeat:%1 | Sleep:%2",_repeat,_break];
  359. sleep _break;
  360. }; //close while loop. loop - while _repeat > 1
  361. exit
  362.  
  363. ///////////////////////////////////////////TO DO
  364. //
  365. //bombs start to drop from chopper pos as it hits city borders
  366. ///////////////////-- UP NEXT! see your rpt debug and report if it matches the bomber position message in the forum.
  367. //////////////////////////////also report if the heli seems to be relatively overtop of the town that should be bombed.
  368. //nuke options (this is still a ways off)
  369. //random siren sound selection per rotation (option)
  370. //error handling if chopper is accidentally killed
  371. //clean up extra variables and make efficient
  372. //clean up formatting, comment up, so it's all clear to everyone
  373. //
  374. //
  375. //
  376. //
  377. //SPAWN CRASH SITE
  378. //
  379. // //Animation is done, lets create the actual Crashside
  380. // _crash = createVehicle [_crashModel, _pos, [], 0, "CAN_COLLIDE"];
  381. // _crash setVariable["Sarge",1];
  382. //
  383. // //If you want all Grass around the crashsite to be cutted: Uncomment the next Line (Noobmode)
  384. // _crashcleaner = createVehicle ["ClutterCutter_EP1", _pos, [], 0, "CAN_COLLIDE"];
  385. //
  386. // // I don't think this is needed (you can't get "in" a crash), but it was in the original DayZ Crash logic
  387. // dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_crash];
  388. //
  389. // _crash setVariable ["ObjectID",1,true];
  390. //
  391. // //Make it burn (or not)
  392. // if (_spawnFire) then {
  393. // //["dayzFire",[_crash,2,time,false,_fadeFire]] call broadcastRpcCallAll;
  394. // dayzFire = [_crash,2,time,false,_fadeFire];
  395. // publicVariable "dayzFire";
  396. // _crash setvariable ["fadeFire",_fadeFire,true];
  397. // };
  398. //
  399. // _num = round(random _randomizedLoot) + _guaranteedLoot;
  400. //
  401. // _config = configFile >> "CfgBuildingLoot" >> _lootTable;
  402. // _itemTypes = [] + getArray (_config >> "itemType");
  403. // _index = dayz_CBLBase find "HeliCrash";
  404. // _weights = dayz_CBLChances select _index;
  405. // _cntWeights = count _weights;
  406. //
  407. // //Creating the Lootpiles outside of the _crashModel
  408. // for "_x" from 1 to _num do {
  409. // //Create loot
  410. // _index = floor(random _cntWeights);
  411. // _index = _weights select _index;
  412. // _itemType = _itemTypes select _index;
  413. //
  414. // //Let the Loot spawn in a non-perfect circle around _crashModel
  415. // _lootPos = [_pos, ((random 2) + (sizeOf(_crashModel) * _lootRadius)), random 360] call BIS_fnc_relPos;
  416. // [_itemType select 0, _itemType select 1, _lootPos, 0] call spawn_loot;
  417. //
  418. // diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _lootPos, sizeOf(_crashModel)]);
  419. //
  420. // // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
  421. // _nearby = _pos nearObjects ["ReammoBox", sizeOf(_crashModel)];
  422. // {
  423. // _x setVariable ["permaLoot",true];
  424. // } forEach _nearBy;
  425. // };
  426. //
  427. // //Adding 5 dead soldiers around the wreck, poor guys
  428. // for "_x" from 1 to 5 do {
  429. // _lootPos = [_pos, ((random 4)+3), random 360] call BIS_fnc_relPos;
  430. // _deadBody = createVehicle[["Body1","Body2"] call BIS_fnc_selectRandom,_lootPos,[], 0, "CAN_COLLIDE"];
  431. // _deadBody setDir (random 360);
  432. // };
  433. //
  434. //
  435. // before everything
  436. // //Settings for the Standard UH1H_DZ
  437. // _crashModel = "UH1Wreck_DZ";
  438. // _exploRange = 195;
  439. // _lootRadius = 0.35;
  440. //
  441. // //Adjust Wreck and Range of Explosion if its a Mi17_DZ
  442. // if(_heliModel == "Mi17_DZ") then {
  443. // _crashModel = "Mi8Wreck";
  444. // _exploRange = 285;
  445. // _lootRadius = 0.3;
  446. // };
Advertisement
Add Comment
Please, Sign In to add comment