Jump to content
Beerkan

Simple ParaDrop Script

Recommended Posts

Welcome to the forums Raptor. :)  Mission scripts go in the folder of the mission you're designing.  On Windows by default that would be:

%userprofile%\documents\Arma 3\missions\

Then in whatever mission folder you created, like myMission.Altis or whatever.

 

It might look like this after a few scripts:

 

7Lf4mos.jpg

  • Like 1

Share this post


Link to post
Share on other sites

Welcome to the forums Raptor. :)  Mission scripts go in the folder of the mission you're designing.  On Windows by default that would be:

%userprofile%\documents\Arma 3\missions\

Then in whatever mission folder you created, like myMission.Altis or whatever.

 

It might look like this after a few scripts:

 

7Lf4mos.jpg

First of all, thank you for taking the time out to help me, it's highly appreciated

Secondly, the missions in which I wanted to insert the script were found in C:\Users\Admin\Documents\Arma 3 - Other Profiles\Reaper\missions\Third.Altis , I copied the eject.sqf in the Third.Altis *my mission* folder

Did i do it correctly?

I'd post the screenshot but I really don't know how to , sorry :(

Share this post


Link to post
Share on other sites

Ahh, absolutely correct!  If you've changed your in game profile that's where it'll show up.  Good job. :)

 

The only thing that might still go wrong is if your file is actually called eject.sqf.txt instead of eject.sqf.  That's caused by Windows hiding 'file extensions', the .sqf or .txt part from the display.  Is the script working for you now?  If not you can review this video to see how to fix it.

  • Like 1

Share this post


Link to post
Share on other sites

Ahh, absolutely correct!  If you've changed your in game profile that's where it'll show up.  Good job. :)

 

The only thing that might still go wrong is if your file is actually called eject.sqf.txt instead of eject.sqf.  That's caused by Windows hiding 'file extensions', the .sqf or .txt part from the display.  Is the script working for you now?  If not you can review this video to see how to fix it.

Oh Thanks! It works now! :) Thanks very much for helping me out man!

PS Is "Liking" the reply the same as upvoting?

Share this post


Link to post
Share on other sites

Hey Beer,

 

I've been trying to use your script for a big paradrop from a C-47. Everything is working well apart from the player chute opening at the desired altitude. I've followed your instructions to the best of my ability and tried out different things on this thread but I can't seem to get it to work properly. I'm trying to eject my troops at 400ft which works, the AI deploy their chutes as they exit but as the player I have to deploy mine manually. I do that but then when I reach about 200ft the chute vanishes and I fall to the ground. If I wait till I reach about 200ft the chute sometimes opens fine and I land, often it doesn't open at all and when I deploy it I hit the ground and die... Also sometimes the AI take critical damage moments after they've landed and they don't spawn back their full load out. I've no idea what I'm doing wrong any help would be really appreciated!

 

Cheers

/* 
	Filename: Simple ParaDrop Script v0.96 eject.sqf
	Author: Beerkan
	
	Description:
     A Simple Paradrop Script
   
	Parameter(s):
	0: VEHICLE  - vehicle that will be doing the paradrop (object)
	1: ALTITUDE - (optional) the altitude where the group will open their parachute (number)
   
   Example:
   0 = [vehicle, altitude] execVM "eject.sqf"
*/  

if (!isServer) exitWith {};
private ["_paras","_vehicle","_chuteHeight","_dir"];
_vehicle = _this select 0; 
_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 400 };
_vehicle allowDamage false;
_paras = assignedcargo _vehicle;
_dir = direction _vehicle;    

paraLandSafe = 
{
	private ["_unit"];
	_unit = _this select 0;
	_chuteheight = _this select 1;
	(vehicle _unit) allowDamage false;
	if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute};
	waitUntil { isTouchingGround _unit || (position _unit select 2) < 1 };
	_unit action ["eject", vehicle _unit];
	sleep 1;
	_inv = name _unit;
	[_unit, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_loadInventory;// Reload Loadout.
	_unit allowdamage true;// Now you can take damage.
};

OpenPlayerChute =
{
	private ["_paraPlayer"];
	_paraPlayer = _this select 0;
	_chuteheight = _this select 1;
	waitUntil {(position _paraPlayer select 2) <= _chuteheight};
	_paraPlayer action ["openParachute", _paraPlayer];
};

{
	_inv = name _x;// Get Unique name for Unit's loadout.
	[_x, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_saveInventory;// Save Loadout
	removeBackpack _x;
	_x disableCollisionWith _vehicle;// Sometimes units take damage when being ejected.
	_x allowdamage false;// Trying to prevent damage.
	_x addBackPack "CUP_T10_Parachute_backpack";
	unassignvehicle _x;
	moveout _x;
	_x setDir (_dir + 90);// Exit the chopper at right angles.
	sleep 0.3;
} forEach _paras;

_vehicle allowDamage true;

{ 
	[_x,_chuteheight] spawn paraLandSafe;
} forEach _paras;
0 = [transport1, 400] execVM "eject.sqf"

Share this post


Link to post
Share on other sites

Hey Beer,

 

I've been trying to use your script for a big paradrop from a C-47. Everything is working well apart from the player chute opening at the desired altitude. I've followed your instructions to the best of my ability and tried out different things on this thread but I can't seem to get it to work properly. I'm trying to eject my troops at 400ft which works, the AI deploy their chutes as they exit but as the player I have to deploy mine manually. I do that but then when I reach about 200ft the chute vanishes and I fall to the ground. If I wait till I reach about 200ft the chute sometimes opens fine and I land, often it doesn't open at all and when I deploy it I hit the ground and die... Also sometimes the AI take critical damage moments after they've landed and they don't spawn back their full load out. I've no idea what I'm doing wrong any help would be really appreciated!

 

Cheers

 

To improve false damage and increase the delay before issuing a backpack, In the ParaLandSafe function, increase the the sleep from 1 - 2.

 

If you want ONLY players to be in charge of when to deploy their own parachute, then remove this line

 if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute};//Set AutoOpen Chute if unit is a player

Share this post


Link to post
Share on other sites

To improve false damage and increase the delay before issuing a backpack, In the ParaLandSafe function, increase the the sleep from 1 - 2.

 

If you want ONLY players to be in charge of when to deploy their own parachute, then remove this line

 if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute};//Set AutoOpen Chute if unit is a player

Great, thanks for the quick response! Is there any way I can get the shoot to open automaticity at 400ft? I'm trying to create a static jump scenario. I e tried the trigger and way point but it doesn't seem to work for me. Unfortunately you're dealing with a novice here so I not too sure what to make of this...

Cheers again

Share this post


Link to post
Share on other sites

To auto open player chute @ 400 add the open chute height to your parameters. i.e.

0 = [MyChopperName, 400] execVM "eject.sqf"

Alternatively you can hard code it in the script by changing this line

_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 100 };

to

_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 400 };

AI will auto open when they exit vehicle.

Share this post


Link to post
Share on other sites

To auto open player chute @ 400 add the open chute height to your parameters. i.e.

0 = [MyChopperName, 400] execVM "eject.sqf"

Alternatively you can hard code it in the script by changing this line

_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 100 };

to

_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 400 };

AI will auto open when they exit vehicle.

 

 

No luck mate. When I first encountered the problem I figured that changing the script like that would fix it but it didn't work. I've now just copied and pasted what you've suggested and I'm still having the same issue. I am ejected from the plane at the right altitude but the chute doesn't auto deploy so I do it manually. Once I reach about 200ft the chute vanishes and I freefall the rest of the way. When I land my load out is restored after a few seconds but only after I appear a few ft back in the air and land again. I've attached the eject.sqf that I'm using as well as the code I'm using in the parameter. Maybe you can see what I'm doing wrong?

 

Cheers

/* 
	Filename: Simple ParaDrop Script v0.96 eject.sqf
	Author: Beerkan
	
	Description:
     A Simple Paradrop Script
   
	Parameter(s):
	0: VEHICLE  - vehicle that will be doing the paradrop (object)
	1: ALTITUDE - (optional) the altitude where the group will open their parachute (number)
   
   Example:
   0 = [vehicle, altitude] execVM "eject.sqf"
*/  

if (!isServer) exitWith {};
private ["_paras","_vehicle","_chuteHeight","_dir"];
_vehicle = _this select 0; 
_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 400 };
_vehicle allowDamage false;
_paras = assignedcargo _vehicle;
_dir = direction _vehicle;    

paraLandSafe = 
{
	private ["_unit"];
	_unit = _this select 0;
	_chuteheight = _this select 1;
	(vehicle _unit) allowDamage false;
	if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute};
	waitUntil { isTouchingGround _unit || (position _unit select 2) < 1 };
	_unit action ["eject", vehicle _unit];
	sleep 1;
	_inv = name _unit;
	[_unit, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_loadInventory;// Reload Loadout.
	_unit allowdamage true;// Now you can take damage.
};

OpenPlayerChute =
{
	private ["_paraPlayer"];
	_paraPlayer = _this select 0;
	_chuteheight = _this select 1;
	waitUntil {(position _paraPlayer select 2) <= _chuteheight};
	_paraPlayer action ["openParachute", _paraPlayer];
};

{
	_inv = name _x;// Get Unique name for Unit's loadout.
	[_x, [missionNamespace, format["%1%2", "Inventory",_inv]]] call BIS_fnc_saveInventory;// Save Loadout
	removeBackpack _x;
	_x disableCollisionWith _vehicle;// Sometimes units take damage when being ejected.
	_x allowdamage false;// Trying to prevent damage.
	_x addBackPack "CUP_T10_Parachute_backpack";
	unassignvehicle _x;
	moveout _x;
	_x setDir (_dir + 90);// Exit the chopper at right angles.
	sleep 0.3;
} forEach _paras;

_vehicle allowDamage true;

{ 
	[_x,_chuteheight] spawn paraLandSafe;
} forEach _paras;
0 = [transport1, 400] execVM "eject.sqf"

Share this post


Link to post
Share on other sites

Ah, wrong version of the script.

This

OpenPlayerChute =
{
    private ["_paraPlayer"];
    _paraPlayer = _this select 0;
    _chuteheight = _this select 1;
    waitUntil {(position _paraPlayer select 2) <= _chuteheight};
    _paraPlayer action ["openParachute", _paraPlayer];
};

should be this

OpenPlayerChute =
{
    private ["_paraPlayer"];
    _paraPlayer = _this select 0;
    _chuteheight = _this select 1;
    waitUntil {(position _paraPlayer select 2) <= _chuteheight};
    If (vehicle _paraPlayer IsEqualto _paraPlayer ) then {_paraPlayer action ["openParachute", _paraPlayer]};//Check if players chute is open, if not open it.
};

See my post version v0.97 from 4th March. https://forums.bistudio.com/topic/153935-simple-paradrop-script/page-4#entry2991079

Share this post


Link to post
Share on other sites

Is there a way to execute this script within another script? I want to spawn a plane flying in on a trigger that then drops units. I have everything setup, but no one jumps out. Currently in my script it is 

_wp1 setwaypointScript "eject.sqf";

Any ideas?

Share this post


Link to post
Share on other sites

Try this

_wp1 setWaypointStatements ["true","0 =[NameOfYourVehicle,Chuteheight] execVM 'eject.sqf';"];

Where

"NameOfYourVehicle"  = the name of the plane your units are in.

"ChuteHeight" = height in metres you want chute to open for Players. AI will open once they have ejected.

 

Working example

_wp1 setWaypointStatements ["true","_drop =[_veh,100] execVM 'eject.sqf';"];

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi beerkan

 

i came back to use this script just now and it is ejecting all but two passangers,those two are sitting at the rear of the helo,its an RHS helo if it makes any difference.

 

Not sure what is causing it

 

 

 

Share this post


Link to post
Share on other sites

I'm hoping someone is still paying attention to this great script.

 

So far the helicopters stop and land after dropping the troopers.   I expected it to keep going to it's waypoint?  I tried setting the pilot to careless, and I tried the setcaptive fix as well.  Instead of flying by, it makes the drop and then reefs back on the stick to make a fill stop, then looks for a place to land and does so. 

 

Best,

 

-Doc

Share this post


Link to post
Share on other sites
On 27/12/2016 at 5:24 PM, redarmy said:

Hi beerkan

 

i came back to use this script just now and it is ejecting all but two passangers,those two are sitting at the rear of the helo,its an RHS helo if it makes any difference.

 

Not sure what is causing it

 

 

 

Only those units that are assigned as cargo are considered when ejecting.

 

i.e. this line only considers the assigned as cargo.

_paras = assignedcargo _vehicle;

I'll look at adding ALL units in the helo, (excluding the pilot and the crew)

 

Share this post


Link to post
Share on other sites
11 hours ago, doc. caliban said:

I'm hoping someone is still paying attention to this great script.

 

So far the helicopters stop and land after dropping the troopers.   I expected it to keep going to it's waypoint?  I tried setting the pilot to careless, and I tried the setcaptive fix as well.  Instead of flying by, it makes the drop and then reefs back on the stick to make a fill stop, then looks for a place to land and does so. 

 

Best,

 

-Doc

Yep, Beerkan still here.

Check your waypoints settings. See the demo mission for working examples.

Share this post


Link to post
Share on other sites

Thank you for the reply, Beerkan.  I did figure it out ... I had in fact been doing something wrong, but at this point I don't remember what it was, though it was in fact something that looking more closely at your directions revealed.  The script seems to work perfectly.  Thanks!

 

-Doc

Share this post


Link to post
Share on other sites

Hi Beerkan, et. al. -

 

This is an awesome script, and it's exactly what I was looking for.  I've tried several different ideas and scripts that simulate similar air drops and this one fits what I need perfectly.  I do, however, have one question.

 

In my case I'm simulating a night HALO drop.  As I stated, everything works great - except for the fact that the player continues moving to the left.  What happens is that the player exits the plane facing South, and continues moving toward the East (the aircraft's heading is nearly due East).  The player does continue to fall toward the ground, but they never stop moving toward the East as well.  What makes it even more problematic is that if the player turns while in free fall, their direction of travel will ALSO move, keeping their left side toward the direction of movement.

 

Is there a way to counteract this?

 

What I'm hoping to accomplish is a way to force the player object (and, by proxy, any AI objects as part of the player's Group) to simply fall straight down.  The main reason for this is in how the continued forward momentum complicates the area designated as the drop zone (along with some other Triggers that are dependent upon that).  I do have to say that the forward momentum, by itself, isn't as much of an issue - it's the fact that the momentum changes direction with the facing of the player that's the real problem, because I could simply move the actual HALO drop waypoint back far enough to counteract the momentum if the direction of movement never changed.

 

I realize that this script seems to focus more on a low altitude parachute drop than a HALO drop... but if someone has an idea how to counter the forward momentum it would be absolutely perfect for my needs.

  • Like 1

Share this post


Link to post
Share on other sites

This line sets the direction you're facing when you exit the helo. Basically 90 degrees to the helo. But does't add any velocity to send you in that direction.

_x setDir (_dir + 90);

There's nothing in the script to set your velocity in any particular direction. You say you're continuing in the same direction every time you exit the helo, do you have wind speed and direction set in your mission parameters?

 

I would suggest to change this part of the script,

{
    _x setVariable ["Saved_Loadout",getUnitLoadout _x];// Save Loadout
    removeBackpack _x;
    _x disableCollisionWith _vehicle;// Sometimes units take damage when being ejected.
    _x allowdamage false;// Good Old Arma, they still can take damage on Vehcile exit.
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Exit the chopper at right angles.
    sleep 0.3;//space the Para's out a bit so they're not all bunched up.
    _x addBackPack "B_parachute";
} forEach _paras;

 

to this

{
    _x setVariable ["Saved_Loadout",getUnitLoadout _x];// Save Loadout
    removeBackpack _x;
    _x disableCollisionWith _vehicle;// Sometimes units take damage when being ejected.
    _x allowdamage false;// Good Old Arma, they still can take damage on Vehcile exit.
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Exit the chopper at right angles.
    sleep 0.3;//space the Para's out a bit so they're not all bunched up.
    _x setVelocity [0,0,-5];
    _x addBackPack "B_parachute";
} forEach _paras;

Share this post


Link to post
Share on other sites

Hi Beerkan -

 

Thanks for the reply.

 

I don't have any wind speed or direction set in my current scenario (in fact, the scenario I'm using this in is a simple test scenario to get all the functions working like I want before I use it in the scenario in question).

 

I'm not sure where the velocity is coming in - the player's direction of movement is (initially) the same direction that the helo / C-130 is traveling.  It changes when the player turns left or right - the velocity will then change to 9:00 (to the left) of whatever direction the player is facing (so, for example, if the player turns to face North while in free fall, the direction of travel will change as the player turns so the momentum / velocity will be carrying them to the West).

 

I tried removing the

_x setDir (_dir + 90);

as you suggested - that didn't work.  Instead of facing 90 degrees to the right of the plane, the player exits the plane 90 degrees to the left (I assume it's facing due North as my plane is flying nearly due East).

 

However, oddly, I found that if I changed that line of the script so that the player exits the plane facing the same direction as the aircraft's heading, like so -

 

_x setDir (_dir + 0);

this creates a situation that much more closely resembles real life HALO parachute drops.  The player will continue moving forward for a few moments (carrying the momentum of the plane), but then that momentum will bleed off and about 8 to 10 seconds later they will be falling straight down - turning to different facings doesn't cause the player to move forward in any direction at all... which was exactly what I was hoping for.  I tested this with other directions as well... 180 degrees for example... and it works the same for the most part with them - but for some reason if _dir is set to 90 the momentum just never dissipates and the player falls with a ton of forward momentum.

 

As a side note, the player can voluntarily move forward (create forward momentum) in the dive by pressing whatever key they have assigned to "move forward," but that's normal so not a big deal (for my purposes anyway).

 

So... if you leave the _dir variable to zero it cancels out the strange velocity issue I was experiencing earlier and creates a more realistic HALO insertion drop situation.

 

That being said, this only seems to affect the player.  Regardless of what _dir is set to, any AI members of the player's Group will be carried off into the distance by the same problem (I test dropped at 4800 meters... by the time we hit the ground - chutes popped at 110 meters - my spotter was halfway across Stratis).

Edited by Cerebus06
clarification and AI notes

Share this post


Link to post
Share on other sites

Here's a complete new revision of the script to do what you want Cerebus06. Basically this will let the units freefall until they reach the alltitude you define to open the parachute, (or 100m if you don't).

Let me know what you think.

 

/*
    Filename: Simple ParaDrop Script v0.99b eject.sqf
    Author: Beerkan
   
    Description:
     A Simple Paradrop Script
    Parameter(s):
    0: VEHICLE  - vehicle that will be doing the paradrop (object)
    1: ALTITUDE - (optional) the altitude where the group will open their parachute (number)
   Example:
   0 = [vehicle, altitude] execVM "eject.sqf"
*/  

if (!isServer) exitWith {};
private ["_paras","_vehicle","_chuteHeight","_dir"];
_vehicle = _this select 0;
_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 100 };
_vehicle allowDamage false;
_paras = assignedcargo _vehicle;
_dir = direction _vehicle;

ParaLandSafe =
{
    private ["_unit"];
    _unit = _this select 0;
    _chuteheight = _this select 1;
    (vehicle _unit) allowDamage false;
    [_unit,_chuteheight] spawn AddParachute;//Set AutoOpen Chute if unit is a player
    waitUntil { isTouchingGround _unit || (position _unit select 2) < 1 };
    _unit action ["eject", vehicle _unit];
    sleep 1;
    _unit setUnitLoadout (_unit getVariable ["Saved_Loadout",[]]);// Reload Saved Loadout
    _unit allowdamage true;// Now you can take damage.
};

AddParachute =
{
    private ["_paraUnit"];
    _paraUnit = _this select 0;
    _chuteheight = _this select 1;
    waitUntil {(position _paraUnit select 2) <= _chuteheight};
    _paraUnit addBackPack "B_parachute";
    If (vehicle _paraUnit IsEqualto _paraUnit ) then {_paraUnit action ["openParachute", _paraUnit]};//Check if players chute is open, if not open it.
};

{
    _x setVariable ["Saved_Loadout",getUnitLoadout _x];// Save Loadout
    removeBackpack _x;
    _x disableCollisionWith _vehicle;// Sometimes units take damage when being ejected.
    _x allowdamage false;// Good Old Arma, they still can take damage on Vehcile exit.
    unassignvehicle _x;
    moveout _x;
    _x setDir (_dir + 90);// Exit the chopper at right angles.
    sleep 0.3;//space the Para's out a bit so they're not all bunched up.
    _x setvelocity [0,0,-5];
} forEach _paras;

_vehicle allowDamage true;

{
    [_x,_chuteheight] spawn ParaLandSafe;
} forEach _paras;

Share this post


Link to post
Share on other sites

I just fucking LOVE this script, I'm using .096 here in the pictures.
For me it works perfect.

The 0.97 I'm not keen on, the parachutes appear just before canopy deployment, it would be better if they appeared on exit like 0.96, as it makes for some awesome screens 

http://imgur.com/a/kXlbT
 

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

×