Jump to content
Sign in to follow this  
frattonstation

Vehicle drop from C130

Recommended Posts

If that is a create and not the marker ball that was visible in the first script shouldn't it have a chute, without it I thought they would all get stuck.

Share this post


Link to post
Share on other sites
If that is a create and not the marker ball that was visible in the first script shouldn't it have a chute, without it I thought they would all get stuck.

It does have a chute but it disappears like 50% of the time and the create stops. However the other two creates seem to be fine.

---------- Post added at 08:29 PM ---------- Previous post was at 07:44 PM ----------

Like 10% of the time the C130 seems to do what its told, the rest of the time it sometimes comes close and then turns away or doesnt appear at all! :@ I think it has something to do with if enemies are close or not, is there any way to make the C130 think the enemies are friendly or something to that effect?

Edited by Brute

Share this post


Link to post
Share on other sites

I've tried multiple drops and it fails, the other aircraft start in the right direction and then turn away. I have no enemies so that can't be it.

I've also tried three scripts but get the same result along with three heli pads.

Share this post


Link to post
Share on other sites
I've tried multiple drops and it fails, the other aircraft start in the right direction and then turn away. I have no enemies so that can't be it.

I've also tried three scripts but get the same result along with three heli pads.

That only happens when i have enemies near by, if i clear the map and then try again it seems to work :mad: Very irritating :p

Share this post


Link to post
Share on other sites

I gave up in the end and just made a loop in the script that let IT drop multiple units in one run.

The script needs a few extra features, it should assign different chutes depending on the cargo type and if dropping soldiers it would be useful if it could random them up.

.

Share this post


Link to post
Share on other sites

Is there anyway to give a name to what the C130 drops?

Share this post


Link to post
Share on other sites
I gave up in the end and just made a loop in the script that let IT drop multiple units in one run.

The script needs a few extra features, it should assign different chutes depending on the cargo type and if dropping soldiers it would be useful if it could random them up.

.

Simply find the name of the chute you want in the ArmA 2 library and then replace ParachuteMediumWest with the one you want :)

Share this post


Link to post
Share on other sites

Hi all

I am very new to this and I have got the scrip to work and it great but for the life of me I can not work out how to get to to drop any were on the map that I want it to duing the game.

Just like you do for calling in Artilley

Could some please help with a bit of scriping advice' :D

Share this post


Link to post
Share on other sites

A bit of advice ? Sure, let me throw you a bone ^^

http://www.arma2.com/comref/full.html#onMapSingleClick

Execute the script from "onMapSingleClick" and use an additional variable so it can't be executed too often. Just have a look at airsupport/artillery scripts that use this command and adapt them to your needs.

PS.: The only occasion in which the script didn't work for me was when I called in 5 c130 at once. In that case 1 of them failed to deliver the drop, probably because it had to avoid one of the other 4 planes.

Share this post


Link to post
Share on other sites

Thanks for the Help

It helped out a lot and it is also helping me to understand the coding side of things

Once again thanks

Share this post


Link to post
Share on other sites

Nice script Tajin, thanks.

I've been playing around with it for a few hours now and have made a few tweaks here and there to suit my mission needs. One thing I did notice is that if the cargo and chute just happens to land squarely on a buildings roof, the chute stays erect, so you might want to add "deletevehicle _chute;" at the end of the script, I've set it to delete the chute after 60 sec's just in case.

Krutish.

Share this post


Link to post
Share on other sites

I'm relying on ArmA to remove the chute, it normally does that automatically.

However if you say, the chute stays open when it lands on a building...

Hmm instead of using a delay, I'd say we check the speed of the chute and delete it if the z-velocity hits a value close to 0.

I'll probably update it this evening, will have to test it first though. :o

Thanks for the feedback.

Share this post


Link to post
Share on other sites

You can make things really easy with the BIS functions as well.

Place the Functions module, create a C130 called c1, have it fly past a trigger with this in it's OnAct:

[c1,"HMMWV"] call BIS_fnc_supplyDrop;

Done. :) Use "LAND" for an M2 HMMVW, or "reammobox" for an ammobox.

Share this post


Link to post
Share on other sites

That works fine but how would you get more than one Parachute on the vehilce when it drops, 1 is not appropriate for a large vehicle. :confused:

Share this post


Link to post
Share on other sites
That works fine but how would you get more than one Parachute on the vehilce when it drops, 1 is not appropriate for a large vehicle. :confused:

Instead of using "ParachuteMediumWest" use "ParachuteBigWest".

Share this post


Link to post
Share on other sites

Sorry to revive an older thread, but I'd rather bump this than create a new one.

Can someone help me with dropping a custom crate? The script works perfectly for me already, except that I can't drop a custom crate. Just adding the name of the create in the init isn't working.

nul=[getpos Derringer,"HMMWV_Armored","ammo","HMMWV_Avenger",225] execVM "dropspawn.sqf";

ammo is obviously the crate. All help is appreciated!

Share this post


Link to post
Share on other sites

I think you need to create a class for the new crate, not sure if you can do that without doing it as addon ... think I have seen it mentioned to try and attach the crate to the vehicle and/or maybe fill the vehicle with the needed gear

Share this post


Link to post
Share on other sites
I think you need to create a class for the new crate, not sure if you can do that without doing it as addon ... think I have seen it mentioned to try and attach the crate to the vehicle and/or maybe fill the vehicle with the needed gear

I think I'll just suck it up and use normal crates. I'm nowhere near the level of knowledge for that kind of undertaking. Thanks for the reply though.

Share this post


Link to post
Share on other sites

What I have done is the following; in the dropspawn.sqf I added

_bomb = _spawntype createVehicle _bpos;

_bomb addWeaponCargo ["AK_107_kobra",20];

...

...whatever weapons you want

...

I drop in a Hummer and I can select the weapons I have added in from the back of the vehicle. I did try it with an ammo crate, but it falls through the world..

#_bomb attachTo [_chute,[0,0,2.3]]; did the trick for the world issue I had; Derringer you can use the addWeaponCargo to drop a custom ammo crate, just have to call the script with "USOrdnanceBox" for example

Edited by L_rch

Share this post


Link to post
Share on other sites

This is a rewrite of some code from another thread.

Basically I rewrote the script to use more BIS functions and map click to select the drop zone.

Just preplace the "ingress" marker where you want them to spawn and the "egress" marker where you want them to delete.

[color="SeaGreen"]//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: 1ID-CPL. Venori
//////////////////////////////////////////////////////////////////

// Preplace Functions module, "egress" and "ingress" markers on the map.

/*

null = ["ingressMarkerName","egressMarkerName",["HMMWV","reammobox"]] execVM "SD_Airdrop.sqf";

*/[/color]

[color="SeaGreen"]// Input[/color]
_in = _this select 0; // ingress marker name
_out = _this select 1; // egress marker name
_items = _this select 2; // Item array
SD_item1 = _items select 0; // First item
SD_item2 = _items select 1; // Second item

[color="SeaGreen"]// Config[/color]
_mapMarkText = "Click on the map to designate the supply drop LZ";
_closeMapMessage = "Close the map to initiate drop procedure";
_droppoint = "SD_DropMarker";
_dropMarkerType = "SupplyVehicle";
_incomingMessage = "This is eagle one, we are inbound with supply drop, please stand by...";
_triggerDistance = 200;

[color="SeaGreen"]// Map click to determine where the supplies will be dropped.[/color]
SD_dropmarked = true;
hint _mapMarkText;
_mapString = format["SD_DropMarker = createMarker [""%1"", _pos]; ""%1"" setMarkerType ""%2"";;SD_dropmarked=false",_droppoint, _dropMarkerType];
onMapSingleClick _mapString;
waitUntil{!SD_dropmarked};
onMapSingleClick "";

[color="SeaGreen"]// Wait till they close the map to continue.[/color]
hint _closeMapMessage;
waitUntil{!visibleMap};
hintSilent "";

[color="SeaGreen"]// Have the player toss smoke to mark the spot.[/color]
player playAction "ThrowGrenade";
sleep 2;
SD_smokePot = "Fuel_can" createVehicle (getMarkerPos _droppoint);
[sD_smokePot, [0.4,0.8,0.4]] spawn {
_sh=_this select 0;
_col=_this select 1;
_c1=_col select 0;
_c2=_col select 1;
_c3=_col select 2;

sleep (3+random 1);

_source = "#particlesource" createVehicleLocal getpos _sh;
_source setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48], "", "Billboard", 1, 20, [0, 0, 0], [0.2, 0.1, 0.1], 0, 1.277, 1, 0.025, [0.1, 2, 6], [[_c1, _c2, _c3, 0.2], [_c1, _c2, _c3, 0.05], [_c1, _c2, _c3, 0]], [1.5,0.5], 1, 0.04, "", "", _sh];
_source setParticleRandom [2, [0, 0, 0], [0.25, 0.25, 0.25], 0, 0.5, [0, 0, 0, 0.1], 0, 0, 10];
_source setDropInterval 0.03;
_source2 = "#particlesource" createVehicleLocal getpos _sh;
_source2 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 8, 0], "", "Billboard", 1, 20, [0, 0, 0], [0.2, 0.1, 0.1], 0, 1.277, 1, 0.025, [0.1, 2, 6], [[_c1, _c2, _c3, 1], [_c1, _c2, _c3, 0.5], [_c1, _c2, _c3, 0]], [0.2], 1, 0.04, "", "", _sh];
_source2 setParticleRandom [2, [0, 0, 0], [0.25, 0.25, 0.25], 0, 0.5, [0, 0, 0, 0.2], 0, 0, 360];
_source2 setDropInterval 0.03;
};

[color="SeaGreen"]// Create the group and spawn 2 C130s named SD_c1 and SD_c2[/color]
SD_dg = creategroup west;
_dp = [[(getMarkerPos _in) select 0, (getMarkerPos _in) select 1, 50], 270, "C130J", SD_dg] call BIS_fnc_spawnVehicle;
sleep 2;
_dp2 = [[(getMarkerPos _in) select 0, (getMarkerPos _in) select 1, 50], 270, "C130J", SD_dg] call BIS_fnc_spawnVehicle;
SD_c1 = _dp select 0;
SD_c2 = _dp2 select 0;
SD_planelist = [sD_c1,SD_c2];

[color="SeaGreen"]// Make them fly pretty.[/color]
SD_dg setFormation "COLUMN";
SD_c1 flyinHeight 150;
SD_c2 flyinHeight 200;
[color="SeaGreen"]
// Set the first waypoint to where the marker was placed, second to the egress point.[/color]
_wp = SD_dg addWaypoint [getMarkerpos _droppoint, 1];
_wp1 = SD_dg addWaypoint [getMarkerPos _out, 2];

[color="SeaGreen"]// Delete the crew and planes once they hit the egress point.[/color]
[sD_dg, 2] setWaypointStatements ["true", "{{deleteVehicle _x} forEach crew _x;} foreach units SD_dg; {deletevehicle _x} foreach SD_planelist;"];

[color="SeaGreen"]// Spawn code for organized drop.  First plane hits the marker and drops the first item and three seconds later the trailing plane drops it's cargo.
// This is to prevent a turn towards egress from failing to bring the second plane close enough to the trigger to activate.[/color]
SD_dropCode = {[sD_c1,SD_item1] call BIS_fnc_supplyDrop; sleep 3; [sD_c2,SD_item2] call BIS_fnc_supplyDrop; deleteVehicle SD_smokePot;};

[color="SeaGreen"]// Set up the trigger for the first plane at the location of the drop marker.[/color]
_dt = createTrigger ["EmptyDetector", [0,0,0]];
_dt setTriggerArea [0, 0, 0, true];
_dt setTriggerActivation ["NONE", "PRESENT", false];
_triggerStatements = format["SD_c1 distance (getMarkerPos ""%1"") <= %2;",_droppoint,_triggerDistance];
_dt setTriggerStatements [_triggerStatements, "[] spawn SD_dropCode;", ""];
[color="SeaGreen"]
// Alert player that the supply drop is incoming.[/color]
sleep 5;
(driver SD_c1) sideChat _incomingMessage;

Edited by kylania
Total rewrite and improvement.

Share this post


Link to post
Share on other sites

this script works great..... there is just one thing how ever, it doesn't delete the old maker once the drop is finished. I have tried both deleteMarker and deleteMakerLocal but its still there. so when i call in for another drop it drops it at the old spot and doesn;t make a new marker. i'm still playing around to see what i can do.

thanks

darkone

Share this post


Link to post
Share on other sites

Yeah, this is an older version of it actually. I've got it working much better now, and it deletes the marker.

Only problem I'm having so far is what to do if one/both planes are destroyed inbound and making it multiplayer friendly.

Share this post


Link to post
Share on other sites

Has anyone figured out how to manage the problem of parachutes getting stuck on the trees?

I tried to do something like this:

while { [getPos _chute select 2] > 0.5} do {
_chute_height_1 = [getPos _chute select 2];
sleep 2;
_chute_height_2 = [getPos _chute select 2];
_gap = _chute_height_1 - _chute_height_2;
if (_gap < 0.5) then {
	hint"STUCK!!";
	deleteVehicle _chute;
};
};

But it doesn't work. No hint nada, but I'm noob anyway.

Oh and that is based on the code from here:

   _bpos = _vehicle ModelToWorld [0,-12,-5.5];
   _bomb = _spawntype createVehicle _bpos;
   _bomb setpos _bpos;
   _bomb setDir direction _vehicle;
   _chute = "ParachuteMediumWest" createVehicle getpos _bomb;
   _chute setpos (_bomb ModelToWorld [0,0,3]);
   _bomb attachTo [_chute,[0,0,0]];
   deletevehicle _target;
   sleep 0.05;

Edited by Bunny75

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×