Advertisement
Morbo513

Trigger-spawned helicopter infantry drop-off

Mar 26th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.93 KB | None | 0 0
  1. if(!isServer) exitWith {};
  2. //sleep 1800; // 30-minute countdown
  3.  
  4. // Create invisible helipad for helicopter to land on and as point-of-reference for waypoint creation
  5. QRF_H1_LZ = "Land_HelipadEmpty_F" createVehicle [0,0,0];
  6. // Get random position 200-300m away in random direction from randomly selected player - depends on alias_hunt.sqf
  7.  
  8. pos_H1_LZ = [hunt_alias, 200, 300, 10, 0, 10, 0] call BIS_fnc_findSafePos;
  9. //pos_H1_LZ = [hunt_alias,200+random 100, random 360] call BIS_fnc_relPos;
  10. QRF_H1_LZ setpos pos_H1_LZ;
  11.  
  12. // Create Helicopter 1 at Spawn Marker
  13. H1_AR = [MarkerPos "QRF_H1_S", 0, "rhs_mi8mt_vdv", EAST] call bis_fnc_spawnVehicle;
  14. H1 = H1_AR select 0;
  15. H1 engineOn false;
  16. H1_G = H1_AR select 2;
  17. // Orient helicopter to LZ
  18. H1_DIR = H1 getDir QRF_H1_LZ;
  19. H1 setDir H1_DIR;  
  20. H1 setPos [(getPos H1) select 0, (getPos H1) select 1, 10];
  21.  
  22. // Set Pilot behaviour
  23. H1_G setCombatMode "BLUE";
  24. H1_G setBehaviour "CARELESS";
  25. H1_G setSpeedMode "FULL";
  26.  
  27.  
  28. // Create H1's first waypoint at generated LZ
  29. H1_W1 = H1_G addWaypoint [getPos QRF_H1_LZ, 0];
  30. H1_W1 setWaypointType "TR Unload";
  31. // Pilot behaviour to S&D-friendly settings on completion (?)
  32. H1_W1 setWaypointStatements ["true",""];
  33. H1_W1 setWaypointSpeed "LIMITED";
  34.  
  35. // Create H1's search-and-destroy waypoint at selected player
  36. H1_W2 = H1_G addWaypoint [getPosATL hunt_alias, 0];
  37. H1_W2 setWaypointType "SAD";
  38. // H1_W2 setWaypointBehaviour "AWARE";
  39. H1_W2 setWaypointSpeed "LIMITED";
  40. H1_W2 setWaypointStatements ["True",""];
  41.  
  42.  
  43.  
  44. // Create Infantry Group 1
  45. _spawnPos = getMarkerPos "QRF_H1_S";
  46.  
  47. private _group = createGroup [east, true]; // explicitly mark for cleanup
  48. private _unit = _group createUnit ["O_Soldier_SL_F", _spawnPos, [], 0, "NONE"];
  49. private _leader = group _unit selectLeader _unit;
  50.  
  51. private _counter = 0;
  52. while {_counter < 12} do { // {_counter < # } - Num units of type to spawn
  53.     _newUnit = "O_Soldier_F" createUnit [_spawnPos, _group];
  54.     _newUnit = "O_Soldier_F" createUnit [_spawnPos, _group];
  55.     _newUnit = "O_Soldier_LAT_F" createUnit [_spawnPos, _group];
  56.     _newUnit = "O_Soldier_AR_F" createUnit [_spawnPos, _group];
  57.     _counter = _counter + 4;
  58. };
  59.  
  60. // Move Infantry Group 1 into cargo
  61. // _group moveInCargo H1;
  62.  
  63. // Create infantry "Get out" waypoint at LZ
  64. I1_W1 = _group addWaypoint [getPosATL H1, 0];
  65. I1_W1 setWaypointType "GETIN";
  66. I1_W1 waypointAttachVehicle H1;
  67.  
  68. I1_W2 = _group addWaypoint [getPos QRF_H1_LZ, 0];
  69. I1_W2 setWaypointType "GETOUT";
  70. [H1_G,1] synchronizeWaypoint [_group,2];
  71.  
  72. // Create infantry S&D waypoint at selected player's pos
  73. I1_W3 = _group addWaypoint [getPosATL hunt_alias, 0];
  74. I1_W3 setWaypointType "SAD";
  75. I1_W3 setWaypointStatements ["true",""];
  76. I1_W3 waypointAttachVehicle hunt_alias;
  77. // Attach waypoint to selected player
  78. // I_W2 waypointAttachObject hunt_alias; // - Probably won't work since it asks for an object ID
  79. sleep 5;
  80. H1 flyinheight 20;
  81.  
  82. // Transfer all AI to HC
  83. [true] call potato_zeusHC_fnc_transferGroupsToHC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement