Forum Jump :

Author Message


Posts: 89
Rank:


Level: Member

Country: in
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-03-16 22:38        
     
Simple script to eject units from any aircrafts for paratrooper missions.
Call script with example code below in radio trigger or waypoint.
paradrop = [Grp1,plane1] execVM "parajump.sqf";
or
 null = [Grp1,plane1] execVM "parajump.sqf";

Place the above code in init of aircraft waypoint set in the editor.
Where grp1 is name of AI group or player group and plane1 is name of aircraft.
Note that AI group should not be grouped with aircraft.

Place an AI group or player group and in its leaders init-
grp1 = group this;{_x moveIncargo plane1} foreach units grp1;
with plane1 set to flying on map.

This can be used for multiple AI groups & aircraft formations as well for example in waypoint or trigger init-
paradrop = [Grp1,plane1] execVM "parajump.sqf";
paradrop = [Grp2,plane2] execVM "parajump.sqf";
paradrop = [Grp3,plane3] execVM "parajump.sqf";

parajump.sqf
//Simple script to eject units from any aircraft.
//Call script with example code- paradrop = [Grp1,plane1] execVM "parajump.sqf";

private ["_grp","_aircraft"];

_grp = _this select 0;
_aircraft = _this select 1;

sleep 1;

{_x action ["eject",_aircraft];sleep 0.5;} forEach units _grp;
(units _grp) orderGetIn false;
{unAssignVehicle _x} forEach units _grp;

exit;

The "sleep 0.5" between each jump can be increased/decreased to any value as preferred.

This post was edited by warbird (2016-03-22 04:23, ago)


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 23
In-game name: Wak

 
#2 Posted at 2016-03-16 23:11        
     
Couple notes:
  • You don't need to use exit at the end.
  • Please use the params command for multiple parameters, it keeps the code cleaner.
  • Add a space after commas, and newlines after semicolons. Again, keeps you code clean.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 61
In-game name: Kobayashi Maru

 
#3 Posted at 2016-03-16 23:22        
     
Thanks Warbird.
If you need some parachutes and other stuffs, have a look at our brand new "script library" , click on the button at top of the page, beside "downloads". In Arma3 section you'll find "simple paradrop" script.
Everyone is welcome and free to participate at this section! There is a submit file for that.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 89
Rank:


Level: Member

Country: in
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2016-04-21 13:12        
     
Here is a example MapClick mass paratrooper drop script i created using the above script.
Their are 3 aircraft and 3 groups of paratroopers in this example mission ,this can be edited to add more aircraft and paratroopers if needed.

Remove this line if not needed in massdrop.sqf
plane2 attachTo [plane1,[-45,-20,2.55]];plane3 attachTo [plane1,[45,-20,2.55]];

For this script-
Place invisible helipad on map called StartPos.

Place invisible helipad on map called DropPos.

Place the Functions module on map.

massdrop.sqf
if (!isServer) exitWith {};
//Aircraft & AI spawn position.
//Place helipad on edge of map called StartPos.

//Create a helipad for paradrop location (DZ).
//Place helipad on edge of map called DropPos.

//Place the functions module on map.

//Creating marker for map-click.
_marker = createMarker ["dropMarker",[0,0,0]];
_marker setMarkerColor "ColorBlue";
_marker setMarkerType "mil_flag";
_marker setMarkerShape "ICON";
_marker setMarkerSize [1,1];
_marker setMarkerText "Paratrooper DropZone";

//creating marker for transport aircraft.
_marker1 = createMarker ["Mark4",[0,0,0]];
_marker1 setMarkerColor "ColorBlue";
_marker1 setMarkerType "mil_dot";
_marker1 setMarkerShape "ICON";
_marker1 setMarkerSize [1,1];
_marker1 setMarkerText "Transport Aircraft";

sleep 1;
titleText ["Click on map position to mark DZ for paratroopers!","plain down"];

sleep 0.1;
mapclick = true;
onMapSingleClick """dropMarker"" setMarkerPos _pos;mapclick = false;
onMapSingleClick ''; true;";
waitUntil {!mapClick};

sleep 1;
titleText ["Position marked on map!, paratrooper reinforcements on the way!","plain down"];

//Transport Aircraft.
sleep 1;
Bravo1 = createGroup west;
plane1 = createVehicle ["C130J", [(getpos startPos select 0), (getpos startPos select 1), 2500],[], 0,"FLY"];
plane1 setVelocity [0,70,1];

//Transport Aircraft pilots.
p1 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p1 moveInDriver plane1;
p1 = leader Bravo1;

p1_1 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p1_1 moveInCargo plane1;

//Paratroopers.
GRP1 = [getPos startPos, WEST,["USMC_Soldier_TL",
"USMC_Soldier_SL",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_SoldierM_Marksman",
"USMC_SoldierS_Engineer",  
"USMC_SoldierS_Sniper",  
"USMC_Soldier_AR",
"USMC_Soldier_Medic",
"USMC_Soldier_MG",  
"USMC_Soldier_Medic",
"USMC_Soldier",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_Soldier_AR"],[],[],[],[],[],20] call BIS_fnc_spawnGroup;

sleep 0.1;
{_x moveInCargo plane1} forEach units GRP1;

sleep 2;
plane2 = createVehicle ["C130J", [(getpos startPos select 0), (getpos startPos select 1), 2500],[], 0,"FLY"];
plane2 setVelocity [0,70,1];

//Transport Aircraft pilots.
p2 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p2 moveInDriver plane2;

p2_1 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p2_1 moveInCargo plane2;

//Paratroopers.
GRP2 = [getPos startPos, WEST,["USMC_Soldier_TL",
"USMC_Soldier_SL",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_SoldierM_Marksman",
"USMC_SoldierS_Engineer",  
"USMC_SoldierS_Sniper",  
"USMC_Soldier_AR",
"USMC_Soldier_Medic",
"USMC_Soldier_MG",  
"USMC_Soldier_Medic",
"USMC_Soldier",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_Soldier_AR"],[],[],[],[],[],20] call BIS_fnc_spawnGroup;

sleep 0.1;
{_x moveInCargo plane2} forEach units GRP2;

sleep 2;
plane3 = createVehicle ["C130J", [(getpos startPos select 0), (getpos startPos select 1), 2500],[], 0,"FLY"];
plane3 setVelocity [0,70,1];

//Transport Aircraft pilots.
p3 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p3 moveInDriver plane3;

p3_1 = Bravo1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
p3_1 moveInCargo plane3;


//Paratroopers.
GRP3 = [getPos startPos, WEST,["USMC_Soldier_TL",
"USMC_Soldier_SL",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_SoldierM_Marksman",
"USMC_SoldierS_Engineer",  
"USMC_SoldierS_Sniper",  
"USMC_Soldier_AR",
"USMC_Soldier_Medic",
"USMC_Soldier_MG",  
"USMC_Soldier_Medic",
"USMC_Soldier",
"USMC_Soldier_GL",
"USMC_Soldier_LAT",  
"USMC_Soldier_AR"],[],[],[],[],[],20] call BIS_fnc_spawnGroup;

sleep 0.1;
{_x moveInCargo plane3} forEach units GRP3;


//Call sign for aircraft formation.
Bravo1 setGroupID ["FalconOne","GroupColor0"];

//attaching marker to group leader of aircraft.
sleep 1;
[] spawn {
  while {not isnull leader Bravo1} do {"Mark4" setmarkerpos getpos leader Bravo1; sleep 0.5;
};
};

//Settings for Aircraft Formation.
sleep 1;
Bravo1 setBehaviour "SAFE";
Bravo1 setCombatMode "YELLOW";
Bravo1 setSpeedMode "FULL";
Bravo1 setFormation "WEDGE";

sleep 1;
DropPos setPos getMarkerPos "dropMarker";

//Creating waypoint for aircraft.
sleep 1;
leader bravo1 move getPos DropPos;


sleep 1;
waitUntil {leader bravo1 distance DropPos < 3000};
Bravo1 setSpeedMode "LIMITED";
plane2 attachTo [plane1,[-45,-20,2.55]];plane3 attachTo [plane1,[45,-20,2.55]];//optional remove if not needed.


sleep 10;
leader bravo1 sideChat "Approaching drop zone!";

//Aircraft cargo ramp animation.(depending on aircraft type)
sleep 5;
leader bravo1 sideChat "Cargo ramp opened! , all units get ready to paradrop!";
plane1 animate ["ramp_top",1];
plane1 animate ["ramp_bottom",1];
plane2 animate ["ramp_top",1];
plane2 animate ["ramp_bottom",1];
plane3 animate ["ramp_top",1];
plane3 animate ["ramp_bottom",1];

//Paradropping troops at mapclick location.
sleep 1;
waitUntil {leader bravo1 distance dropPos < 350};
leader bravo1 sideChat "All troops disembark!";

//Dropping paratroopers at mapclick location.
paradrop = [Grp1,plane1] execVM "parajump.sqf";
paradrop = [Grp2,plane2] execVM "parajump.sqf";
paradrop = [Grp3,plane3] execVM "parajump.sqf";

leader Grp1 move getPos dropPos;
leader Grp2 move getPos dropPos;
leader Grp3 move getPos dropPos;

sleep 5;
leader bravo1 sideChat "All troops successfully paradropped at location!, aircraft returning to base!";

//Optional
sleep 5;
leader bravo1 sideChat "Cargo ramp closed!";
plane1 animate ["ramp_top",0];
plane1 animate ["ramp_bottom",0];
plane2 animate ["ramp_top",0];
plane2 animate ["ramp_bottom",0];
plane3 animate ["ramp_top",0];
plane3 animate ["ramp_bottom",0];

sleep 5;
bravo1 setSpeedMode "FULL";
leader bravo1 doMove getPos startPos;
deleteMarker "dropMarker";

titleText ["Wait 70 seconds to activate paratrooper reinforcements!","plain down"];

//Deleting aircraft,markers and pilots.
sleep 70;
deleteMarker "Mark4";
{deleteVehicle _x} forEach (units Bravo1);
dropPos setPos [0,0,0];
deleteVehicle plane1;
deleteVehicle plane2;
deleteVehicle plane3;

titleText ["Activate radio support to call paratrooper reinforcements again!","plain down"];

exit;


parajump.sqf
//Simple script to eject units from any aircraft.
//Call script with example code- paradrop = [Grp1,plane1] execVM "parajump.sqf";

private ["_grp","_aircraft"];

_grp = _this select 0;
_aircraft = _this select 1;

sleep 1;

{_x action ["eject",_aircraft];sleep 0.5;} forEach units _grp;
(units _grp) orderGetIn false;
{unAssignVehicle _x} forEach units _grp;

exit;


Place massdrop.sqf and parajump.sqf in mission folder.
Call script by radio trigger ALPHA - null = [] execVM "massdrop.sqf";

This post was edited by warbird (2016-04-27 23:50, ago)