smokeOut

generic-crafting-mission.Altis

Jun 7th, 2023
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.80 KB | Gaming | 0 0
  1. // Export of 'altis-01.Altis' by smokeOut on v0.9
  2.  
  3. ///////////////////////////////////////////////////////////////////////////////////////////
  4. // Init
  5. params [["_layerWhiteList",[],[[]]],["_layerBlacklist",[],[[]]],["_posCenter",[0,0,0],[[]]],["_dir",0,[0]],["_idBlacklist",[],[[]]]];
  6. private _allWhitelisted = _layerWhiteList isEqualTo [];
  7. private _layerRoot = (_allWhitelisted || {true in _layerWhiteList}) && {!(true in _layerBlackList)};
  8.  
  9.  
  10. ///////////////////////////////////////////////////////////////////////////////////////////
  11. // Markers
  12. private _markers = [];
  13. private _markerIDs = [];
  14.  
  15.  
  16. ///////////////////////////////////////////////////////////////////////////////////////////
  17. // Groups
  18. private _groups = [];
  19. private _groupIDs = [];
  20.  
  21. private _item25 = grpNull;
  22. if (_layerRoot) then {
  23.     _item25 = createGroup civilian;
  24.     _this = _item25;
  25.     _groups pushback _this;
  26.     _groupIDs pushback 25;
  27. };
  28.  
  29.  
  30. ///////////////////////////////////////////////////////////////////////////////////////////
  31. // Objects
  32. private _objects = [];
  33. private _objectIDs = [];
  34.  
  35. private _item2 = objNull;
  36. if (_layerRoot) then {
  37.     _item2 = createVehicle ["Weapon_hgun_P07_F",[13708.7,12182.1,0],[],0,"CAN_COLLIDE"];
  38.     _this = _item2;
  39.     _objects pushback _this;
  40.     _objectIDs pushback 2;
  41.     _this setPosWorld [13708.7,12182.1,0.991401];
  42.     _this setVectorDirAndUp [[0.819799,0.502889,-0.27392],[0.295525,0.0381894,0.954571]];
  43.     gun1 = _this;
  44.     _this setVehicleVarName "gun1";
  45. };
  46.  
  47. private _item4 = objNull;
  48. if (_layerRoot) then {
  49.     _item4 = createVehicle ["Land_WoodenTable_small_F",[13419,11900.1,0.339372],[],0,"CAN_COLLIDE"];
  50.     _this = _item4;
  51.     _objects pushback _this;
  52.     _objectIDs pushback 4;
  53.     _this setPosWorld [13419,11900.1,14.0156];
  54.     _this setVectorDirAndUp [[0.206674,-0.97841,0],[0,0,1]];
  55. };
  56.  
  57. private _item5 = objNull;
  58. if (_layerRoot) then {
  59.     _item5 = createVehicle ["Land_CampingChair_V2_F",[13417.5,11899.6,0.264827],[],0,"CAN_COLLIDE"];
  60.     _this = _item5;
  61.     _objects pushback _this;
  62.     _objectIDs pushback 5;
  63.     _this setPosWorld [13417.5,11899.6,14.0898];
  64.     _this setVectorDirAndUp [[-0.967244,-0.253847,0],[0,0,1]];
  65. };
  66.  
  67. private _item17 = objNull;
  68. if (_layerRoot) then {
  69.     _item17 = createVehicle ["Land_FMradio_F",[13419.2,11900.6,1.225],[],0,"CAN_COLLIDE"];
  70.     _this = _item17;
  71.     _objects pushback _this;
  72.     _objectIDs pushback 17;
  73.     _this setPosWorld [13419.2,11900.6,14.5204];
  74.     _this setVectorDirAndUp [[-0.799999,-0.600001,0],[0,0,1]];
  75.     radio1 = _this;
  76.     _this setVehicleVarName "radio1";
  77. };
  78.  
  79. private _item18 = objNull;
  80. if (_layerRoot) then {
  81.     _item18 = createVehicle ["Land_FirePlace_F",[13433.5,11902.4,-1.52588e-005],[],0,"CAN_COLLIDE"];
  82.     _this = _item18;
  83.     _objects pushback _this;
  84.     _objectIDs pushback 18;
  85.     _this setPosWorld [13433.5,11902.4,12.7912];
  86.     _this setVectorDirAndUp [[0.900022,0.435712,0.0107389],[-0.0466163,0.0717359,0.996334]];
  87. };
  88.  
  89. private _item26 = objNull;
  90. if (_layerRoot) then {
  91.     _item26 = _item25 createUnit ["C_man_p_fugitive_F_afro",[13418.3,11895.8,0],[],0,"CAN_COLLIDE"];
  92.     _item25 selectLeader _item26;
  93.     _this = _item26;
  94.     _objects pushback _this;
  95.     _objectIDs pushback 26;
  96.     _this setPosWorld [13418.3,11895.8,13.3968];
  97.     _this setVectorDirAndUp [[0.225682,-0.974201,0],[0,0,1]];
  98.     _this setUnitLoadout [[],[],[],["U_I_C_Soldier_Bandit_2_F",[]],[],[],"H_Cap_blk","G_Shades_Green",[],["ItemMap","","","ItemCompass","ItemWatch",""]];
  99.     selectPlayer _this;
  100.     _this setname "Katungi Okoye";;
  101.     _this setface "AfricanHead_02";;
  102.     _this setpitch 0.97;;
  103. };
  104.  
  105. private _item27 = objNull;
  106. if (_layerRoot) then {
  107.     _item27 = createVehicle ["Land_PenBlack_F",[13419,11899.7,1.20183],[],0,"CAN_COLLIDE"];
  108.     _this = _item27;
  109.     _objects pushback _this;
  110.     _objectIDs pushback 27;
  111.     _this setPosWorld [13419,11899.7,14.4663];
  112.     _this setVectorDirAndUp [[-0.971632,-0.236497,0],[0,0,1]];
  113. };
  114.  
  115. private _item28 = objNull;
  116. if (_layerRoot) then {
  117.     _item28 = createVehicle ["Land_Notepad_F",[13419,11899.8,1.1959],[],0,"CAN_COLLIDE"];
  118.     _this = _item28;
  119.     _objects pushback _this;
  120.     _objectIDs pushback 28;
  121.     _this setPosWorld [13419,11899.8,14.459];
  122.     _this setVectorDirAndUp [[-0.3229,0.946433,0],[0,0,1]];
  123.     _this setObjectTextureGlobal [0,"#(argb,8,8,3)color(0.835294,0,0,0.0,ca)"];
  124. };
  125.  
  126. private _item41 = objNull;
  127. if (_layerRoot) then {
  128.     _item41 = createVehicle ["Land_Sleeping_bag_brown_F",[13415.6,11899.2,0.377682],[],0,"CAN_COLLIDE"];
  129.     _this = _item41;
  130.     _objects pushback _this;
  131.     _objectIDs pushback 41;
  132.     _this setPosWorld [13415.6,11899.2,13.6092];
  133.     _this setVectorDirAndUp [[-0.974819,-0.222997,0],[0,0,1]];
  134. };
  135.  
  136. private _item44 = objNull;
  137. if (_layerRoot) then {
  138.     _item44 = createVehicle ["Land_Pillow_grey_F",[13414.9,11898.7,0.440938],[],0,"CAN_COLLIDE"];
  139.     _this = _item44;
  140.     _objects pushback _this;
  141.     _objectIDs pushback 44;
  142.     _this setPosWorld [13414.9,11898.7,13.6454];
  143.     _this setVectorDirAndUp [[0.80129,-0.598272,0.0024221],[-0.0080009,-0.00666765,0.999946]];
  144. };
  145.  
  146. private _item50 = objNull;
  147. if (_layerRoot) then {
  148.     _item50 = createVehicle ["Land_Workbench_01_F",[13414.2,11897,0],[],0,"CAN_COLLIDE"];
  149.     _this = _item50;
  150.     _objects pushback _this;
  151.     _objectIDs pushback 50;
  152.     _this setPosWorld [13414.1,11897,13.6186];
  153.     _this setVectorDirAndUp [[0.965601,0.241041,0.0975355],[-0.0995108,-0.00399438,0.995028]];
  154.     wb1 = _this;
  155.     _this setVehicleVarName "wb1";
  156. };
  157.  
  158. private _item59 = objNull;
  159. if (_layerRoot) then {
  160.     _item59 = createVehicle ["Item_SecretDocuments",[13418.8,11900.4,1.202],[],0,"CAN_COLLIDE"];
  161.     _this = _item59;
  162.     _objects pushback _this;
  163.     _objectIDs pushback 59;
  164.     _this setPosWorld [13418.8,11900.4,14.7157];
  165.     _this setVectorDirAndUp [[-0.769366,-0.638808,0],[0,0,1]];
  166. };
  167.  
  168.  
  169. ///////////////////////////////////////////////////////////////////////////////////////////
  170. // Triggers
  171. private _triggers = [];
  172. private _triggerIDs = [];
  173.  
  174. private _item31 = objNull;
  175. if (_layerRoot) then {
  176.     _item31 = createTrigger ["EmptyDetector",[13419.1,11891.7,0],true];
  177.     _this = _item31;
  178.     _triggers pushback _this;
  179.     _triggerIDs pushback 31;
  180.     _item31 setPosATL [13419.1,11891.7,0];
  181.     _this setTriggerStatements ["time > 1","nul = [this] spawn {while {true} do {playSound3D [getMissionPath '\sfx\track1_hp12.ogg', radio1, true]; sleep 34;playSound3D [getMissionPath '\sfx\track2_hp12.ogg', radio1, true];sleep 19;};};
  182. ",""];
  183.     _this setTriggerText "tr_radio";
  184. };
  185.  
  186. private _item54 = objNull;
  187. if (_layerRoot) then {
  188.     _item54 = createTrigger ["EmptyDetector",[13415.6,11899.1,0.405],true];
  189.     _this = _item54;
  190.     _triggers pushback _this;
  191.     _triggerIDs pushback 54;
  192.     _item54 setPosATL [13415.6,11899.1,0.405];
  193.     _this setTriggerArea [1.2,0.6,346,true,0.25];
  194.     _this setTriggerActivation ["ANYPLAYER","PRESENT",true];
  195.     _this setTriggerStatements ["this","act0 = player addAction [""Sleep ten hours"", {skipTime 10;}];
  196. ","player removeAction act0;"];
  197.     _this setTriggerText "tr_sleep";
  198. };
  199.  
  200. private _item55 = objNull;
  201. if (_layerRoot) then {
  202.     _item55 = createTrigger ["EmptyDetector",[13413.5,11896.8,0],true];
  203.     _this = _item55;
  204.     _triggers pushback _this;
  205.     _triggerIDs pushback 55;
  206.     _item55 setPosATL [13413.5,11896.8,0];
  207.     _this setTriggerArea [1.4,0.6,76,true,1.5];
  208.     _this setTriggerActivation ["ANYPLAYER","PRESENT",true];
  209.     _this setTriggerStatements ["this && bp && col","act0 = player addAction [""Craft magazine"", { player addMagazine ""16Rnd_9x21_Mag"" }];","player removeAction act0;"];
  210.     _this setTriggerText "tr_craft";
  211. };
  212.  
  213. private _item61 = objNull;
  214. if (_layerRoot) then {
  215.     _item61 = createTrigger ["EmptyDetector",[13704.3,12180.5,0],true];
  216.     _this = _item61;
  217.     _triggers pushback _this;
  218.     _triggerIDs pushback 61;
  219.     _item61 setPosATL [13704.3,12180.5,0];
  220.     _this setTriggerArea [10,10,0,false,-1];
  221.     _this setTriggerActivation ["ANYPLAYER","PRESENT",false];
  222.     _this setTriggerStatements ["this && (player hasWeapon ""hgun_P07_F"")","""task1"" call BIS_fnc_deleteTask; col = true;
  223. [side player, ""task1"", [""Craft something"", ""Crafting"", ""craftmarker""],
  224. getPos wb1, ""ASSIGNED"", 2, true] call BIS_fnc_taskCreate;
  225. ",""];
  226.     _this setTriggerText "tr_gun";
  227. };
  228.  
  229. private _item62 = objNull;
  230. if (_layerRoot) then {
  231.     _item62 = createTrigger ["EmptyDetector",[13412.4,11891.1,0],true];
  232.     _this = _item62;
  233.     _triggers pushback _this;
  234.     _triggerIDs pushback 62;
  235.     _item62 setPosATL [13412.4,11891.1,0];
  236.     _this setTriggerStatements ["(""16Rnd_9x21_Mag"" in magazines player)","""task1"" call BIS_fnc_deleteTask;g1 = createGroup [civilian, true];
  237. ""O_G_officer_F"" createUnit [[13593.531, 12200.022, 0],g1,""bot1 = this;"",0.6,""corporal""];
  238. [side player, ""task1"", [""Remove local target"", ""Remove"", ""killmarker""], getPos bot1, ""ASSIGNED"", 2, true] call BIS_fnc_taskCreate;",""];
  239.     _this setTriggerText "tr_hunt";
  240. };
  241.  
  242. private _item64 = objNull;
  243. if (_layerRoot) then {
  244.     _item64 = createTrigger ["EmptyDetector",[13591,12202.1,0],true];
  245.     _this = _item64;
  246.     _triggers pushback _this;
  247.     _triggerIDs pushback 64;
  248.     _item64 setPosATL [13591,12202.1,0];
  249.     _this setTriggerStatements ["!alive bot1","[""END1""] remoteExec [""endMission"", 0, true];",""];
  250.     _this setTriggerText "tr_fin";
  251. };
  252.  
  253.  
  254. ///////////////////////////////////////////////////////////////////////////////////////////
  255. // Group attributes (applied only once group units exist)
  256. _this = _item25;
  257. if !(units _this isEqualTo []) then {
  258.     [_this,0] setWaypointPosition [position leader _this,0];
  259.     _this setGroupID ["Alpha 1-1"];;
  260. };
  261.  
  262.  
  263. ///////////////////////////////////////////////////////////////////////////////////////////
  264. // Waypoints
  265. private _waypoints = [];
  266. private _waypointIDs = [];
  267.  
  268.  
  269. ///////////////////////////////////////////////////////////////////////////////////////////
  270. // Logics
  271. private _logics = [];
  272. private _logicIDs = [];
  273.  
  274.  
  275. ///////////////////////////////////////////////////////////////////////////////////////////
  276. // Layers
  277.  
  278.  
  279. ///////////////////////////////////////////////////////////////////////////////////////////
  280. // Crews
  281.  
  282.  
  283. ///////////////////////////////////////////////////////////////////////////////////////////
  284. // Vehicle cargo
  285.  
  286.  
  287. ///////////////////////////////////////////////////////////////////////////////////////////
  288. // Connections
  289.  
  290.  
  291. ///////////////////////////////////////////////////////////////////////////////////////////
  292. // Inits (executed only once all entities exist; isNil used to ensure non-scheduled environment)
  293. isNil {
  294.     if !(isnull _item26) then {
  295.         this = _item26;
  296.         player enableStamina false; col = false;;
  297.     };
  298.     if !(isnull _item59) then {
  299.         this = _item59;
  300.         bp = false;player addEventHandler ["Take", {_this execVM "blueprint.sqf"}];;
  301.     };
  302. };
  303.  
  304.  
  305. ///////////////////////////////////////////////////////////////////////////////////////////
  306. // Module activations (only once everything is spawned and connected)
  307.  
  308.  
  309. ///////////////////////////////////////////////////////////////////////////////////////////
  310. [[_objects,_groups,_triggers,_waypoints,_logics,_markers],[_objectIDs,_groupIDs,_triggerIDs,_waypointIDs,_logicIDs,_markerIDs]]
  311.  
Advertisement
Add Comment
Please, Sign In to add comment