Jump to content
[evo] dan

Supply Dropping without using the module

Recommended Posts

My question is there any way of making a cargo chute and ammobox drop fall from the sky together just like the supply drop modules, without using an aircraft and without using the module as that creates a heli (even for the virtual ammo drop). As I want it as a call in from an add action script.

Thank you for any help.

Edited by [EVO] Dan

Share this post


Link to post
Share on other sites

I presume it would be a case of spawning the parachute at a set height and then attach the ammo box to the chute... but as far as what we have tested within our mission, it has come to light that the ammo box has issues with a parachute and the only way we found was to spawn it directly on the ground after the chute closes.... Someone please prove me wrong :)

I would like to see if its the case in the Module that the Chute and ammo box do spawn together and fall to the ground? and see exactly in scripting how its done :)

Share this post


Link to post
Share on other sites

This is how the module does it

_wp1 setWaypointStatements ["TRUE", "
[this, this getVariable 'BIS_SUPP_supportRunCoords', ['B_Parachute_02_F', 'O_Parachute_02_F', 'I_Parachute_02_F'] select ([WEST, EAST, RESISTANCE] find side group this), ['B_supplyCrate_F', 'O_supplyCrate_F', 'I_supplyCrate_F'] select ([WEST, EAST, RESISTANCE] find side group this), this getVariable 'BIS_SUPP_selectedModule'] spawn {
	_pilot = _this select 0;
	_wpPos = _this select 1;
	_chuteType = _this select 2;
	_crateType = _this select 3;
	_crateCode = compile ((_this select 4) getVariable 'BIS_SUPP_crateInit');
	_oldDist = _pilot distance _wpPos;
	while {_oldDist >= _pilot distance _wpPos} do {
		_oldDist = _pilot distance _wpPos;
		sleep 0.1
	};
	_pilot setVariable ['BIS_SUPP_supporting', FALSE];
	_chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
	_chute setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
	_crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];
	debuglog str _crateCode;
	_crate call _crateCode;
	_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]
}
"];

Inside a waypoint statement but im sure you can pick the necessary bits out of that.

Share this post


Link to post
Share on other sites

Still haven't been able to get it to work for me unfortunately, has anybody else been having any luck because I want to be able to use this for a pre arranged drop by the AI during a mission.

Share this post


Link to post
Share on other sites

Are you trying to use the modules or just the spawn/drop a crate code from that example there?

Share this post


Link to post
Share on other sites

drop a crate from the code, but am still looking at doing it

---------- Post added at 10:27 PM ---------- Previous post was at 08:33 PM ----------

I have come up with 2 scripts that do either of the things I wanted them to do regarding the drops, here they are:

Dropping onto a marker:

        /*
	v1.0
	This script was created by [EVO] Dan, with help from [EVO] Curry, with snippets from the BIS module, this script creates a parachute and a box, then drops it. When it contacts the ground it will run VAS.
	You will need VAS from Tonic in your mission if you want VAS to be activated with the box!

	To use this, you also need to add the following to your init.sqf:
	mis_fnc_boxInit = {  _this addAction ["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; };
	or else this will not work.

	In the editor you can place this in a trigger with the following 'on activation' code:
	0 = ["lz"] execVM "boxdroponmarker.sqf"
	Where "lz" is the name of the marker you want to drop the crate on.	
	*/

	if(isServer) then {
	_wpPos = _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 [getMarkerPos _wpPos select 0, getMarkerPos _wpPos select 1, 100];
	_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];
	[_crate, "mis_fnc_boxInit"] spawn BIS_fnc_MP; //remove this if you don't want VAS on your box
	};

Dropping from a heli:

		/*
	v1.0
	This script was created by [EVO] Dan, with help from [EVO] Curry, with snippets from the BIS module, this script creates a parachute and a box, then drops it from a heli. When it contacts the ground it will run VAS.
	You will need VAS from Tonic in your mission if you want VAS to be activated with the box!

	To use this, you also need to add the following to your init.sqf:
	mis_fnc_boxInit = {  _this addAction ["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; };
	or else this will not work.

	To get it to work ingame you need to create a manned heli with waypoints, and then at the waypoint you wish it to drop insert the following code into the waypoints 'on activation' box:
	0 = [heli1] execVM "boxdropfromheli.sqf"
	where 'heli1' is the name that you gave your heli.
	*/

	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];
	[_crate, "mis_fnc_boxInit"] spawn BIS_fnc_MP; //remove this if you don't want VAS on your box
	};

Share this post


Link to post
Share on other sites
Dan;2465840']drop a crate from the code' date=' but am still looking at doing it

---------- Post added at 10:27 PM ---------- Previous post was at 08:33 PM ----------

I have come up with 2 scripts that do either of the things I wanted them to do regarding the drops, here they are:

Dropping onto a marker:

        /*
	v1.0
	This script was created by [EVO] Dan, with help from [EVO] Curry, with snippets from the BIS module, this script creates a parachute and a box, then drops it. When it contacts the ground it will run VAS.
	You will need VAS from Tonic in your mission if you want VAS to be activated with the box!

	To use this, you also need to add the following to your init.sqf:
	mis_fnc_boxInit = {  _this addAction ["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; };
	or else this will not work.

	In the editor you can place this in a trigger with the following 'on activation' code:
	0 = ["lz"] execVM "boxdroponmarker.sqf"
	Where "lz" is the name of the marker you want to drop the crate on.	
	*/

	if(isServer) then {
	_wpPos = _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 [getMarkerPos _wpPos select 0, getMarkerPos _wpPos select 1, 100];
	_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];
	[_crate, "mis_fnc_boxInit"] spawn BIS_fnc_MP; //remove this if you don't want VAS on your box
	};

Dropping from a heli:

		/*
	v1.0
	This script was created by [EVO] Dan, with help from [EVO] Curry, with snippets from the BIS module, this script creates a parachute and a box, then drops it from a heli. When it contacts the ground it will run VAS.
	You will need VAS from Tonic in your mission if you want VAS to be activated with the box!

	To use this, you also need to add the following to your init.sqf:
	mis_fnc_boxInit = {  _this addAction ["<t color='#ff1111'>Virtual Ammobox</t>", "VAS\open.sqf"]; };
	or else this will not work.

	To get it to work ingame you need to create a manned heli with waypoints, and then at the waypoint you wish it to drop insert the following code into the waypoints 'on activation' box:
	0 = [heli1] execVM "boxdropfromheli.sqf"
	where 'heli1' is the name that you gave your heli.
	*/

	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];
	[_crate, "mis_fnc_boxInit"] spawn BIS_fnc_MP; //remove this if you don't want VAS on your box
	};

I was able to mostly get this working. The trouble is that that chute doesn't go down properly. It takes nearly a full 2 minutes for it to collapse. Any solutions?

Share this post


Link to post
Share on other sites

I think you might be able to delete the chute when done. Besides that I've got nothing.

Share this post


Link to post
Share on other sites
Guest HellGhost

Hi all,

Sorry to dig up this old thread, but I have a partial answer for you.

I'm working on a script for H.A.L.O from a C-130 from a mod.

All work, I'm in the cargo bay, I run to the open ramp and I can chute without problem when reach the end, detach the plane after exiting the bay, the plane fly over then being deleted.

I fall and open chute, then land.

All good.

Then, I do the same for supply.

My first idea was to drop a boat with "setVelocity" to get it launch out of the bay, it work, the vehicle fall, and after a moment, I create a chute and attach the vehicle to the chute.

And not the inverse process, attach the chute to the object get the chute falling at the same speed than the vehicle.

So the vehicle reach the ground.

To avoid the problem when the vehicle get inside the ground level, I just detach it when the vehicle reach under 4 meters above terrain level.

The vehicle just hit slowly the ground without any damages and the chute just fall and disappear.

All good.

But for an unknow reason, when I do the same with an ammobox...

The object fall, the chute open and then just after disappear like he already reach the ground.

I have no idea why this thing happens and how to fix it until now.

If I don't find any solution, I think to attach a vehicle, hide it with "hideObject" then attach the chute to the vehicle then delete it when I detach the chute.

If this can help you.

I can do a video if you want.

EDIT : Problem solved with the ammoboxes.

It's just that I must assure myself that the object is attached to the chute under the chute when it's generated.

Without that, the chute generated block the fall of the object, and like the object is slow, the chute act like the object as already touch the ground.

Edited by HellGhost

Share this post


Link to post
Share on other sites

I think I'm having the same issue the HellGhost had where the parachute disappears when the crate is attatched.

HellGhost can you describe how you solved this ?

Weirdizum

Share this post


Link to post
Share on other sites

I have a good script someone made, I will post that when I get home later. Its using the virtual arsenal. but I am sure you could add VAS too. It can spawn from trigger so.....

Share this post


Link to post
Share on other sites
Guest HellGhost

Weirdizum :

Yes, maybe you don't see it, I edit my post to informed how I solved this problem.

In fact, it's just a session of test.

When you select the "attachTo" command to attach the object to the parachute, you must clearly place the crate UNDER the parachute.

So, for me, I used this for the example when I have the crate in the cargo, and detach it then eject it from the cargo.

I let it fall, then generate a parachute at the same place than the crate, then attach the crate to the parachute.

I detach the crate after reach a certain altitude.

Here is the code of the "Drop.sqs" :

detach charge
charge setvelocity [-20,-20,0]

@ ((getposATL charge select 2) < 1000
_para = "B_Parachute_02_F" createVehicle position charge
_para setPos (getPos charge)
charge attachto [_para,[0,0,-1.3]]

@ ((getposATL charge select 2) < 4
detach charge

exit

Like you see, I really take care of placing the attach point between the parachute and the crate under the level of the parachute.

It's different for each different crates types.

If the level is just a point too high ("-1.2" instead of "-1.3" in this example) the parachute spawn under the crate, so the crate temporarily stop in the air, blocked by the parachute, and like the parachute is attached to an object that don't fall anymore, it simply disapear like he already reach the ground.

I'm not English or American, so I hope my text is readable haha !

And hope it's help you !

And I test this :

"I think to attach a vehicle, hide it with "hideObject" then attach the chute to the vehicle then delete it when I detach the chute."

From my previous post.

But forget about this idea, hiding the object just avoid the parachute to attach to it.

I try to get some time today to do a video.

But like I use FRAPS to do videos, and like I used SweetFX on ArmA III, I think that launching FRAPS disable SweetFX...

So, I must find a way to do a video.

If I find, I'll let the link here for you can see how my script work.

Edited by HellGhost

Share this post


Link to post
Share on other sites

this should work from a trigger. i usually call it with a radio trigger. But have not tested since latest patch.

createArsenal.sqf

// call with this, place in trigger activate (don't copy //):

// nul = [position thisTrigger,"B_supplyCrate_F","supply drop",true] execVM "createArsenal.sqf";

// replace "B_supplyCrate_F with classname of box to spawn
// replace "supply drop" with marker to change alpha of
// change true to false if you don't want a parachute

_pos = _this select 0;
_box = _this select 1;
_marker = _this select 2;
_paradrop = _this select 3;

if (_paradrop) then {

_chute = createVehicle ["NonSteerable_Parachute_F", [_pos select 0, _pos select 1, (_pos select 2) + 150], [], 0, "CAN_COLLIDE"];

_created = createVehicle [_box, [_pos select 0, _pos select 1, (_pos select 2) + 150], [], 0, ""]; 

["AmmoboxInit",[_created,true]] spawn BIS_fnc_arsenal;

_created attachTo [_chute,[0,0,1]];

clearMagazineCargoGlobal _created; 
clearWeaponCargoGlobal _created;
clearItemCargoGlobal _created;
clearBackpackCargoGlobal _created;

_created allowDamage false;

_marker setMarkerAlpha 1; 

_chemlight = "chemlight_blue" createVehicle (position _created);
_chemlight attachto [_created, [0,0,0]];

_blueSmoke = "SmokeShellBlue" createVehicle (position _created);
_blueSmoke attachto [_created, [0,0,0]];  

_boxheight = getpos _created select 2;

hint "Supply drop inbound, look for blue smoke and chemlight"; 

while {_boxheight > 0} do {		

	_boxheight = getpos _created select 2;

	if (_boxheight <= 2) exitWith {
		detach _created;
	};
};

} else {

_created = createVehicle [_box, _pos, [], 0, ""]; 

["AmmoboxInit",[_created,true]] spawn BIS_fnc_arsenal;

clearMagazineCargoGlobal _created; 
clearWeaponCargoGlobal _created;
clearItemCargoGlobal _created;
clearBackpackCargoGlobal _created;

_created allowDamage false;

_marker setMarkerAlpha 1; 

_chemlight = createVehicle ["chemlight_blue", _pos, [], 0, ""]; 

hint "Supply drop inbound, look for chemlight"; 

};

Share this post


Link to post
Share on other sites
Guest HellGhost

I don't have any problems now, and my script is a complete H.A.L.O drop.

You are in the cargo bay, the bay opened with a custom opening sound, a red light is visible by night, and change to green with a custom alamr sound, the crate, attached in the cargo bay, is simply eject and we can run or walk to the bottom ramp and jump when reach the end.

That's not just a script to generate a crate from nowhere in the sky.

We litteraly jump with the crate to the ground.

And after exiting the cargo bay, the plane fly away and be deleted reaching a far point.

I try to find a way to edit the video without having the bad conversion from Movie Maker.

When finalized, I'll upload it on Youtube in my account and like we said, a picture mean thousands words.

Share this post


Link to post
Share on other sites
Guest HellGhost

Your script is very good as well.

For mine, it's a combination of editor placed objects, with a folder with all the scripts files and custom sounds.

I think it's better to make a mission with vanilla contents, but even with the base of all, the plane, it require a mod.

So, without giving a full instructions, it's not really possible, but it's not as complicated as it seems.

Edited by HellGhost

Share this post


Link to post
Share on other sites

J andrews1 script workes fine swaped the chute to "B_Parachute_02_F" looks more realistic hight -1. Question is there any way to limit whats in the virtual crate? as in a named crate?

Edited by jgaz-uk

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

×