Kelsey Allen 2 Posted February 4, 2020 Hello! I'm very new to scripting in Arma, or any form of code in general. I"m struggling to get this script to work. My current goal is to throw a green smoke grenade and have a helicopter spawn, fly to the smoke grenade position, drop a supply crate, and fly away. Any help would be amazing! Original script credits go to Tym Cooper's video on helicopter positon to smoke grenades - "https://www.youtube.com/watch?v=e_hOKoOfqfw" and Soolie's supply drop script - "https://forums.bohemia.net/forums/topic/177299-customizable-supply-drop-release/" Arma tells me my error is in this line of code (around line 44) places "lxl" before select 0 _supplyWP2 = _supplyGrp addWaypoint [[(_dropPos select 0)+_supplyRandomLocX, (_dropPos select 1)+_supplyRandomLocY, _dropPos select 2], 2]; HERE is the full script //script start _shooter = _this Select 0; _ammotype = _this Select 4; _dropPos = getpos player nearestObject "SmokeShellBlue"; _supplyBoxFnc = "b_supplycrate_f"; _supplyCargoFnc = { _supplyBoxFnc addWeaponCargoGlobal ["hgun_Pistol_Signal_F",3]; _supplyBoxFnc addMagazineCargoGlobal ["6Rnd_RedSignal_F", 10]; _supplyBoxFnc addWeaponCargoGlobal ["hgun_Pistol_heavy_01_snds_F",3]; _supplyBoxFnc addMagazineCargoGlobal ["11Rnd_45ACP_Mag", 10]; _supplyBoxFnc addWeaponCargoGlobal ["srifle_GM6_LRPS_F",3]; _supplyBoxFnc addMagazineCargoGlobal ["5Rnd_127x108_APDS_Mag", 10]; _supplyBoxFnc addItemCargoGlobal ["V_PlateCarrierGL_rgr", 10]; _supplyBoxFnc addItemCargoGlobal ["U_I_GhillieSuit", 10]; _supplyBoxFnc addBackpackCargoGlobal ["B_AssaultPack_ocamo", 10]; }; //hint format["%1",_ammotype]; sleep 2; switch (_ammotype) do { case "SmokeShellBlue": //add script below { //_supplyLocArray = [+1000,-1375,-1500,-1125,+1250,-1000,+1375,-1250,+1500,+1125]; _supplyLocArray = [+100,-100]; _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; _supply = [[( _player select 0)+_supplyRandomLocX, ( _player select 1)+_supplyRandomLocY, ( _player select 2)+50], 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _supplyHeli = _supply select 0; _supplyHeliPos = getPos _supplyHeli; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _supplyCrew = _supply select 1; _supplyGrp = _supply select 2; _supplyGrp setSpeedMode "FULL"; _supplyGrp setBehaviour "CARELESS"; _supplyWP1 =_supplyGrp addWaypoint [(_dropPos),1]; _supplyWP1 setWaypointType "MOVE"; _supplyWP2 = _supplyGrp addWaypoint [[(_dropPos select 0)+_supplyRandomLocX, (_dropPos select 1)+_supplyRandomLocY, _dropPos select 2], 2]; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _dropPos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; _supplyHeli flyInHeight 150; hint "The supplies are on the way"; _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; _supplyHeli = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; waitUntil {( _supplyLZ distance _supplyHeli)<400}; _supplyHeli animateDoor ["CargoRamp_Open",1]; waitUntil {( _supplyLZ distance _supplyHeli)<200}; sleep 2; _supplyHeli allowDammage false; _supplyBox = createVehicle [_supplyBoxFnc, position _supplyHeli, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; _supplyBox disableCollisionWith _supplyHeli; _supplyHeli disableCollisionWith _supplyBox; _supplyBox allowDammage false; _supplyBox attachTo [_supplyHeli, [0, 0, 0], "CargoRamp"]; _supplyBox setDir ([_supplyBox, _supplyHeli] call BIS_fnc_dirTo); detach _supplyBox; deleteVehicle _supplyLZ; //concerned area [_supplyBox,_supplyCargoFnc,nil,true] call BIS_fnc_MP; [_supplyBox,"FncSupplyLight",nil,true] call BIS_fnc_MP; //concerned area _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; _supplyLight = "Chemlight_green" createVehicle (position _supplyBox); _supplyLight attachTo [_supplyBox, [0,0,0]]; sleep 1; hint "The supplies have been dropped"; _supplyChute hideObject false; _supplyHeli allowDammage true; _supplyBox allowDammage true; _supplyHeli animateDoor ["CargoRamp_Open",0]; //:::::::::::|SMOKE|::::::::::: _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; //::::::::::::::::::::::::::::: waitUntil {(getPos _supplyBox select 2)<2}; detach _supplyBox; _supplyChute setPos [ (getPos _supplyChute select 0)+0.75, getPos _supplyChute select 1, getPos _supplyChute select 2]; hint ""; sleep 5; {deleteVehicle _x;}forEach crew _supplyHeli;deleteVehicle _supplyHeli; }; case "1Rnd_SmokeGreen_Grenade_shell": { Hint "Green SmokeShell Detected"; }; case "FlareGreen_F": { Hint "Green Flare Detected"; }; case "3Rnd_SmokeGreen_Grenade_shell": { Hint "Green SmokeShell Detected"; }; case "UGL_FlareGreen_F": { Hint "Green Flare Detected"; }; case "3Rnd_UGL_FlareGreen_F": { Hint "Green Flare Detected"; }; }; //script end used for players unit init player addEventHandler ["fired",{_this execvm "supply_smoke.sqf"}] Share this post Link to post Share on other sites
Harzach 2517 Posted February 4, 2020 Odd, it seems smoke grenades/shells are objNull after they are thrown/fired now? I don't believe that has always been the case. Found another method HERE that gets the position of the projectile (index 6 from Fired EH) where it stops moving. Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 4, 2020 Okay, that could definitely be an issue. I'll try replacing my find smoke function with this one, see if that works. 👍👍👍 Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 5, 2020 OKAY! That took forever. But script is mostly working! After a blue smoke grenade is thrown by the player, a helicopter will spawn, fly to the smoke grenades position, drop a supply box with a parachute and smoke grenade, fly away, then delete. But... the Supply Box spawns empty in this script. Trying to come up with a way to add random loot to the supply box. If anyone has ideas how to accomplish this let me know! Here is the full script! //script start player addEventHandler ["Fired", { if ((_this select 4) isEqualTo "SmokeShellBlue") then { _grenadeObj = (_this select 6); _doArsenalCrateDrop = [_grenadeObj] spawn { // private ["_grenadePos","_grenadeObj"]; params ["_grenadeObj"]; waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving _grenadeLPos = getPosATL _grenadeObj; // get position of smoke grenade _grenadePos = createMarker ["grenadepos", _grenadeLPos]; // _supplyType = selectRandom ["B_supplyCrate_F"]; // crate type(s) _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s) //_supplyLocArray = [+1000,-1000,1500,-1500, 1300,-1300]; _supplyLocArray = [+500,-500]; _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; /////////////////////////////////////////////////////////////////////////////////////// _heliSpawn = [(_grenadeLPos select 0)+_supplyRandomLocX,(_grenadeLPos select 1)+_supplyRandomLocY, (_grenadeLPos select 2) + 50]; _heliDeSpawn = [(_grenadeLPos select 0)+_supplyRandomLocX,(_grenadeLPos select 1)+_supplyRandomLocY, (_grenadeLPos select 2) + 100]; _heli0 = [_helispawn, 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _helisupp = _heli0 select 0; _supplyHeliPos = getPos _helisupp; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _helicrew = _heli0 select 1; _heligroup = _heli0 select 2; _heligroup setSpeedMode "FULL"; _heligroup setBehaviour "CARELESS"; _wp0 = _heligroup addWaypoint [_grenadeLPos,-1]; _wp0 setWaypointType "MOVE"; _wp1 = _heligroup addWaypoint [_heliDeSpawn,-1]; _wp1 setWaypointType "MOVE"; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _grenadeLpos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; _helisupp flyInHeight 150; // _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; _helisupp = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; waitUntil {( _supplyLZ distance _helisupp)<400}; _helisupp animateDoor ["CargoRamp_Open",1]; _helisupp flyInHeight 80; waitUntil {( _supplyLZ distance _helisupp)<120}; sleep 2; _helisupp flyInHeight 150; _supplyBox = createVehicle ["B_supplyCrate_F", position _helisupp, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; _supplyBox disableCollisionWith _helisupp; _helisupp disableCollisionWith _supplybox; _supplyBox allowDammage false; _supplyBox attachTo [_helisupp, [0, 0, 0], "CargoRamp"]; _supplyBox setDir ([_supplyBox, _helisupp] call BIS_fnc_dirTo); detach _supplyBox; deleteVehicle _supplyLZ; _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; sleep .1; //hint "The supplies have been dropped"; _supplyChute hideObject false; _helisupp allowDammage true; _supplyBox allowDammage true; _helisupp animateDoor ["CargoRamp_Open",0]; //:::::::::::|SMOKE|::::::::::: _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; waitUntil {(getPos _supplyBox select 2)<2}; detach _supplyBox; _supplyChute setPos [ (getPos _supplyChute select 0)+0.75, getPos _supplyChute select 1, getPos _supplyChute select 2]; hint ""; sleep 5; {deleteVehicle _x;}forEach crew _helisupp;deleteVehicle _helisupp; //hint "end"; }; }; }]; //script end Share this post Link to post Share on other sites
Harzach 2517 Posted February 5, 2020 You are spawning an empty crate. _supplyBox = createVehicle ["B_supplyCrate_F", position _helisupp, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; That's fine if you want it to have a random assortment of items, but you'll need to add those items at some point. Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 5, 2020 Yea I was trying to clear it then have a call out to another .sqf to assign random items to _suppyBox. I have found some script that can select and add random loot but I'm not getting how to reference it properly in my script. I've made sure the add item command is referencing the same _supplyBox. I tried to "ExecVM" the random loot .sqf after cleaning the cargo but it errors. Share this post Link to post Share on other sites
Harzach 2517 Posted February 5, 2020 1 hour ago, Kelsey Allen said: I tried to "ExecVM" the random loot .sqf after cleaning the cargo but it errors. Depends on the script you are calling. Assuming that it takes the target supply crate as a param, you might call it thusly: 0 = [_supplyBox] execVM "randomLootScript.sqf"; Where/when you call it probably doesn't matter, as long as it is after you empty the box of course. You might want to wait until it is on the ground and stopped, just to avoid any possible explodey-ness. Next level would be to store this as a function. Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 11, 2020 (edited) OKAY! So here is a working script! It can defiantly be cleaned up and optimized but it works! If any player throws a blue smoke grenade a helicopter will spawn, fly over the some grenades position, and drop a supply crate attached to a parachute. The supply crate will spawn random vanilla loot and supply a random amount of magazines for the chosen random weapons. the helicopter will then fly away and delete. (FYI: sometimes the helicopter fly's a little too high and misses the drop zone trigger and wont delete after flying away) Add this script to a .sqf file and execute it in your init.sqf Spoiler player addEventHandler ["Fired", { if ((_this select 4) isEqualTo "SmokeShellBlue") then { _grenadeObj = (_this select 6); _doArsenalCrateDrop = [_grenadeObj] spawn { private ["_grenadePos","_grenadeObj"]; params ["_grenadeObj"]; waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving _grenadeLPos = getPosATL _grenadeObj; // get position of smoke grenade _grenadePos = createMarker ["grenadepos", _grenadeLPos]; _supplyType = selectRandom ["B_supplyCrate_F"]; // crate type(s) _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s) _supplyLocArray = [+1000,-1000,1500,-1500, 1300,-1300]; //heli spawn/despawn distance _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; _heliSpawn = [(_grenadeLPos select 0) + _supplyRandomLocX, (_grenadeLPos select 1) + _supplyRandomLocY, (_grenadeLPos select 2) + 150]; //grenade position plus helispawn distance _heliDeSpawn = [(_grenadeLPos select 0) + _supplyRandomLocX, (_grenadeLPos select 1) + _supplyRandomLocY, (_grenadeLPos select 2) + 200];//grenade position plus heli despawn distance //HELICOPTER SPAWN _heli0 = [_helispawn, 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _helisupp = _heli0 select 0; _supplyHeliPos = getPos _helisupp; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _helicrew = _heli0 select 1; _heligroup = _heli0 select 2; //WAYPOINT AND MARKER SPAWNS _heligroup setSpeedMode "FULL"; _heligroup setBehaviour "CARELESS"; _wp0 = _heligroup addWaypoint [_grenadeLPos,-1]; _wp0 setWaypointType "MOVE"; _wp1 = _heligroup addWaypoint [_heliDeSpawn,-1]; _wp1 setWaypointType "MOVE"; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _grenadeLpos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; _helisupp flyInHeight 150; _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; //creates object to assign marker position??? idk _helisupp = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; //WAITS TILL HELICOPTER IS CLOSE TO GRENADE POSITION waitUntil {( _supplyLZ distance _helisupp)<400}; _helisupp animateDoor ["CargoRamp_Open",1]; _helisupp flyInHeight 80; waitUntil {( _supplyLZ distance _helisupp)<180}; sleep 2; _helisupp flyInHeight 100; //CREATES AND CLEARS SUPPLY BOX _supplyBox = createVehicle ["B_supplyCrate_F", position _helisupp, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; //DISABLES BOX AND HELI COLISION _supplyBox disableCollisionWith _helisupp; _helisupp disableCollisionWith _supplybox; _supplyBox allowDammage false; _supplyBox attachTo [_helisupp, [0, 0, 0], "CargoRamp"]; _supplyBox setDir ([_supplyBox, _helisupp] call BIS_fnc_dirTo); detach _supplyBox; deleteVehicle _supplyLZ; //CREATE PARACHUTE ON SUPPLYBOX _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; sleep .1; _supplyChute hideObject false; _helisupp allowDammage true; _supplyBox allowDammage true; _helisupp animateDoor ["CargoRamp_Open",0]; //close cargo door //Spawns smoke on Box _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; waitUntil {(getPos _supplyBox select 2)<2}; detach _supplyBox; _supplyChute setPos [ (getPos _supplyChute select 0)+0.75, getPos _supplyChute select 1, getPos _supplyChute select 2]; //// LOOT LISTS //// //FIRST RANDOM WEAPON LIST _weapons_Loot1 = selectRandom[ //LightMachineGuns "arifle_MX_SW_Black_F", "arifle_MX_SW_F", "LMG_Mk200_F", "LMG_Zafir_F", "LMG_03_F", "MMG_01_hex_F", "MMG_01_tan_F", "MMG_02_black_F", "MMG_02_camo_F", "MMG_02_sand_F", //Apex "LMG_03_F", //AssaultRifles "arifle_Katiba_C_F", "arifle_Katiba_F", "arifle_Katiba_GL_F", "arifle_Mk20_F", "arifle_Mk20_GL_F", "arifle_Mk20_GL_plain_F", "arifle_Mk20_plain_F", "arifle_Mk20C_F", "arifle_Mk20C_plain_F", "arifle_MX_Black_F", "arifle_MX_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_F", "arifle_MXC_Black_F", "arifle_MXC_F", "arifle_SDAR_F", "arifle_TRG20_F", "arifle_TRG21_F", "arifle_TRG21_GL_F", //Apex AssaultRifles "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", //AK x2 "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", // "arifle_ARX_blk_F", "arifle_ARX_ghex_F", "arifle_ARX_hex_F", "arifle_CTAR_blk_F", "arifle_CTAR_hex_F", "arifle_CTAR_ghex_F", "arifle_CTAR_GL_blk_F", "arifle_CTARS_blk_F", "arifle_CTARS_hex_F", "arifle_CTARS_ghex_F", "arifle_SPAR_01_blk_F", "arifle_SPAR_01_khk_F", "arifle_SPAR_01_snd_F", "arifle_SPAR_01_GL_blk_F", "arifle_SPAR_01_GL_khk_F", "arifle_SPAR_01_GL_snd_F", "arifle_SPAR_02_blk_F", "arifle_SPAR_02_khk_F", "arifle_SPAR_02_snd_F", "arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F", "arifle_SPAR_03_snd_F", "arifle_MX_khk_F", "arifle_MX_GL_khk_F", "arifle_MXC_khk_F", "arifle_MXM_khk_F", //SniperRifles "arifle_MXM_Black_F", "arifle_MXM_F", "srifle_DMR_01_F", "srifle_DMR_02_camo_F", "srifle_DMR_02_F", "srifle_DMR_02_sniper_F", "srifle_DMR_03_F", "srifle_DMR_03_khaki_F", "srifle_DMR_03_multicam_F", "srifle_DMR_03_tan_F", "srifle_DMR_03_woodland_F", "srifle_DMR_04_F", "srifle_DMR_04_Tan_F", "srifle_DMR_05_blk_F", "srifle_DMR_05_hex_F", "srifle_DMR_05_tan_f", "srifle_DMR_06_camo_F", "srifle_DMR_06_olive_F", "srifle_EBR_F", "srifle_GM6_camo_F", "srifle_GM6_F", "srifle_LRR_camo_F", "srifle_LRR_F", //Apex SniperRifles "srifle_LRR_tna_F", "srifle_GM6_ghex_F", "srifle_DMR_07_blk_F", "srifle_DMR_07_hex_F", "srifle_DMR_07_ghex_F" ]; //SECOND RANDOM WEAPON LIST _weapons_Loot2 = selectRandom[ //LightMachineGuns "arifle_MX_SW_Black_F", "arifle_MX_SW_F", "LMG_Mk200_F", "LMG_Zafir_F", "LMG_03_F", "MMG_01_hex_F", "MMG_01_tan_F", "MMG_02_black_F", "MMG_02_camo_F", "MMG_02_sand_F", //Apex "LMG_03_F", //AssaultRifles "arifle_Katiba_C_F", "arifle_Katiba_F", "arifle_Katiba_GL_F", "arifle_Mk20_F", "arifle_Mk20_GL_F", "arifle_Mk20_GL_plain_F", "arifle_Mk20_plain_F", "arifle_Mk20C_F", "arifle_Mk20C_plain_F", "arifle_MX_Black_F", "arifle_MX_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_F", "arifle_MXC_Black_F", "arifle_MXC_F", "arifle_SDAR_F", "arifle_TRG20_F", "arifle_TRG21_F", "arifle_TRG21_GL_F", //Apex AssaultRifles "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", //AK x2 "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", // "arifle_ARX_blk_F", "arifle_ARX_ghex_F", "arifle_ARX_hex_F", "arifle_CTAR_blk_F", "arifle_CTAR_hex_F", "arifle_CTAR_ghex_F", "arifle_CTAR_GL_blk_F", "arifle_CTARS_blk_F", "arifle_CTARS_hex_F", "arifle_CTARS_ghex_F", "arifle_SPAR_01_blk_F", "arifle_SPAR_01_khk_F", "arifle_SPAR_01_snd_F", "arifle_SPAR_01_GL_blk_F", "arifle_SPAR_01_GL_khk_F", "arifle_SPAR_01_GL_snd_F", "arifle_SPAR_02_blk_F", "arifle_SPAR_02_khk_F", "arifle_SPAR_02_snd_F", "arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F", "arifle_SPAR_03_snd_F", "arifle_MX_khk_F", "arifle_MX_GL_khk_F", "arifle_MXC_khk_F", "arifle_MXM_khk_F", //SniperRifles "arifle_MXM_Black_F", "arifle_MXM_F", "srifle_DMR_01_F", "srifle_DMR_02_camo_F", "srifle_DMR_02_F", "srifle_DMR_02_sniper_F", "srifle_DMR_03_F", "srifle_DMR_03_khaki_F", "srifle_DMR_03_multicam_F", "srifle_DMR_03_tan_F", "srifle_DMR_03_woodland_F", "srifle_DMR_04_F", "srifle_DMR_04_Tan_F", "srifle_DMR_05_blk_F", "srifle_DMR_05_hex_F", "srifle_DMR_05_tan_f", "srifle_DMR_06_camo_F", "srifle_DMR_06_olive_F", "srifle_EBR_F", "srifle_GM6_camo_F", "srifle_GM6_F", "srifle_LRR_camo_F", "srifle_LRR_F", //Apex SniperRifles "srifle_LRR_tna_F", "srifle_GM6_ghex_F", "srifle_DMR_07_blk_F", "srifle_DMR_07_hex_F", "srifle_DMR_07_ghex_F" ]; //LAUNCHERS LIST _weapons_Loot3 = selectRandom[ "launch_NLAW_F", "launch_RPG32_F", "launch_RPG32_ghex_F", "launch_RPG7_F", "launch_RPG7_F", //x2 "launch_Titan_F", "launch_I_Titan_F", "launch_O_Titan_ghex_F", "launch_O_Titan_F", "launch_B_Titan_F", "launch_B_Titan_tna_F", "launch_Titan_short_F", "launch_O_Titan_short_F", "launch_O_Titan_short_ghex_F", "launch_I_Titan_short_F", "launch_B_Titan_short_F", "launch_B_Titan_short_tna_F" ]; //GRENADES,FLARES,SMOKES,EXPOLSIVES LIST _items_loot3 = [ // "Chemlight_blue", // "Chemlight_green", // "Chemlight_red", "SmokeShell", "SmokeShellGreen", "SmokeShellOrange", "SmokeShellPurple", "SmokeShellRed", // "SmokeShellYellow", // "1Rnd_Smoke_Grenade_shell", // "1Rnd_SmokeGreen_Grenade_shell", // "1Rnd_SmokeOrange_Grenade_shell", // "1Rnd_SmokePurple_Grenade_shell", // "1Rnd_SmokeRed_Grenade_shell", // "1Rnd_SmokeYellow_Grenade_shell", // "3Rnd_Smoke_Grenade_shell", // "3Rnd_SmokeGreen_Grenade_shell", // "3Rnd_SmokeOrange_Grenade_shell", // "3Rnd_SmokePurple_Grenade_shell", // "3Rnd_SmokeRed_Grenade_shell", // "3Rnd_SmokeYellow_Grenade_shell", "HandGrenade", "MiniGrenade", "B_IR_Grenade", "O_IR_Grenade", "I_IR_Grenade", "1Rnd_HE_Grenade_shell", "3Rnd_HE_Grenade_shell", "APERSBoundingMine_Range_Mag", "APERSMine_Range_Mag", "APERSTripMine_Wire_Mag", "ClaymoreDirectionalMine_Remote_Mag", "DemoCharge_Remote_Mag", "IEDLandBig_Remote_Mag", "IEDLandSmall_Remote_Mag", "IEDUrbanBig_Remote_Mag", "IEDUrbanSmall_Remote_Mag", "SatchelCharge_Remote_Mag", "SLAMDirectionalMine_Wire_Mag" ]; //FIRST ITEMS LIST _items_loot2 = [ //Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG // "ItemCompass", "ItemWatch", //"ItemRadio", //"ItemGPS", //"ItemMap", //x2 "MediKit", "FirstAidKit", "FirstAidKit", //Tools "Binocular", "Rangefinder", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", //PointerAttachments "acc_flashlight", "acc_pointer_IR", //BipodAttachments "bipod_01_F_blk", "bipod_02_F_blk", "bipod_03_F_blk", //Apex // "bipod_01_F_khk", //MuzzleAttachments "muzzle_snds_338_black", // "muzzle_snds_338_green", "muzzle_snds_338_sand", "muzzle_snds_93mmg", // "muzzle_snds_93mmg_tan", "muzzle_snds_acp", "muzzle_snds_B", "muzzle_snds_H", "muzzle_snds_H_MG", "muzzle_snds_H_SW", "muzzle_snds_L", "muzzle_snds_M", //Apex "muzzle_snds_H_khk_F", // "muzzle_snds_H_snd_F", "muzzle_snds_58_blk_F", "muzzle_snds_m_khk_F", // "muzzle_snds_m_snd_F", "muzzle_snds_B_khk_F", // "muzzle_snds_B_snd_F", "muzzle_snds_58_wdm_F", "muzzle_snds_65_TI_blk_F", // "muzzle_snds_65_TI_hex_F", // "muzzle_snds_65_TI_ghex_F", "muzzle_snds_H_MG_blk_F", // "muzzle_snds_H_MG_khk_F", //OpticAttachments "optic_Aco", "optic_ACO_grn", "optic_ACO_grn_smg", "optic_Aco_smg", "optic_AMS", "optic_AMS_khk", "optic_AMS_snd", "optic_Arco", "optic_DMS", "optic_Hamr", "optic_Holosight", "optic_Holosight_smg", "optic_KHS_blk", "optic_KHS_hex", "optic_KHS_old", "optic_KHS_tan", "optic_LRPS", "optic_MRCO", "optic_MRD", "optic_Nightstalker", "optic_NVS", "optic_SOS", "optic_Yorris", //Apex "optic_Arco_blk_F", "optic_Arco_ghex_F", "optic_DMS_ghex_F", "optic_Hamr_khk_F", "optic_ERCO_blk_F", "optic_ERCO_khk_F", "optic_ERCO_snd_F", "optic_SOS_khk_F", "optic_LRPS_tna_F", "optic_LRPS_ghex_F", "optic_Holosight_blk_F", "optic_Holosight_khk_F", "optic_Holosight_smg_blk_F", //NVG "NVGoggles", "NVGoggles_INDEP", "NVGoggles_OPFOR" //Apex // "O_NVGoggles_hex_F", // "O_NVGoggles_urb_F", // "O_NVGoggles_ghex_F", // "NVGoggles_tna_F" ]; //SECOND ITEMS LIST _items_loot3 = [ //Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG // "ItemCompass", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", "MediKit", "FirstAidKit", // "Binocular", "Rangefinder", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", //PointerAttachments "acc_flashlight", // "acc_pointer_IR", // BipodAttachments // "bipod_01_F_blk", // "bipod_02_F_blk", // "bipod_03_F_blk", //Apex // "bipod_01_F_khk", //MuzzleAttachments "muzzle_snds_338_black", // "muzzle_snds_338_green", "muzzle_snds_338_sand", "muzzle_snds_93mmg", // "muzzle_snds_93mmg_tan", "muzzle_snds_acp", "muzzle_snds_B", // "muzzle_snds_H", "muzzle_snds_H_MG", // "muzzle_snds_H_SW", "muzzle_snds_L", "muzzle_snds_M", //Apex "muzzle_snds_H_khk_F", // "muzzle_snds_H_snd_F", "muzzle_snds_58_blk_F", "muzzle_snds_m_khk_F", // "muzzle_snds_m_snd_F", "muzzle_snds_B_khk_F", // "muzzle_snds_B_snd_F", "muzzle_snds_58_wdm_F", "muzzle_snds_65_TI_blk_F", // "muzzle_snds_65_TI_hex_F", // "muzzle_snds_65_TI_ghex_F", "muzzle_snds_H_MG_blk_F", // "muzzle_snds_H_MG_khk_F", //OpticAttachments "optic_Aco", "optic_ACO_grn", "optic_ACO_grn_smg", "optic_Aco_smg", "optic_AMS", "optic_AMS_khk", "optic_AMS_snd", "optic_Arco", "optic_DMS", "optic_Hamr", "optic_Holosight", "optic_Holosight_smg", "optic_KHS_blk", "optic_KHS_hex", "optic_KHS_old", "optic_KHS_tan", "optic_LRPS", "optic_MRCO", "optic_MRD", "optic_Nightstalker", "optic_NVS", "optic_SOS", // "optic_tws", // "optic_tws_mg", "optic_Yorris", //Apex "optic_Arco_blk_F", "optic_Arco_ghex_F", "optic_DMS_ghex_F", "optic_Hamr_khk_F", "optic_ERCO_blk_F", "optic_ERCO_khk_F", "optic_ERCO_snd_F", "optic_SOS_khk_F", "optic_LRPS_tna_F", "optic_LRPS_ghex_F", "optic_Holosight_blk_F", "optic_Holosight_khk_F", "optic_Holosight_smg_blk_F", // "NVGoggles", // "NVGoggles_INDEP", // "NVGoggles_OPFOR", //Apex "O_NVGoggles_hex_F", "O_NVGoggles_urb_F", "O_NVGoggles_ghex_F", "NVGoggles_tna_F" ]; _supplyLocArray2 = [+2,+1,-1,-2,-3,-4];// ammount randomly added or subtracted from magazine quantities _supplySmallRndm = _supplyLocArray2 select floor random count _supplyLocArray2; _supplyBox addweaponcargoGlobal [_weapons_Loot1, 1]; // [from what loot list, quantity of one random item] _supplyBox addweaponcargoGlobal [_weapons_Loot2, 1]; _supplyBox addweaponcargoGlobal [_weapons_Loot3, 1]; //only launchers _supplyBox addMagazineCargoGlobal [selectRandom _items_loot3, 2]; //[from what loot list,how many different items from list] _supplyBox addItemCargoGlobal [selectRandom _items_loot2, 1]; _supplyBox addItemCargoGlobal [selectRandom _items_loot3, 1]; _magazines_weapon1 = getArray (configFile / "CfgWeapons" / _weapons_Loot1 / "magazines"); _magazineClass_weapon1 = selectRandom _magazines_weapon1; _magazines_weapon2 = getArray (configFile / "CfgWeapons" / _weapons_Loot2 / "magazines"); _magazineClass_weapon2 = selectRandom _magazines_weapon2; _magazines_weapon3 = getArray (configFile / "CfgWeapons" / _weapons_Loot3 / "magazines"); _magazineClass_weapon3 = selectRandom _magazines_weapon3; _supplyBox addMagazineCargoGlobal [_magazineClass_weapon1, 8 +_supplySmallRndm]; //weapon_loot1 magazine quantity _supplyBox addMagazineCargoGlobal [_magazineClass_weapon2, 7 +_supplySmallRndm]; //weapon_loot2 magazine quantity _supplyBox addMagazineCargoGlobal [_magazineClass_weapon3, 3]; //weapon_loot3 (launchers) magazine quantity hint ""; sleep 5; {deleteVehicle _x;}forEach crew _helisupp;deleteVehicle _helisupp; //hint "end"; }; }; }]; Edited February 12, 2020 by Dedmen Put the Code into a Spoiler tag, please don't just paste blobs of text into a post without a spoiler tag 1 Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 12, 2020 (edited) For some reason that last script stopped working and wouldn't drop the cargo... this one should work. My bad! Spoiler player addEventHandler ["Fired", { if ((_this select 4) isEqualTo "SmokeShellRed") then { _grenadeObj = (_this select 6); _doArsenalCrateDrop = [_grenadeObj] spawn { // private ["_grenadePos","_grenadeObj"]; params ["_grenadeObj"]; waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving _grenadeLPos = getPosATL _grenadeObj; // get position of smoke grenade _grenadePos = createMarker ["grenadepos", _grenadeLPos]; // _supplyType = selectRandom ["B_supplyCrate_F"]; // crate type(s) _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s) //_supplyLocArray = [+1000,-1000,1500,-1500, 1300,-1300]; _supplyLocArray = [+500,-500]; _supplyRandomLocX = _supplyLocArray select floor random count _supplyLocArray; _supplyRandomLocY = _supplyLocArray select floor random count _supplyLocArray; /////////////////////////////////////////////////////////////////////////////////////// _heliSpawn = [(_grenadeLPos select 0)+_supplyRandomLocX,(_grenadeLPos select 1)+_supplyRandomLocY, (_grenadeLPos select 2) + 50]; _heliDeSpawn = [(_grenadeLPos select 0)+_supplyRandomLocX,(_grenadeLPos select 1)+_supplyRandomLocY, (_grenadeLPos select 2) + 100]; _heli0 = [_helispawn, 180, "I_Heli_Transport_02_F", WEST] call bis_fnc_spawnvehicle; _helisupp = _heli0 select 0; _supplyHeliPos = getPos _helisupp; _supplyMrkrHeli = createMarker ["supplyMrkrHeli", _supplyHeliPos]; _helicrew = _heli0 select 1; _heligroup = _heli0 select 2; _heligroup setSpeedMode "FULL"; _heligroup setBehaviour "CARELESS"; _wp0 = _heligroup addWaypoint [_grenadeLPos,-1]; _wp0 setWaypointType "MOVE"; _wp1 = _heligroup addWaypoint [_heliDeSpawn,-1]; _wp1 setWaypointType "MOVE"; _supplyMrkrLZ = createMarker ["supplyMrkrLZ", _grenadeLpos]; "supplyMrkrLZ" setMarkerType "Empty"; "supplyMrkrHeli" setMarkerType "Empty"; _helisupp flyInHeight 150; // _supplyMrkrHeliPos = getMarkerPos "supplyMrkrHeli"; _supplyMrkrHeliPos2 = [_supplyMrkrHeliPos select 0, _supplyMrkrHeliPos select 1, (_supplyMrkrHeliPos select 2)+50]; _helisupp = _supplyMrkrHeliPos2 nearestObject "I_Heli_Transport_02_F"; _supplyMrkrLZPos = getMarkerPos "supplyMrkrLZ"; _supplyLZ = createVehicle ["Land_Laptop_device_F", getMarkerPos "supplyMrkrLZ", [], 0, "NONE"]; deleteMarker "supplyMrkrHeli"; deleteMarker "supplyMrkrLZ"; _supplyLZ hideObject true; waitUntil {( _supplyLZ distance _helisupp)<400}; _helisupp animateDoor ["CargoRamp_Open",1]; _helisupp flyInHeight 80; waitUntil {( _supplyLZ distance _helisupp)<120}; sleep 1; // _helisupp flyInHeight 150; _supplyBox = createVehicle ["B_supplyCrate_F", position _helisupp, [], 0, "CAN_COLLIDE"]; clearBackpackCargoGlobal _supplyBox; clearWeaponCargoGlobal _supplyBox; clearMagazineCargoGlobal _supplyBox; clearItemCargoGlobal _supplyBox; _supplyBox disableCollisionWith _helisupp; _helisupp disableCollisionWith _supplybox; _supplyBox allowDammage false; _supplyBox attachTo [_helisupp, [0, 0, 0], "CargoRamp"]; _supplyBox setDir ([_supplyBox, _helisupp] call BIS_fnc_dirTo); detach _supplyBox; deleteVehicle _supplyLZ; _supplyChute = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "CAN_COLLIDE"]; _supplyBox attachTo [_supplyChute,[0,0,-0.5]]; _supplyChute hideObject true; _supplyChute setPos getPos _supplyBox; sleep .1; //hint "The supplies have been dropped"; _supplyChute hideObject false; _helisupp allowDammage true; _supplyBox allowDammage true; _helisupp animateDoor ["CargoRamp_Open",0]; //:::::::::::|SMOKE|::::::::::: _supplySmoke = "SmokeShell" createVehicle (position _supplyBox); _supplySmoke attachTo [_supplyBox, [0,0,0]]; waitUntil {(getPos _supplyBox select 2)<2}; detach _supplyBox; _supplyChute setPos [ (getPos _supplyChute select 0)+0.75, getPos _supplyChute select 1, getPos _supplyChute select 2]; _weapons_Loot1 = selectRandom[ //LightMachineGuns "arifle_MX_SW_Black_F", "arifle_MX_SW_F", "LMG_Mk200_F", "LMG_Zafir_F", "LMG_03_F", "MMG_01_hex_F", "MMG_01_tan_F", "MMG_02_black_F", "MMG_02_camo_F", "MMG_02_sand_F", //Apex "LMG_03_F", //AssaultRifles "arifle_Katiba_C_F", "arifle_Katiba_F", "arifle_Katiba_GL_F", "arifle_Mk20_F", "arifle_Mk20_GL_F", "arifle_Mk20_GL_plain_F", "arifle_Mk20_plain_F", "arifle_Mk20C_F", "arifle_Mk20C_plain_F", "arifle_MX_Black_F", "arifle_MX_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_F", "arifle_MXC_Black_F", "arifle_MXC_F", "arifle_SDAR_F", "arifle_TRG20_F", "arifle_TRG21_F", "arifle_TRG21_GL_F", //Apex AssaultRifles "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", //AK x2 "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", // "arifle_ARX_blk_F", "arifle_ARX_ghex_F", "arifle_ARX_hex_F", "arifle_CTAR_blk_F", "arifle_CTAR_hex_F", "arifle_CTAR_ghex_F", "arifle_CTAR_GL_blk_F", "arifle_CTARS_blk_F", "arifle_CTARS_hex_F", "arifle_CTARS_ghex_F", "arifle_SPAR_01_blk_F", "arifle_SPAR_01_khk_F", "arifle_SPAR_01_snd_F", "arifle_SPAR_01_GL_blk_F", "arifle_SPAR_01_GL_khk_F", "arifle_SPAR_01_GL_snd_F", "arifle_SPAR_02_blk_F", "arifle_SPAR_02_khk_F", "arifle_SPAR_02_snd_F", "arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F", "arifle_SPAR_03_snd_F", "arifle_MX_khk_F", "arifle_MX_GL_khk_F", "arifle_MXC_khk_F", "arifle_MXM_khk_F", //SniperRifles "arifle_MXM_Black_F", "arifle_MXM_F", "srifle_DMR_01_F", "srifle_DMR_02_camo_F", "srifle_DMR_02_F", "srifle_DMR_02_sniper_F", "srifle_DMR_03_F", "srifle_DMR_03_khaki_F", "srifle_DMR_03_multicam_F", "srifle_DMR_03_tan_F", "srifle_DMR_03_woodland_F", "srifle_DMR_04_F", "srifle_DMR_04_Tan_F", "srifle_DMR_05_blk_F", "srifle_DMR_05_hex_F", "srifle_DMR_05_tan_f", "srifle_DMR_06_camo_F", "srifle_DMR_06_olive_F", "srifle_EBR_F", "srifle_GM6_camo_F", "srifle_GM6_F", "srifle_LRR_camo_F", "srifle_LRR_F", //Apex SniperRifles "srifle_LRR_tna_F", "srifle_GM6_ghex_F", "srifle_DMR_07_blk_F", "srifle_DMR_07_hex_F", "srifle_DMR_07_ghex_F" ]; //SECOND RANDOM WEAPON LIST _weapons_Loot2 = selectRandom[ //LightMachineGuns "arifle_MX_SW_Black_F", "arifle_MX_SW_F", "LMG_Mk200_F", "LMG_Zafir_F", "LMG_03_F", "MMG_01_hex_F", "MMG_01_tan_F", "MMG_02_black_F", "MMG_02_camo_F", "MMG_02_sand_F", //Apex "LMG_03_F", //AssaultRifles "arifle_Katiba_C_F", "arifle_Katiba_F", "arifle_Katiba_GL_F", "arifle_Mk20_F", "arifle_Mk20_GL_F", "arifle_Mk20_GL_plain_F", "arifle_Mk20_plain_F", "arifle_Mk20C_F", "arifle_Mk20C_plain_F", "arifle_MX_Black_F", "arifle_MX_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_F", "arifle_MXC_Black_F", "arifle_MXC_F", "arifle_SDAR_F", "arifle_TRG20_F", "arifle_TRG21_F", "arifle_TRG21_GL_F", //Apex AssaultRifles "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", //AK x2 "arifle_AK12_F", "arifle_AK12_GL_F", "arifle_AKM_F", "arifle_AKM_FL_F", "arifle_AKS_F", // "arifle_ARX_blk_F", "arifle_ARX_ghex_F", "arifle_ARX_hex_F", "arifle_CTAR_blk_F", "arifle_CTAR_hex_F", "arifle_CTAR_ghex_F", "arifle_CTAR_GL_blk_F", "arifle_CTARS_blk_F", "arifle_CTARS_hex_F", "arifle_CTARS_ghex_F", "arifle_SPAR_01_blk_F", "arifle_SPAR_01_khk_F", "arifle_SPAR_01_snd_F", "arifle_SPAR_01_GL_blk_F", "arifle_SPAR_01_GL_khk_F", "arifle_SPAR_01_GL_snd_F", "arifle_SPAR_02_blk_F", "arifle_SPAR_02_khk_F", "arifle_SPAR_02_snd_F", "arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F", "arifle_SPAR_03_snd_F", "arifle_MX_khk_F", "arifle_MX_GL_khk_F", "arifle_MXC_khk_F", "arifle_MXM_khk_F", //SniperRifles "arifle_MXM_Black_F", "arifle_MXM_F", "srifle_DMR_01_F", "srifle_DMR_02_camo_F", "srifle_DMR_02_F", "srifle_DMR_02_sniper_F", "srifle_DMR_03_F", "srifle_DMR_03_khaki_F", "srifle_DMR_03_multicam_F", "srifle_DMR_03_tan_F", "srifle_DMR_03_woodland_F", "srifle_DMR_04_F", "srifle_DMR_04_Tan_F", "srifle_DMR_05_blk_F", "srifle_DMR_05_hex_F", "srifle_DMR_05_tan_f", "srifle_DMR_06_camo_F", "srifle_DMR_06_olive_F", "srifle_EBR_F", "srifle_GM6_camo_F", "srifle_GM6_F", "srifle_LRR_camo_F", "srifle_LRR_F", //Apex SniperRifles "srifle_LRR_tna_F", "srifle_GM6_ghex_F", "srifle_DMR_07_blk_F", "srifle_DMR_07_hex_F", "srifle_DMR_07_ghex_F" ]; //LAUNCHERS LIST _weapons_Loot3 = selectRandom[ "launch_NLAW_F", "launch_RPG32_F", "launch_RPG32_ghex_F", "launch_RPG7_F", "launch_RPG7_F", //x2 "launch_Titan_F", "launch_I_Titan_F", "launch_O_Titan_ghex_F", "launch_O_Titan_F", "launch_B_Titan_F", "launch_B_Titan_tna_F", "launch_Titan_short_F", "launch_O_Titan_short_F", "launch_O_Titan_short_ghex_F", "launch_I_Titan_short_F", "launch_B_Titan_short_F", "launch_B_Titan_short_tna_F" ]; //GRENADES,FLARES,SMOKES,EXPOLSIVES LIST _items_loot3 = [ // "Chemlight_blue", // "Chemlight_green", // "Chemlight_red", "SmokeShell", "SmokeShellGreen", "SmokeShellOrange", "SmokeShellPurple", "SmokeShellRed", // "SmokeShellYellow", // "1Rnd_Smoke_Grenade_shell", // "1Rnd_SmokeGreen_Grenade_shell", // "1Rnd_SmokeOrange_Grenade_shell", // "1Rnd_SmokePurple_Grenade_shell", // "1Rnd_SmokeRed_Grenade_shell", // "1Rnd_SmokeYellow_Grenade_shell", // "3Rnd_Smoke_Grenade_shell", // "3Rnd_SmokeGreen_Grenade_shell", // "3Rnd_SmokeOrange_Grenade_shell", // "3Rnd_SmokePurple_Grenade_shell", // "3Rnd_SmokeRed_Grenade_shell", // "3Rnd_SmokeYellow_Grenade_shell", "HandGrenade", "MiniGrenade", "B_IR_Grenade", "O_IR_Grenade", "I_IR_Grenade", "1Rnd_HE_Grenade_shell", "3Rnd_HE_Grenade_shell", "APERSBoundingMine_Range_Mag", "APERSMine_Range_Mag", "APERSTripMine_Wire_Mag", "ClaymoreDirectionalMine_Remote_Mag", "DemoCharge_Remote_Mag", "IEDLandBig_Remote_Mag", "IEDLandSmall_Remote_Mag", "IEDUrbanBig_Remote_Mag", "IEDUrbanSmall_Remote_Mag", "SatchelCharge_Remote_Mag", "SLAMDirectionalMine_Wire_Mag" ]; //FIRST ITEMS LIST _items_loot2 = [ //Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG // "ItemCompass", "ItemWatch", //"ItemRadio", //"ItemGPS", //"ItemMap", //x2 "MediKit", "FirstAidKit", "FirstAidKit", //Tools "Binocular", "Rangefinder", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", //PointerAttachments "acc_flashlight", "acc_pointer_IR", //BipodAttachments "bipod_01_F_blk", "bipod_02_F_blk", "bipod_03_F_blk", //Apex // "bipod_01_F_khk", //MuzzleAttachments "muzzle_snds_338_black", // "muzzle_snds_338_green", "muzzle_snds_338_sand", "muzzle_snds_93mmg", // "muzzle_snds_93mmg_tan", "muzzle_snds_acp", "muzzle_snds_B", "muzzle_snds_H", "muzzle_snds_H_MG", "muzzle_snds_H_SW", "muzzle_snds_L", "muzzle_snds_M", //Apex "muzzle_snds_H_khk_F", // "muzzle_snds_H_snd_F", "muzzle_snds_58_blk_F", "muzzle_snds_m_khk_F", // "muzzle_snds_m_snd_F", "muzzle_snds_B_khk_F", // "muzzle_snds_B_snd_F", "muzzle_snds_58_wdm_F", "muzzle_snds_65_TI_blk_F", // "muzzle_snds_65_TI_hex_F", // "muzzle_snds_65_TI_ghex_F", "muzzle_snds_H_MG_blk_F", // "muzzle_snds_H_MG_khk_F", //OpticAttachments "optic_Aco", "optic_ACO_grn", "optic_ACO_grn_smg", "optic_Aco_smg", "optic_AMS", "optic_AMS_khk", "optic_AMS_snd", "optic_Arco", "optic_DMS", "optic_Hamr", "optic_Holosight", "optic_Holosight_smg", "optic_KHS_blk", "optic_KHS_hex", "optic_KHS_old", "optic_KHS_tan", "optic_LRPS", "optic_MRCO", "optic_MRD", "optic_Nightstalker", "optic_NVS", "optic_SOS", "optic_Yorris", //Apex "optic_Arco_blk_F", "optic_Arco_ghex_F", "optic_DMS_ghex_F", "optic_Hamr_khk_F", "optic_ERCO_blk_F", "optic_ERCO_khk_F", "optic_ERCO_snd_F", "optic_SOS_khk_F", "optic_LRPS_tna_F", "optic_LRPS_ghex_F", "optic_Holosight_blk_F", "optic_Holosight_khk_F", "optic_Holosight_smg_blk_F", //NVG "NVGoggles", "NVGoggles_INDEP", "NVGoggles_OPFOR" //Apex // "O_NVGoggles_hex_F", // "O_NVGoggles_urb_F", // "O_NVGoggles_ghex_F", // "NVGoggles_tna_F" ]; //SECOND ITEMS LIST _items_loot3 = [ //Here ONLY :items , PointerAttachments , BipodAttachments , MuzzleAttachments , OpticAttachments , NVG // "ItemCompass", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", "MediKit", "FirstAidKit", // "Binocular", "Rangefinder", // "ItemWatch", // "ItemRadio", // "ItemGPS", // "ItemMap", //PointerAttachments "acc_flashlight", // "acc_pointer_IR", // BipodAttachments // "bipod_01_F_blk", // "bipod_02_F_blk", // "bipod_03_F_blk", //Apex // "bipod_01_F_khk", //MuzzleAttachments "muzzle_snds_338_black", // "muzzle_snds_338_green", "muzzle_snds_338_sand", "muzzle_snds_93mmg", // "muzzle_snds_93mmg_tan", "muzzle_snds_acp", "muzzle_snds_B", // "muzzle_snds_H", "muzzle_snds_H_MG", // "muzzle_snds_H_SW", "muzzle_snds_L", "muzzle_snds_M", //Apex "muzzle_snds_H_khk_F", // "muzzle_snds_H_snd_F", "muzzle_snds_58_blk_F", "muzzle_snds_m_khk_F", // "muzzle_snds_m_snd_F", "muzzle_snds_B_khk_F", // "muzzle_snds_B_snd_F", "muzzle_snds_58_wdm_F", "muzzle_snds_65_TI_blk_F", // "muzzle_snds_65_TI_hex_F", // "muzzle_snds_65_TI_ghex_F", "muzzle_snds_H_MG_blk_F", // "muzzle_snds_H_MG_khk_F", //OpticAttachments "optic_Aco", "optic_ACO_grn", "optic_ACO_grn_smg", "optic_Aco_smg", "optic_AMS", "optic_AMS_khk", "optic_AMS_snd", "optic_Arco", "optic_DMS", "optic_Hamr", "optic_Holosight", "optic_Holosight_smg", "optic_KHS_blk", "optic_KHS_hex", "optic_KHS_old", "optic_KHS_tan", "optic_LRPS", "optic_MRCO", "optic_MRD", "optic_Nightstalker", "optic_NVS", "optic_SOS", // "optic_tws", // "optic_tws_mg", "optic_Yorris", //Apex "optic_Arco_blk_F", "optic_Arco_ghex_F", "optic_DMS_ghex_F", "optic_Hamr_khk_F", "optic_ERCO_blk_F", "optic_ERCO_khk_F", "optic_ERCO_snd_F", "optic_SOS_khk_F", "optic_LRPS_tna_F", "optic_LRPS_ghex_F", "optic_Holosight_blk_F", "optic_Holosight_khk_F", "optic_Holosight_smg_blk_F", // "NVGoggles", // "NVGoggles_INDEP", // "NVGoggles_OPFOR", //Apex "O_NVGoggles_hex_F", "O_NVGoggles_urb_F", "O_NVGoggles_ghex_F", "NVGoggles_tna_F" ]; _supplyLocArray2 = [+2,+1,-1,-2,-3,-4];// ammount randomly added or subtracted from magazine quantities _supplySmallRndm = _supplyLocArray2 select floor random count _supplyLocArray2; _supplyBox addweaponcargoGlobal [_weapons_Loot1, 1]; // [from what loot list, quantity of one random item] _supplyBox addweaponcargoGlobal [_weapons_Loot2, 1]; _supplyBox addweaponcargoGlobal [_weapons_Loot3, 1]; //only launchers _supplyBox addMagazineCargoGlobal [selectRandom _items_loot3, 2]; //[from what loot list,how many different items from list] _supplyBox addItemCargoGlobal [selectRandom _items_loot2, 1]; _supplyBox addItemCargoGlobal [selectRandom _items_loot3, 1]; _magazines_weapon1 = getArray (configFile / "CfgWeapons" / _weapons_Loot1 / "magazines"); _magazineClass_weapon1 = selectRandom _magazines_weapon1; _magazines_weapon2 = getArray (configFile / "CfgWeapons" / _weapons_Loot2 / "magazines"); _magazineClass_weapon2 = selectRandom _magazines_weapon2; _magazines_weapon3 = getArray (configFile / "CfgWeapons" / _weapons_Loot3 / "magazines"); _magazineClass_weapon3 = selectRandom _magazines_weapon3; _supplyBox addMagazineCargoGlobal [_magazineClass_weapon1, 8 +_supplySmallRndm]; //weapon_loot1 magazine quantity _supplyBox addMagazineCargoGlobal [_magazineClass_weapon2, 7 +_supplySmallRndm]; //weapon_loot2 magazine quantity _supplyBox addMagazineCargoGlobal [_magazineClass_weapon3, 3]; //weapon_loot3 (launchers) magazine quantity hint ""; sleep 5; {deleteVehicle _x;}forEach crew _helisupp;deleteVehicle _helisupp; //hint "end"; }; }; }]; Edited February 12, 2020 by Dedmen Put the Code into a Spoiler tag, please don't just paste blobs of text into a post without a spoiler tag Share this post Link to post Share on other sites
Dedmen 2700 Posted February 12, 2020 6 hours ago, Kelsey Allen said: player addEventHandler ["Fired", { That script is a significant performance killer. Engine Eventhandlers get recompiled on every execution, the bigger your script is, the worse. And your script is HUGE. And it runs on every shot being fired. Give the player a machine gun and watch the fps drop. I'd recommend you use CfgFunctions, and then addEventHandler ["Fired", {call My_fnc_FiredHandler}] Share this post Link to post Share on other sites
Gunter Severloh 4054 Posted February 12, 2020 On 2/3/2020 at 10:08 PM, Kelsey Allen said: My current goal is to throw a green smoke grenade and have a helicopter spawn, fly to the smoke grenade position, drop a supply crate, and fly away. Hmm great idea! Already been done my friend: @Rydygier and myself came up with the same idea but more in depth, heli can pick you up, drop you off, you can have a heli to cas, sling load ammo, or paradrop ammo with or without smoke, pick you up, ect. and you can configure it all through a module for the mod version on through script. The idea for it i had back in 2013 was called green smoker back then, since then we spent a portion of last year testing and making the idea work. I dont want to tread on what you have already figured out or want to do, but i just dont want to see someone reinvent the wheel so to speak, just my humble opinion. But if you have something more specific and want to do it a different way hey thats cool too, just working with code, im sure it will better your coding skills none the less. 1 Share this post Link to post Share on other sites
Kelsey Allen 2 Posted February 13, 2020 On 2/12/2020 at 11:12 AM, Dedmen said: That script is a significant performance killer. Engine Eventhandlers get recompiled on every execution, the bigger your script is, the worse. And your script is HUGE. And it runs on every shot being fired. Give the player a machine gun and watch the fps drop. I'd recommend you use CfgFunctions, and then addEventHandler ["Fired", {call My_fnc_FiredHandler}] Yea, I was realizing that it was eating my fps. I'll definitely try to slim it down but my skills are pretty low with this stuff. On 2/12/2020 at 4:32 PM, Gunter Severloh said: Hmm great idea! Already been done my friend: @Rydygier and myself came up with the same idea but more in depth, heli can pick you up, drop you off, you can have a heli to cas, sling load ammo, or paradrop ammo with or without smoke, pick you up, ect. and you can configure it all through a module for the mod version on through script. The idea for it i had back in 2013 was called green smoker back then, since then we spent a portion of last year testing and making the idea work. I dont want to tread on what you have already figured out or want to do, but i just dont want to see someone reinvent the wheel so to speak, just my humble opinion. But if you have something more specific and want to do it a different way hey thats cool too, just working with code, im sure it will better your coding skills none the less. I'll definitely try your's out! Thanks! Share this post Link to post Share on other sites