SeeRocky 0 Posted March 31, 2016 Hi guys I'm currently working on a mission, based on the "hunger games" model. Appart from normal loot, i want to enable supply drops, wich can be activated by throwing a red smoke grenade. I fond a script wich activates a heli extraction by throwing smoke, but i am not able to rewrite the sript for a supply drop. This is the script i found for the heli extraction: //this addEventHandler ["fired",{_this execvm "detect_smoke.sqf"}] _shooter = _this Select 0; _ammotype = _this Select 4; //hint format["%1",_ammotype]; sleep 2; switch (_ammotype) do { case "SmokeShellGreen": { Hint "Green Smoke Detected"; _wp0 = group chopper addWaypoint [ getpos player, 50]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointStatements ["true", "chopper land 'land'"]; waituntil {{_x in chopper}count units blue == {alive _x} count units blue}; _wp1 = group chopper addWaypoint [getpos base, 50]; _wp1 setWaypointType "MOVE"; _wp2 = group chopper addWaypoint [getpos base, 50]; _wp2 setWaypointType "TR UNLOAD"; _wp2 setWaypointStatements ["true", "chopper land 'land';chopper setdamage 1"]; }; 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"; }; }; I also found this script, wich enables a supply crate drop without the module: if(isServer) then { _heli = _this select 0;_chuteType = "B_Parachute_02_F"; //parachute for blufor, for opfor and greenfor replace the 'B' with 'O' or 'G' respectively_crateType = "B_supplyCrate_F"; //ammocrate class for blufor, feel free to change to whichever box you desire _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];_chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 50]; _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];_crate attachTo [_chute, [0, 0, -1.3]];waitUntil {position _crate select 2 < 0.5 || isNull _chute};detach _crate;_crate setPos [position _crate select 0, position _crate select 1, 0]; Can anybody help me to bring these two scripts together? Would be very kind :) Share this post Link to post Share on other sites
sarogahtyp 1108 Posted March 31, 2016 replacing content of the brackets of case "SmokeShellGreen": with the content of the cargo script doesnt work? Share this post Link to post Share on other sites
SeeRocky 0 Posted March 31, 2016 replacing content of the brackets of case "SmokeShellGreen": with the content of the cargo script doesnt work? Yeah. Unfortunately it doesn't work :( Share this post Link to post Share on other sites
R3vo 2654 Posted March 31, 2016 _shooter = _this Select 0; _ammotype = _this Select 4; sleep random 4; switch (_ammotype) do { case "SmokeShellGreen": { hint "Green Smoke Detected"; _heli = createVehicle ["B_Heli_Transport_03_F",_shooter getPos [1500,random 360],[],0,"FLY"]; createVehicleCrew _heli; (group (driver _heli)) addWaypoint [getPosWorld _shooter,100]; waitUntil {_shooter distance2D _heli < 200}; _chuteType = "B_Parachute_02_F"; //parachute for blufor, for opfor and greenfor replace the 'B' with 'O' or 'G' respectively _crateType = "B_supplyCrate_F"; //ammocrate class for blufor, feel free to change to whichever box you desire _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY']; _chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 50]; _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE']; _crate attachTo [_chute, [0, 0, -1.3]]; _crate allowDamage false; waitUntil {position _crate select 2 < 10 || isNull _chute}; detach _crate; _crate allowDamage true; (group (driver _heli)) addWaypoint [_shooter getPos [5000,random 360],100]; waitUntil {_shooter distance2D _heli > 3000}; deleteVehicle _heli; {deleteVehicle _x} forEach crew _heli; }; }; This is by far not perfect, especially not for MP, but maybe it gives you a start. 1 Share this post Link to post Share on other sites
jshock 513 Posted March 31, 2016 Typo on the "allowDamage true" line Revo: _crate not _create :p EDIT: He fixed it :) 2 1 Share this post Link to post Share on other sites
SeeRocky 0 Posted March 31, 2016 @R3vo Thank you so much for the script! :3 and @jshock for the hint ;) I customised the script a bit further but some parts are not working, have you guys an idea how to fix it? _shooter = _this Select 0; _ammotype = _this Select 4; //hint format["%1",_ammotype]; sleep random 4;switch (_ammotype) do{ case "SmokeShellRed": { hint "Red Smoke Detected - Air Drop incomming"; _heli = createVehicle ["B_Heli_Transport_03_F",_shooter getPos [2000,random 360],[],0,"FLY"]; _heli flyInHeight 150; createVehicleCrew _heli; _wp1 = (group (driver _heli)) addWaypoint [getPosWorld _shooter,0];_wp1 setWaypointSpeed "FULL";_wp1 setWaypointCompletionRadius 0; waitUntil {_shooter distance2D _heli < 40}; _chuteType = "B_Parachute_02_F"; //parachute for blufor, for opfor and Redfor replace the 'B' with 'O' or 'G' respectively_crateType = "B_supplyCrate_F"; //ammocrate class for blufor, feel free to change to whichever box you desire_lightType = "Chemlight_red"; // classname of chemlight, attached to the crate _smokeType = "SmokeShellRed"; // classname of smoke, attached to the crate _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];_chute setPos [getPosASL _heli select 0, getPosASL _heli select 1, (getPosASL _heli select 2) - 50]; _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];_crate attachTo [_chute, [0, 0, -1.3]];_crate allowDamage false; //this part does not work _light = createVehicle [_lightType, position _crate, [], 0, 'NONE']; _light attachTo [_crate, [0,0,0.5]];_smoke = createVehicle [_smokeType, position _crate, [], 0, 'NONE']; _smoke attachTo [_crate, [0,0,0.5]]; //customisation of the crate:clearMagazineCargo _crate; clearItemCargo _crate; clearWeaponCargo _crate;_crate addWeaponCargo ["arifle_Katiba_F", 1]_crate addMagazineCargo ["30Rnd_65x39_caseless_green", 3]_crate addItemCargo ["optic_Hamr", 1]//until here (group (driver _heli)) addWaypoint [_shooter getPos [5000,random 360],100];waitUntil {position _crate select 2 < 10 || isNull _chute};detach _crate;_crate allowDamage true;waitUntil {_shooter distance2D _heli > 3000};deleteVehicle _heli;{deleteVehicle _x} forEach crew _heli; }; }; Share this post Link to post Share on other sites