Jump to content
Sign in to follow this  
demonized

spawn heli with paradrop group, deliver, go home, delete heli

Recommended Posts

If you came looking for a simple paradrop script to use in waypoints, click spoiler

unknown author from the forums, but its pretty much the standard of paradrops. save it as groupEject.sqf

//Create a group and place group1=group this in the leaders init.
//Create a c130 with two waypoints, on the first waypoint put this in the on act line: nul = [group1] execVM "groupEject.sqf";

//groupEject.sqf
//Code:

if (isServer) then 
{
_grp = _this select 0;

sleep (random 3);

{
	unassignVehicle (_x); 
	(_x) action ["EJECT", vehicle _x];
	sleep 0.4;
} foreach units _grp;
};

//Then just repeat with the groups and planes. 
//END

If you wanted something more take a look at:

ParaReinforceV1.21

Hello all.

This is a set of scripts i have put together to provide enemy reinforcement with a heli and paradrop, and now includes LZ insertion aswell since v1.1

And arma2 or oa and BAF units included in v1.2.

Script uses BIS_fnc_spawnGroup and BIS_fnc_spawnVehicle functions,

cheers to fatty86 for showing and explaining those functions to me.

Heli or Plane is spawned and selected group is spawned and moved in cargo of transport.

Transport goes to groups patrol area and either paradrop or Land at LZ and unload group.

Then activates UPSMON-script on patrol group once theyve dropped from helo or airplane since v1.1.

After the drop, transport returns to start position and gets deleted along with crew.

Upsmon script was for my personal use, option to disable it is in top of parareinf.sqf and group will use wp´s instead.

Option to select Arma 2 only or OA only in top of parareinf.sqf

Purpose of script was to be run multiple times without conflicts, using no predefined names, even simultaniously in MP, i should say i have multiple patrol areas and triggers for my full mission, with different names and different execute lines in different repeating triggers matching that specific patrol area.

I have tested it in editor and it works as it should, ran it 20ish times after eachother, as fast as i could press the radio command for trigger, results: ok.

Only issue is if only one spawn marker for helis are used, once it gets to about 10 helis created rapidly they may crash into eachother at the spawn point.

No issue for me as i use several markerpositions for spawning heli, so helis come in from random sides of map.

Script in full were written and tested by me, got some ideas, some solutions, actual parts from others work posted here on the forums, it was a learning experience and have been a work in progress for awhile.

Script have not been tested on dedicated server yet, i think it will work, but cant guarantee it.

Now fully support all sides(not civ) both OA and Arma2 standalone

Here is attached readme:

ParaReinforce v 1.2 by Demonized - Operation Arrowhead and Arma2 standalone compatible.

This script creates a heli and a custom group and flys them to a point and either paradrops them or unloads them at a lz, then heli goes back to start and gets deleted.

Heli will fly to 2500m from patrol area first, then go to deploy at patrol area.

If group small a smaller heli is used, if group big, bigger heli used according to side and faction.

If heli damaged so it cannot fly all will emergency eject.

For full overview of what script does look in parareinf.sqf where there are info lines for pretty much anything.

In parareinf.sqf at top you can adjust a few options, they have detailed info on what they are, be sure to check if upsmon and arma version used is set to what you want.

How to use: this is same setup as in demo mission and can be changed in parareinf.sqf.

1: place the spawn folder with scripts into you mission folder.

2: Place these markers:

Minimum is spawnhill and 1 helispawn marker, cannot be same marker, because east attacks west if spawned at exactly same second.

for group spawn point: make a empty marker named: spawnhill - and place it far away from anything

for heli spawn points: make 5 empty markers named: helispawn1, helispawn2, helispawn3, helispawn4, helispawn5

and place them where you want the helis to come from.

(these can be adjusted in parareinf.sqf if you want more or less points where helis will approach patrol area from)

for patrol area markers: make either empty markers and name them if you will NOT use upsmon, else just make markers as normal with upsmon, and script will use them.

For upsmon users its important to use "showmarkers" and alphamarker method described at bottom of readme, same for ups

users i guess, but untested.

3: place function module on map in editor, its in modules f7 in editor.

4: place 1 or several triggers, either with blue or red detected by the other or whatever condition fits your mission, can be repeating triggers as well, this is used to start script.

In trigger on activation field place this:

_null = ["patrolmarkername","land","usghillie",3] execVM "spawns\parareinf.sqf";

Place in same order as above:

"patrolmarkername" = is the name of your marker for area wich heli will go to and group will patrol once parajumped or deployed.

"land" = is what type of insertion you want, you can choose, "para" or "land" or "plane" or "random"

(para is paradrop, land is find usable lz with no threes and no houses and unload troops on ground via LZ, "plane" is c130 paradrop for west units and Antonov An-2 paradrop for east units, random is one of the above, also c130j is used for all sides in arma2 standalone version)

"usghillie" is what type units you want dropped, you have several options here, name is pretty much descriptive enough in itself:

All types:

west OA types: "usghillie", "usspecial", "ustroops"

east OA types: "taghillie", "taspecial", "tatroops", "tamilitia"

resistance OA: "guermilitia"

west A2 types: "CDFtroops", "CDFghillie", "usmcspecial", "usmctroops", "usmcghillie"

east A2 types: "insurgents", "insurgentsplain", "ruspecial", "ruspetsnaz", "rutroops", "rughillie"

resistance A2: "guerillas", "guerillasplain", "guerillaghillie"

west BAF types: "bafmulticam", "bafdesghillie", "bafdesert", "bafwoodghillie", "bafwoodland"

Random types:

"blue" - this is random west types A2/OA

"red" - this is random east types A2/OA

"guer" - this is random resistance types A2/OA

"random" - this is random of all types A2/OA

"OAblue" - OA version random west OA

"OAred" - OA version random east OA

"OAguer" - OA version random resistance OA

"A2blue" - A2 version random west A2

"A2red" - A2 version random east A2

"A2guer" - A2 version random resistance A2

Note: all groups with ghillie is snipers in ghilliesuits, doh :) but they will be deployed farther away from patrol area and heli transporting them will go very low in stealth mode, and will not do any flyby, also east snipers will use uh1 heli, and west will use mh6 for the OA version.

For Arma2 standalone unfortunately there is no smaller heli for snipers east so mi8 is used..

3 is an optional parameter you can use, if you dont use it, a random number of 0-4 will be used.

This defines the minimum size of troops you want in group you choose from, if you set number higher than troops available all troops of current type will be selected, you can also set 100 and then all troops of selected unit type will be selected.

If you want to use debug for a certain paradrop while others are active set debug to false in script and, add "debug" after minimum size:

_null = ["patrolmarkername","land","usghillie",3,"debug"] execVM "spawns\parareinf.sqf";

NOTE: in demo mission i have put in a lot of blue arrow markers with text describing various elements, these can be deleted.

IMPORTANT FOR UPSMON USERS:

In all your upsmon groups for the mission include the "showmarker" parameter.

This will make all markers vicible on map screen in MP and ingame, this is needed for heli wps.

Now do this:

To make them invicible ingame and on MP login screen, make a gamelogic and in init line put this:

_anyName = [] execVM "spawns\markerAlpha.sqf"

You dont need to name gamelogic or do anything else with it.

Now open markerAlpha.sqf wich is in spawn folder and add all your upsmon markers, same way as rest is.

This will hide them from view in MP lobby and ingame. they will still show in editor, and they are not moved, just made invicible.

Here are the scripts used:

parareinf.sqf

// Spawn random group (with random units) and spawn drop heli to go to marker to paradrop and set group on upsmon patrol or otherwise and send heli back and delete it after drop is complete.
// execute with _null = ["anymarker","land_or_para","what_type_units",number_minimum_units] execVM "spawns\parareinf.sqf";
// example:     _null = ["patrolmarker","land","usghillie",3] execVM "spawns\parareinf.sqf";

// name of script:   parareinf.sqf placed in spawns folder in mission folder - this is ParaReinforce version 1.1.

_upsmonInUse = 1;                	// 1=yes, 0=no  - if you use upsmon for paratroopers, script will do alternative way with marker to have heli wp work without extra marker.
_Arma2Version = 2;			// what versions Arma used - 0=arma2 only  -  1=OA only  -  2=Arma2 and OA(CO)
_flybyRange = 2500;               	// set how far away from the paradrop marker flyby will be done at.
_flyInHeight = 150;               	// the height heli will fly in, if any hills present on map above 200 is recomended minimum best all round use in Takistan is 250 for big helis acording to tests, until heli AI flying is fixed by BIS.
_spawnmarker = "spawnhill";       	// editor placed empty marker far off side in map in editor away from player and action - for the insert group, cannot be in water.
_chancerest = 0.50;	            // percent of wich rest units of same array is spawned.
_rangeWP = 200;  				// this is default random para or lz wp range from patrol area/marker center.
_debugMode = false;			// set this to true if you want debug mode on, meaning hints will be displayed, can also use "debug" in initline to only debug selected parareinf.ssqf.

// select random start location for drophelo from editor placed empty markers. 0 is first marker, you can have only 1 or as many as you want.
_random = floor(random 5);          // create a random number based on amount of heli spawn markers, so if you have 10 markers, number put here is 9, if you have only 1 marker number is 0.
_spawn = ["helispawn1", "helispawn2", "helispawn3", "helispawn4", "helispawn5"] select _random;

//   DO NOT MODIFY BELOW THIS LINE	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

_grppatrolmarker = _this select 0; 	// marker the paras should patrol, now same as heli wp and heli flyby wp.
_insertionType = _this select 1;   	// choose what type of insertion - para=paradrop   -    land=ground insertion(land and get out for paragroup).
_faction = _this select 2;        	// what type of units to be spawned, heli will match side.
_minSold = _this select 3;         	// number of units minimum, if not defined, random 4 is minimum, 50 % rest in faction.
_side = east;                     	// variabel declared so it will work in lower scripts. side is modified down in script based on choosen in initline.
_group = 0;                       	// variabel declared so it will work in lower scripts. group is modified down in script based on choosen in initline.
_helitypeUsed = "";    			// variabel declared so it will work in lower scripts. heli is modified down in script based on choosen / or group size in initline.
_emergency = 0;                    	// if 1 high rate of eject on paras, if 0 then normal.
_units = [];                       	// empty array ready for random troops.
_snipergrp = false;			// used to set appropriate wp if ghillie sniper units selected.
_OAgrp = false;				// if OA units selected.
_A2grp = false;				// if A2 units selected.
_BAFgrp = false;				// if BAF units selected.
_chooseRandom = 0;			// prepare so random faction selection works.

waituntil {!isnil "bis_fnc_init"};	//is function module active?, if not wait for function module to be activated.

if (isServer) then {
// activate debug mode ifdebug param used in execute line.
if ("debug" in _this) then {
	if (_debugMode) then {
		hint "debug mode is already set to true in parareinf.sqf, no need to use param in execute line";
		sleep 10;
	} else {
		_debugMode = true;
		hint "debug activating";
		sleep 5;
		if (_debugMode) then {hint "debugmode activated"};
	};
};

// if marker not defined correctly or error in spelling name exit script and display hint to player.
if (isNil ("_grppatrolmarker")) exitwith {hint "marker isnil or marker not defined correctly or not existing, script will now END"};

// if minimum amount units is specified or not.
if (isNil ("_minSold")) then {
	_minSold = ceil(random 4);
	if (_debugMode) then {hint "no size manually set, auto minimum set at random 4"; sleep 1;};  // for debug.
} else {
	if (_debugMode) then {hint "size was manually set, no change"; sleep 1;};  // for debug.
};

// decide wich type units were selected.

// if random faction selection OA + A2.
if (_faction == "random") then {
	_chooseRandom = floor(random 3);
	_faction = ["blue", "red", "guer"] select _chooseRandom;
};
if (_faction == "blue") then {
	if (_Arma2Version == 0) then {
		_chooseRandom = floor(random 5);
		_faction = ["CDFtroops", "CDFghillie", "usmcspecial", "usmctroops", "usmcghillie"] select _chooseRandom;
	};
	if (_Arma2Version == 1) then {
		_chooseRandom = floor(random 3);
		_faction = ["usghillie", "usspecial", "ustroops"] select _chooseRandom;
	};
	if (_Arma2Version == 2) then {
		_chooseRandom = floor(random 8);
		_faction = ["usghillie", "usspecial", "ustroops", "CDFtroops", "CDFghillie", "usmcspecial", "usmctroops", "usmcghillie"] select _chooseRandom;
	};
};
if (_faction == "red") then {
	if (_Arma2Version == 0) then {
		_chooseRandom = floor(random 6);
		_faction = ["insurgents", "insurgentsplain", "ruspecial", "ruspetsnaz", "rutroops", "rughillie"] select _chooseRandom;
	};
	if (_Arma2Version == 1) then {
		_chooseRandom = floor(random 4);
		_faction = ["taghillie", "taspecial", "tatroops", "tamilitia"] select _chooseRandom;
	};
	if (_Arma2Version == 2) then {
		_chooseRandom = floor(random 10);
		_faction = ["taghillie", "taspecial", "tatroops", "tamilitia", "insurgents", "insurgentsplain", "ruspecial", "ruspetsnaz", "rutroops", "rughillie"] select _chooseRandom;
	};
};
if (_faction == "guer") then {
	if (_Arma2Version == 0) then {
		_chooseRandom = floor(random 3);
		_faction = ["guerillas", "guerillasplain", "guerillaghillie"] select _chooseRandom;
	};
	if (_Arma2Version == 1) then {
		_faction = "guermilitia"
	};
	if (_Arma2Version == 2) then {
		_chooseRandom = floor(random 4);
		_faction = ["guerillas", "guerillasplain", "guerillaghillie", "guermilitia"] select _chooseRandom;
	};

};

// specific OA or A2 version side random selection.
if (_faction == "OAblue") then {
	_chooseRandom = floor(random 3);
	_faction = ["usghillie", "usspecial", "ustroops"] select _chooseRandom;
};
if (_faction == "A2blue") then {
	_chooseRandom = floor(random 5);
	_faction = ["CDFtroops", "CDFghillie", "usmcspecial", "usmctroops", "usmcghillie"] select _chooseRandom;
};
if (_faction == "OAred") then {
	_chooseRandom = floor(random 4);
	_faction = ["taghillie", "taspecial", "tatroops", "tamilitia"] select _chooseRandom;
};
if (_faction == "A2red") then {
	_chooseRandom = floor(random 6);
	_faction = ["insurgents", "insurgentsplain", "ruspecial", "ruspetsnaz", "rutroops", "rughillie"] select _chooseRandom;
};
if (_faction == "OAguer") then {
	_faction = "guermilitia"
};
if (_faction == "A2guer") then {
	_chooseRandom = floor(random 3);
	_faction = ["guerillas", "guerillasplain", "guerillaghillie"] select _chooseRandom;
};
if (_faction == "BAF") then {
	_chooseRandom = floor(random 5);
	_faction = ["bafmulticam", "bafdesghillie", "bafdesert", "bafwoodland", "bafwoodghillie"] select _chooseRandom;
};

// OA units
if (_faction == "tamilitia") then {
	_side = east;
	_group = 0;
	_OAgrp = true;
};
if (_faction == "tatroops") then {
	_side = east;
	_group = 1;
	_OAgrp = true;
};
if (_faction == "taspecial") then {
	_side = east;
	_group = 2;
	_OAgrp = true;
};
if (_faction == "taghillie") then {
	_snipergrp = true;
	_side = east;
	_group = 3;
	_OAgrp = true;
};
if (_faction == "ustroops") then {
	_side = west;
	_group = 4;
	_OAgrp = true;
};
if (_faction == "usspecial") then {
	_side = west;
	_group = 5;
	_OAgrp = true;
};
if (_faction == "usghillie") then {
	_snipergrp = true;
	_side = west;
	_group = 6;
	_OAgrp = true;
};
if (_faction == "guermilitia") then {
	_side = resistance;
	_group = 7;
	_OAgrp = true;
};

// Arma 2 units
if (_faction == "CDFtroops") then {
	_side = west;
	_group = 8;
	_A2grp = true;
};
if (_faction == "CDFghillie") then {
	_snipergrp = true;
	_side = west;
	_group = 9;
	_A2grp = true;
};
if (_faction == "usmcspecial") then {
	_side = west;
	_group = 10;
	_A2grp = true;
};
if (_faction == "usmctroops") then {
	_side = west;
	_group = 11;
	_A2grp = true;
};
if (_faction == "usmcghillie") then {
	_snipergrp = true;
	_side = west;
	_group = 12;
	_A2grp = true;
};
if (_faction == "insurgents") then {
	_side = east;
	_group = 13;
	_A2grp = true;
};
if (_faction == "insurgentsplain") then {
	_side = east;
	_group = 14;
	_A2grp = true;
};
if (_faction == "ruspecial") then {
	_side = east;
	_group = 15;
	_A2grp = true;
};
if (_faction == "ruspetsnaz") then {
	_side = east;
	_group = 16;
	_A2grp = true;
};
if (_faction == "rutroops") then {
	_side = east;
	_group = 17;
	_A2grp = true;
};
if (_faction == "rughillie") then {
	_snipergrp = true;
	_side = east;
	_group = 18;
	_A2grp = true;
};
if (_faction == "guerillas") then {
	_side = resistance;
	_group = 19;
	_A2grp = true;
};
if (_faction == "guerillasplain") then {
	_side = resistance;
	_group = 20;
	_A2grp = true;
};
if (_faction == "guerillaghillie") then {
	_snipergrp = true;
	_side = resistance;
	_group = 21;
	_A2grp = true;
};

// BAF units
if (_faction == "bafmulticam") then {
	_side = west;
	_group = 22;
	_BAFgrp = true;
};
if (_faction == "bafdesghillie") then {
	_snipergrp = true;
	_side = west;
	_group = 23;
	_BAFgrp = true;
};
if (_faction == "bafdesert") then {
	_side = west;
	_group = 24;
	_BAFgrp = true;
};
if (_faction == "bafwoodland") then {
	_side = west;
	_group = 25;
	_BAFgrp = true;
};
if (_faction == "bafwoodghillie") then {
	_snipergrp = true;
	_side = west;
	_group = 26;
	_BAFgrp = true;
};

// use helispawn if east units selected for paragroup.
if (_side == east) then {
	_spawnmarker = _spawn;
};

// create a group with random members from random selected case.
switch (_group) do {
	case 0: {_units = ["TK_INS_Soldier_AA_EP1", "TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_MG_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Soldier_TL_EP1", "TK_INS_Warlord_EP1"];};
	case 1: {_units = ["TK_Soldier_AAT_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_AMG_EP1", "TK_Soldier_AR_EP1", "TK_Soldier_AT_EP1", "TK_Soldier_B_EP1", "TK_Soldier_EP1", "TK_Soldier_Engineer_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_LAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_Medic_EP1", "TK_Soldier_Officer_EP1", "TK_Soldier_SL_EP1"];};
	case 2: {_units = ["TK_Special_Forces_TL_EP1", "TK_Soldier_TWS_EP1", "TK_Special_Forces_MG_EP1", "TK_Soldier_Night_1_EP1", "TK_Soldier_Night_2_EP1", "TK_Special_Forces_EP1"];};
	case 3: {_units = ["TK_Soldier_Spotter_EP1", "TK_Soldier_Sniper_Night_EP1", "TK_Soldier_Sniper_EP1", "TK_Soldier_SniperH_EP1"];};
	case 4: {_units = ["US_Soldier_MG_EP1", "US_Soldier_Marksman_EP1", "US_Soldier_TL_EP1", "US_Soldier_Medic_EP1", "US_Soldier_SL_EP1", "US_Soldier_AAR_EP1", "US_Soldier_AAT_EP1", "US_Soldier_AA_EP1", "US_Soldier_AHAT_EP1", "US_Soldier_AMG_EP1", "US_Soldier_AR_EP1", "US_Soldier_AT_EP1", "US_Soldier_B_EP1", "US_Soldier_EP1", "US_Soldier_Engineer_EP1", "US_Soldier_GL_EP1", "US_Soldier_HAT_EP1", "US_Soldier_LAT_EP1"];};
	case 5: {_units = ["US_Delta_Force_TL_EP1", "US_Delta_Force_Air_Controller_EP1", "US_Delta_Force_Assault_EP1", "US_Delta_Force_EP1", "US_Delta_Force_M14_EP1", "US_Delta_Force_MG_EP1", "US_Delta_Force_Marksman_EP1", "US_Delta_Force_Medic_EP1", "US_Delta_Force_Night_EP1", "US_Delta_Force_SD_EP1", "US_Delta_Force_AR_EP1", "Graves", "Herrera", "Drake", "Pierce", "US_Soldier_Officer_EP1"];};
	case 6: {_units = ["US_Soldier_Sniper_NV_EP1", "US_Soldier_Spotter_EP1", "US_Soldier_SniperH_EP1", "US_Soldier_Sniper_EP1"];};
	case 7: {_units = ["TK_GUE_Bonesetter_EP1", "TK_GUE_Soldier_2_EP1", "TK_GUE_Soldier_3_EP1", "TK_GUE_Soldier_4_EP1", "TK_GUE_Soldier_5_EP1", "TK_GUE_Soldier_AAT_EP1", "TK_GUE_Soldier_AA_EP1", "TK_GUE_Soldier_AR_EP1", "TK_GUE_Soldier_AT_EP1", "TK_GUE_Soldier_EP1", "TK_GUE_Soldier_HAT_EP1", "TK_GUE_Soldier_MG_EP1", "TK_GUE_Soldier_Sniper_EP1", "TK_GUE_Soldier_TL_EP1", "TK_GUE_Warlord_EP1"];};
	case 8: {_units = ["CDF_Commander", "CDF_Soldier", "CDF_Soldier_AR", "CDF_Soldier_Engineer", "CDF_Soldier_GL", "CDF_Soldier_MG", "CDF_Soldier_Marksman", "CDF_Soldier_Medic", "CDF_Soldier_RPG", "CDF_Soldier_Strela", "CDF_Soldier_TL", "CDF_Soldier_Militia", "CDF_Soldier_Officer"];};
	case 9: {_units = ["CDF_Soldier_Sniper", "CDF_Soldier_Spotter"];};
	case 10: {_units = ["FR_AC", "FR_AR", "FR_Assault_GL", "FR_Assault_R", "FR_Commander", "FR_GL", "FR_Marksman", "FR_R", "FR_Sapper", "FR_TL", "FR_Cooper", "FR_Miles", "FR_OHara", "FR_Rodriguez", "FR_Sykes"];};
	case 11: {_units = ["USMC_Soldier", "USMC_Soldier2", "USMC_SoldierM_Marksman", "USMC_SoldierS", "USMC_SoldierS_Engineer", "USMC_Soldier_AR", "USMC_Soldier_AA", "USMC_Soldier_AT", "USMC_Soldier_GL", "USMC_Soldier_HAT", "USMC_Soldier_LAT", "USMC_Soldier_MG", "USMC_Soldier_Medic", "USMC_Soldier_SL", "USMC_Soldier_TL", "USMC_Soldier_Officer"];};
	case 12: {_units = ["USMC_SoldierS_Sniper", "soldierunit", "USMC_SoldierS_SniperH"];};
	case 13: {_units = ["Ins_Commander", "Ins_Soldier_1", "Ins_Soldier_2", "Ins_Soldier_AA", "Ins_Soldier_AR", "Ins_Soldier_AT", "Ins_Soldier_CO", "Ins_Soldier_GL", "Ins_Soldier_MG", "Ins_Soldier_Medic", "Ins_Soldier_Sab", "Ins_Soldier_Sapper", "Ins_Soldier_Sniper"];};
	case 14: {_units = ["Ins_Bardak", "Ins_Lopotev", "Ins_Villager3", "Ins_Villager4", "Ins_Woodlander1", "Ins_Woodlander2", "Ins_Woodlander3", "Ins_Worker2"];};
	case 15: {_units = ["MVD_Soldier", "MVD_Soldier_AT", "MVD_Soldier_GL", "MVD_Soldier_MG", "MVD_Soldier_Marksman", "MVD_Soldier_Sniper", "MVD_Soldier_TL"];};
	case 16: {_units = ["RUS_Commander", "RUS_Soldier1", "RUS_Soldier2", "RUS_Soldier3", "RUS_Soldier_GL", "RUS_Soldier_Marksman", "RUS_Soldier_Sab", "RUS_Soldier_TL"];};
	case 17: {_units = ["RU_Commander", "RU_Soldier", "RU_Soldier2", "RU_Soldier_AA", "RU_Soldier_AR", "RU_Soldier_AT", "RU_Soldier_GL", "RU_Soldier_HAT", "RU_Soldier_LAT", "RU_Soldier_MG", "RU_Soldier_Marksman", "RU_Soldier_Medic", "RU_Soldier_Officer", "RU_Soldier_SL", "RU_Soldier_TL"];};
	case 18: {_units = ["RU_Soldier_Sniper", "RU_Soldier_Spotter", "RU_Soldier_SniperH"];};
	case 19: {_units = ["GUE_Commander", "GUE_Soldier_1", "GUE_Soldier_2", "GUE_Soldier_3", "GUE_Soldier_AA", "GUE_Soldier_AR", "GUE_Soldier_AT", "GUE_Soldier_CO", "GUE_Soldier_GL", "GUE_Soldier_MG", "GUE_Soldier_Medic", "GUE_Soldier_Sab"];};
	case 20: {_units = ["GUE_Villager3", "GUE_Villager4", "GUE_Woodlander1", "GUE_Woodlander2", "GUE_Woodlander3", "GUE_Worker2"];};
	case 21: {_units = ["GUE_Soldier_Scout", "GUE_Soldier_Sniper"];};
	case 22: {_units = ["BAF_Soldier_AA_MTP", "BAF_Soldier_AAA_MTP", "BAF_Soldier_AAT_MTP", "BAF_Soldier_AHAT_MTP", "BAF_Soldier_AAR_MTP", "BAF_Soldier_AMG_MTP", "BAF_Soldier_AT_MTP", "BAF_Soldier_HAT_MTP", "BAF_Soldier_AR_MTP", "BAF_Soldier_EN_MTP", "BAF_Soldier_GL_MTP", "BAF_Soldier_FAC_MTP", "BAF_Soldier_MG_MTP", "BAF_Soldier_scout_MTP", "BAF_Soldier_Marksman_MTP", "BAF_Soldier_Medic_MTP", "BAF_Soldier_Officer_MTP", "BAF_Soldier_MTP", "BAF_Soldier_TL_MTP", "BAF_ASoldier_MTP", "BAF_Soldier_N_MTP", "BAF_Soldier_SL_MTP"];};
	case 23: {_units = ["BAF_Soldier_spotter_MTP", "BAF_Soldier_SniperH_MTP", "BAF_Soldier_Sniper_MTP", "BAF_Soldier_SniperN_MTP", "BAF_Soldier_spotterN_MTP"];};
	case 24: {_units = ["BAF_Soldier_AA_DDPM", "BAF_Soldier_AAA_DDPM", "BAF_Soldier_TL_DDPM", "BAF_Soldier_AHAT_DDPM", "BAF_Soldier_AAT_DDPM", "BAF_Soldier_AAR_DDPM", "BAF_Soldier_AMG_DDPM", "BAF_Soldier_AT_DDPM", "BAF_Soldier_HAT_DDPM", "BAF_Soldier_AR_DDPM", "BAF_Soldier_EN_DDPM", "BAF_Soldier_GL_DDPM", "BAF_Soldier_FAC_DDPM", "BAF_Soldier_MG_DDPM", "BAF_Soldier_scout_DDPM", "BAF_Soldier_Marksman_DDPM", "BAF_Soldier_Medic_DDPM", "BAF_Soldier_Officer_DDPM", "BAF_Soldier_DDPM", "BAF_ASoldier_DDPM", "BAF_Soldier_N_DDPM", "BAF_Soldier_SL_DDPM"];};
	case 25: {_units = ["BAF_Soldier_AA_W", "BAF_Soldier_AAA_W", "BAF_Soldier_AAT_W", "BAF_Soldier_AHAT_W", "BAF_Soldier_AAR_W", "BAF_Soldier_AMG_W", "BAF_Soldier_AT_W", "BAF_Soldier_HAT_W", "BAF_Soldier_AR_W", "BAF_Soldier_EN_W", "BAF_Soldier_GL_W", "BAF_Soldier_FAC_W", "BAF_Soldier_MG_W", "BAF_Soldier_scout_W", "BAF_Soldier_Marksman_W", "BAF_Soldier_Medic_W", "BAF_Soldier_Officer_W", "BAF_Soldier_W", "BAF_ASoldier_W", "BAF_Soldier_N_W", "BAF_Soldier_SL_W", "BAF_Soldier_TL_W"];};
	case 26: {_units = ["BAF_Soldier_SniperH_W", "BAF_Soldier_spotter_W", "BAF_Soldier_Sniper_W", "BAF_Soldier_SniperN_W", "BAF_Soldier_spotterN_W"];};
};
_unitcountchk = count _units;

if (_minSold > _unitcountchk) then {
	_minSold = _unitcountchk;
	if (_debugMode) then {hint "minimum units selected is bigger than group, minimum set at 100%"; sleep 5;};
};

// spawn group - [1,0.45] 1=minimum 1 unit in group - 0.45=45% chance for all others in same case line to be in group.
_spawngroup = [getMarkerpos _spawnmarker, _side, _units, [],[],[0.5,0.8],[],[_minSold,_chancerest]] call BIS_fnc_spawnGroup;

// count group to determine size of heli used.
_howMAny = count units _spawngroup;
if (_insertionType != "plane") then {
	if (_side == east) then {
		if (_A2grp) then {
			_helitypeUsed = "Mi17_Ins";
		} else {
			if (_howMAny < 4) then {
				_helitypeUsed = "UH1H_TK_EP1";
			} else {
				_helitypeUsed = "Mi17_TK_EP1";
			};
		};
	};
	if (_side == west) then {
		if (_A2grp) then {
			if (_howMAny < 12) then {	
				_helitypeUsed = "MH60S";
			} else {
				_helitypeUsed = "MV22";
			};
		};
		if (_OAgrp) then {
			if (_howMAny < 12) then {
				_helitypeUsed = "UH60M_EP1";
			} else {
				_helitypeUsed = "CH_47F_EP1";
			};
		};
		if (_BAFgrp) then {
			if (_howMAny < 8) then {
				_helitypeUsed = "AW159_Lynx_BAF";	
			} else {
				if (_howMAny < 16) then {
					_helitypeUsed = "BAF_Merlin_HC3_D";
				} else {
					_helitypeUsed = "CH_47F_BAF";
				};
			};
		};
	};
	if (_side == resistance) then {
		if (_A2grp) then {
			_helitypeUsed = "Mi17_Ins";
		} else {
			if (_howMAny < 4) then {
				_helitypeUsed = "UH1H_TK_GUE_EP1";
			} else {
				_helitypeUsed = "Mi17_TK_EP1";
			};
		};
	};
};

// if group is snipers set distance from center to bigger to provide longer range sniper support.
if (_snipergrp) then {
	_flybyRange = 800;
	_rangeWP = 0;
	_flyInHeight = 100;
	if (_side == west) then {
		if (_A2grp) then {
			_helitypeUsed = "UH1Y";
			_flyInHeight = 75;
		};
		if (_OAgrp OR _BAFgrp) then {
			_helitypeUsed = "MH6J_EP1";
			_flyInHeight = 35;
		};
	};
	if (_side == east) then {
		if (_A2grp) then {
			_helitypeUsed = "Mi17_Ins";
			_flyInHeight = 200;
		} else {
			_helitypeUsed = "UH1H_TK_EP1";
			_flyInHeight = 50;
		};
	};
	if (_side == resistance) then {
		if (_A2grp) then {
			_helitypeUsed = "Mi17_Ins";
			_flyInHeight = 200;
		} else {
			_helitypeUsed = "UH1H_TK_EP1";
			_flyInHeight = 50;
		};
	};
	if (_insertionType != "para") then {
		_insertionType = "land";
	};
} else {
	// if blackhawk or huey do lower altitude with reg troops as well.
	if (_helitypeUsed == "UH60M_EP1" OR _helitypeUsed == "UH1H_TK_EP1" OR _helitypeUsed == "UH1Y" OR _helitypeUsed == "AW159_Lynx_BAF") then {
		_flyInHeight = 150;
	};
};

// if insertion type is plane select airplane for paradrops.
if (_insertionType == "plane") then {
	_insertionType == "para";
	_flyInHeight = 500;
	_flybyRange = floor(random 500);
	_rangeWP = 0;
	if (_side == east) then {
		if (_A2grp) then {
			_helitypeUsed = "C130J";
		} else {
			_helitypeUsed = "An2_TK_EP1";
		};
	};
	if (_side == west) then {
		if (_A2grp) then {
			_helitypeUsed = "C130J";
		} else {
			_helitypeUsed = "C130J_US_EP1";
		};
	};
	if (_side == resistance) then {
		if (_A2grp) then {
			_helitypeUsed = "C130J";
		} else {
			_helitypeUsed = "An2_2_TK_CIV_EP1";
		};
	};
};	
// create drophelo with full crew at the flying altitude, setting heli to spawn at high altitude only causes nosedive to fiery death when alot of scripts are running, works fine if not. set _flyInHeight to 0 if issues arise in your mission.
_sv = [[getMarkerPos _spawn select 0, getMarkerPos _spawn select 1, _flyInHeight], random 360, _helitypeUsed, _side] call BIS_fnc_spawnVehicle;

// Name the vehicle and group.
_drophelo = _sv select 0;     // vehicle spawned.
_drophelogrp = _sv select 2;  // group of vehicle so waypoints work.

// Repair and refuel incase heli will slam into ground if alot of scripts are active, if player machine or server cannot keep up with heavy load.
_drophelo setDammage 0;  // repair.
_drophelo setFuel 1;     // refuel.

// set what height drophelo will fly in: this seems to fix the crash when spawned at altitude.
_drophelo flyInHeight _flyInHeight;

// move spawned inf grp in dropheli and let heli know they are cargo.
{_x assignAsCargo _drophelo; _x moveInCargo _drophelo} forEach Units _spawngroup;

// set random skill for all crew _drophelo.
{_x setSkill 0.1 + (random 0.9)} forEach Units _drophelogrp;
sleep 0.5;  // thinking time.

_helopilot = driver _drophelo;  // get pilot of drophelo.
_helopilot setSkill 1;          // set high skill on pilot.

// depending on either paradrop or land insertion option, create empty h and get ready for land option.
_dropheliwp = getMarkerPos _spawn;                          // get position of patrolarea from initline.
_invisibleTarget = "HeliHEmpty" createVehicle _dropheliwp;  // create a inv h on patrolarea position.
//hint "invicible h created for heli wp";  // for debug.

// for TESTING, player unit enter drop helo for a ridealong, player moveInCargo didnt work, so player testunit is named ridealong in editor.
if (_debugMode) then {ridealong moveInCargo _drophelo;};  // for debug.

//sleep 30;  // pause to allow heli to touch ground and get repaired and refueled, set at 30 for extra buffer incase heavy scriptload. maybe not needed, depends if mission is heavy load on server or computer, if computer have enough power not needed.

// if engineoff and pilot alive, start problems then turn engine on.
if (!isEngineOn _drophelo AND alive _helopilot) then {
	if (!canMove _drophelo) then {
		// if damaged repair/refuel.
		_drophelo setDammage 0;  // repair.
		_drophelo setFuel 1;     // refuel.
		sleep 1;
	};

	_helopilot action ["engineOn", vehicle _helopilot];
	if (_debugMode) then {hint "engine is turned on"; sleep 1;};  // for debug.
} else {
	if (_debugMode) then {hint "engine was on"; sleep 1;};  // for debug.
};

// go to random Position determined by value set in _flybyRange wich is range from center of paradrop marker, flyby..
_wp0 = _drophelogrp addWaypoint [getMarkerPos (_this select 0), _flybyRange];
_wp0 setWaypointType "MOVE";
_wp0 setWaypointSpeed "FULL";
_wp0 setWaypointBehaviour "AWARE";  // set to "CARELESS" if trouble with enemys distracting heli.
_wp0 setWaypointFormation "LINE";
_wp0 setWaypointStatements ["true", ""];
if (_snipergrp) then {
	sleep 1;
	_wp0 setWaypointBehaviour "STEALTH";  // set to "STEALTH" for silent insertion.
};
if (_insertionType == "plane") then {
	_wp0 setWaypointBehaviour "CARELESS";
};

// go to random pos 200m from paradrop marker and run the paradrop script.
//_wp1Position = [getPos _invisibleTarget select 0, getPos _invisibleTarget select 1, _flyInHeight];
_wp1 = _drophelogrp addWaypoint [getMarkerPos (_this select 0), _rangeWP];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointSpeed "NORMAL";
_wp1 setWaypointBehaviour "AWARE";  // set to "CARELESS" if trouble with enemys distracting heli.
_wp1 setWaypointStatements ["true", ""];
if (_snipergrp) then {
	sleep 1;
	_wp1 setWaypointBehaviour "STEALTH";  // set to "STEALTH" for silent insertion.
	[_drophelogrp, 2] setWPPos getWPPos _wp0;
};
if (_insertionType == "plane") then {
	_wp1 setWaypointBehaviour "CARELESS";
	[_drophelogrp, 2] setWPPos getWPPos _wp0;
};

// activate first move for pilot since damage at spawn together with repair/refuel stops 1st wp to be executed somehow.
_helopilot doMove (getWPPos _wp0);

// check and decide what type insertion to do.
if (_insertionType == "random") then {
	_paraOrNot = floor(random 2);
	if (_paraOrNot == 0) then {
		_insertionType = "para";
	} else {
		_insertionType = "land";
	};
	if (_debugMode) then {hint "no insertion type manually set, random selection activated"; sleep 1;};  // for debug.
	sleep 0.1;
} else {
	if (_debugMode) then {hint "insertion type was manually set, no change"; sleep 1;};  // for debug.
};

// if para dont check for clear landing zone, if land check for clear landing zone and move inv h there.
if (_insertionType == "para" OR _insertionType == "plane") then {
	if (_debugMode) then {hint format["selected insertiontype is %1",_insertionType]; sleep 1;};  // for debug.
} else {
	_wp1 setWaypointType "TR UNLOAD";
	if (_debugMode) then {hint format["selected insertiontype is %1",_insertionType]; sleep 1;};  // for debug.

	_findGoodSpot = true;
	_maxdistWP = 100;
	_LZpos = getWPPos _wp1;
	while {_findGoodSpot} do {
		_posTemp = [_LZpos, 0, _maxdistWP, 10, 0, .5, 0] call BIS_fnc_findSafePos;
		_maxdistWP = _maxdistWP + 10;
		sleep 2;
		_string = format _posTemp;
		sleep 1;
		if (isNil ("_string")) then {
			if (_debugMode) then {hint "no LZ found rechecking"};
		} else {
			_invisibleTarget setPos _posTemp;
			if (_debugMode) then {hint "found LZ"};
			[_drophelogrp, 2] setWPPos getPos _invisibleTarget;
			_findGoodSpot = false;
		};
	};
};
if (_debugMode) then {hint "out of while loop"; sleep 1;};  // for debug.

// check if helo is within 1000 of 1st wp OR if it can move OR if pilot is not alive.
waitUntil {_drophelo distance (getWPPos _wp0) < 1000 OR !canMove _drophelo OR !alive _helopilot};
if (_debugMode) then {hint "1st wp almost done, assigning next wp"; sleep 1;};  // for debug.

// if plane drop method adjust wp approach.
if (_insertionType == "plane") then {
	waitUntil {_drophelo distance (getWPPos _wp1) < (4000 + _flyInHeight) OR !canMove _drophelo OR !alive _helopilot};
	_flyInHeight = 250;
	_drophelo flyInHeight _flyInHeight;
	_wp0 setWaypointSpeed "LIMITED";
	_wp1 setWaypointSpeed "LIMITED";
	waitUntil {_drophelo distance (getWPPos _wp1) < (1500 + _flyInHeight) OR !canMove _drophelo OR !alive _helopilot};
} else {
	// check if helo is within range of 2nd wp OR if it can move OR if pilot is not alive.
	waitUntil {_drophelo distance (getWPPos _wp1) < (150 + _flyInHeight) OR !canMove _drophelo OR !alive _helopilot};
};
if (_debugMode) then {hint "2nd wp almost done, dropping group, moving to last wp in a few secs"};  // for debug

// if heli is damaged or unable to operate, crew heli joinsilent paragroup and paragroup activate emergency eject.
if (!canMove _drophelo OR !alive _helopilot) then {
	_emergency = 1;
	{[_x] joinSilent _spawngroup} foreach Units _drophelogrp;
};

if (_insertionType == "para") then {
	_drophelo flyInHeight _flyInHeight + 10;  // increase flying height to avoid nosedive and slamming paradroppers into the ground.
	sleep 1;  // ZZZZZzzzz getting a little altitude.
};

// once _drophelo is ready and within set distance of 2nd waypoint, start script for choosen insertiontype.
if (_insertionType == "para" OR _insertionType == "plane" OR _emergency == 1) then {
	// if para option selected run paradrop script on group.
	if (_debugMode) then {hint "dropping paras"; sleep 1;};  // for debug.
	nul=[_spawngroup,_grppatrolmarker,_emergency,_upsmonInUse,_insertionType,_snipergrp] execVM "spawns\groupEject.sqf";
} else {
	// if land option selected get group to disembark at LZ.
	if (_debugMode) then {hint "inserting group on LZ"; sleep 1;};  // for debug.
	nul=[_spawngroup,_grppatrolmarker,_emergency,_upsmonInUse,_insertionType,_snipergrp] execVM "spawns\groupEject.sqf";
	_drophelo land "GET OUT"; {if (_x in _drophelo) then {unassignvehicle _x; dogetout _x;}} foreach units _spawngroup;
};

// headback to start position and delete crew and heli when there if no emergency.
if (_emergency == 0) then {
	_wp2 = _drophelogrp addWaypoint [getMarkerpos _spawn, 1];
	_wp2 setWaypointType "MOVE";
	_wp2 setWaypointSpeed "FULL";
	_wp2 setWaypointBehaviour "COMBAT";  // set to combat mode to evade enemys and return safe.
	if (_snipergrp) then {
	_wp2 setWaypointBehaviour "STEALTH";  // set to "STEALTH" for silent insertion.
	};
	_wp2 setWaypointStatements ["true", "deletevehicle (vehicle this); {deleteVehicle _x} forEach units group this;"];
	if (_insertionType == "plane") then {
		_wp2 setWaypointBehaviour "CARELESS";
	};
	if (_debugMode) then {hint "still alive, heading back to be deleted"; sleep 1;};  // for debug.
};

// wait until group is no longer in heli, then delete inv H - this to not cause to much chaos if several land helis come same spot same time and spot is small.
waituntil {{ !( _x in _drophelo)} foreach units _spawngroup};

// set flying height backup at normal if plane used
if (_insertionType == "plane") then {
	_flyInHeight = 500;
	_drophelo flyInHeight _flyInHeight;
};

// clean up invicible h by deleting it.
deleteVehicle _invisibleTarget;

// order pilot to move to last wp to be deleted.
_helopilot doMove (getWPPos _wp2);



// while distance to last wp(delete crew and heli wp).
_stillalive = true;
while {_stillalive} do {
	if (!alive _helopilot AND {alive _x} count crew _drophelo == 0) then {
		//hint "exiting while loop, all dead";  // for debug.
		_stillalive = false;  // set to false so while loop stops and script terminates.
	};

	if (!canMove _drophelo AND {alive _x} count crew _drophelo != 0) then {
		//hint "heli disabled, crew alive, ejecting and commencing patrol on last paradrop area"; // for debug.
		{[_x] joinSilent _spawngroup} foreach Units _drophelogrp;
		_stillalive = false;  // set to false so while loop stops and script terminates.
	};

	if (_drophelo distance (getWPPos _wp2) < 2000) then {
		//hint "last wp almost reached deleting crew and heli and end wp, while loop exits";  // for debug.
		_stillalive = false;  // set to false so while loop stops and script terminates.
	};

	//hint "still while looping";  // for debug.
	sleep 3;
};
if (_debugMode) then {hint "exiting script"; sleep 1;};  // for debug.
};
// END.

groupEject.sqf

// script to make units paradrop from a vehicle at a given wp or trigger, modified to suit my parareinforceV1.1
// params passed on by parareinf.sqf
// execute with:          nul = [group,"marker",if_emergency,if_upsmon_is_in_use] execVM "groupEject.sqf";

// name of script:   groupEject.sqf placed in spawns folder in mission folder - this is for ParaReinforce version 1.1 script.

_grp = _this select 0;              	// get name of group, param transferred by parareinf.sqf.
_grppatrolmarker = _this select 1;  	// get name of area marker_paradropmarker, param transferred by parareinf.sqf.
_emergency = _this select 2;        	// if emergency 1 then fast eject, if 0 then normal eject.
_useUpsmon = _this select 3;        	// if upsmon in use, do not add waypoints for drop squad else set dropsquad wp to guard on marker.
_insertionType = _this select 4;    	// get if parajump or land getout.
_snipergrp = _this select 5;			// if its sniper group set sentry wp mode to stealth.
_rndnr = 0.9;                       	// defeault eject rate in seconds if not emergency.
_debugMode = false;				// set to true to turn on debug mode, wich will display hints.


if (isServer) then {
if (_emergency == 1) then {
	_rndnr = 0.5;       		// set eject rate to faster if emergency.
};

if (_insertionType == "para" OR _insertionType == "plane") then {
	sleep (random 3);
	{
		unassignVehicle (_x);  	// start paradrop routine, with 0.9 second between every man ejecting.
		(_x) action ["EJECT", vehicle _x];
		sleep _rndnr;
	} foreach units _grp;
	if (_debugMode) then {hint "group has parajumped"};  // for debug.
};

if (_useUpsmon == 1) then {
	_leader = leader _grp;  	// get leader of group.
	sleep 0.1;
	nul=[_leader,_grppatrolmarker,"spawned","move","showmarker"] execvm "scripts\UPSMON.sqf";  // start upsmon for leader _grp (whole grp).
	if (_debugMode) then {hint "group started upsmon patrol, exit script"};  // for debug.
} else {
	// if not using ups or upsmon create search and destroy waypoint on marker placed in  editor.
	_wp0 = _grp addWaypoint [getMarkerPos _grppatrolmarker, 100];	// set waypoint on patrol marker.
	_wp0 setWaypointType "SAD";                                  	// set waypoint type to search and destroy.
	_wp0 setWaypointSpeed "FULL";                                	// set waypoint speed.
	_wp0 setWaypointBehaviour "COMBAT";                           	// set waypoint behaviour.
	_wp0 setWaypointFormation "WEDGE";                            	// set waypoint formation.
	_wp0 setWaypointStatements ["true", ""];                 	// set if any scripts to be used on wp (optional).

	_wp1 = _grp addWaypoint [getMarkerPos _grppatrolmarker, floor(random 100)];
	_wp1 setWaypointType "SAD";
	_wp1 setWaypointSpeed "FULL";
	_wp1 setWaypointBehaviour "AWARE";
	_wp1 setWaypointFormation "WEDGE";
	_wp1 setWaypointStatements ["true", ""];

	_wp2 = _grp addWaypoint [getMarkerPos _grppatrolmarker, floor(random 10)];
	_wp2 setWaypointType "SENTRY";                                	// set waypoint to sentry mode, wait until enemy spotted then move on.
	_wp2 setWaypointSpeed "FULL";
	_wp2 setWaypointBehaviour "AWARE";
	if (_snipergrp) then {
		_wp2 setWaypointBehaviour "STEALTH";
	};
	_wp2 setWaypointFormation "DIAMOND";                			// set wformation to diamond to get better view.
	_wp2 setWaypointStatements ["true", ""];

	_wp3 = _grp addWaypoint [getWPPos _wp0, 5];
	_wp3 setWaypointType "SAD";
	_wp3 setWaypointSpeed "FULL";
	_wp3 setWaypointBehaviour "COMBAT";
	_wp3 setWaypointFormation "WEDGE";
	_wp3 setWaypointStatements ["true", ""];

	_wp4 = _grp addWaypoint [getWPPos _wp3, 1];
	_wp4 setWaypointType "CYCLE";                                	// start cycle back to 1st wp search and destroy, then repeat all wps.
	_wp4 setWaypointSpeed "FULL";
	_wp4 setWaypointBehaviour "COMBAT";
	_wp4 setWaypointFormation "WEDGE";
	_wp4 setWaypointStatements ["true", ""];
	if (_debugMode) then {hint "last waypoint created, exit script"};	// for debug.
};
};
//END.

For those using UPSMON read readme and you will need this alphaMarker.sqf

// will make any marker included here to be invicible on map, and not shown in MP lobby/map aswell - not needed for empty markers, only needed to hide upsmon patrol markers.
"patrol1" setMarkerAlpha 0;
"patrol2" setMarkerAlpha 0;
"patrol3" setMarkerAlpha 0;
"patrol4" setMarkerAlpha 0;
"patrol5" setMarkerAlpha 0;

Demo mission here:

OA demo version

Arma2 demo version:

In demo mission ive placed several blue arrow markers with text describing whats what, these look messy and can be deleted, also debug mode is on by defeault so you get a feel for whats happening and can join in on the paradrops to see how it works.

Turn off debug in top of parareinf.sqf by setting it to false, info in script as well.

In mission there is several radio triggers, press 0 then 0 and choose selected one to try it out.

The first 2 mins you can do in peace, after that patrols already placed by me starts calling in their own para reinforcements, with short intervalls, wich isnt pretty realistic, but shows the effect squeezed into short timeframe.

Suggest you adjust your own triggers to be longer time or count this list dependent.

Any feedback or suggestons is very welcome.

Hope you find a use for this script.

o7

Feel free to modify, skin, strip, bash and trample script at will, if you use it in your own releases it would be nice with a little credit line.

Edited by Demonized
Updated to V1.21 due to patch 1.57 fixing AI flying

Share this post


Link to post
Share on other sites

Many thanks, I have a Para drop but always wanted them to then use UPSMOM – so thanks for sharing ill try this out and add this to my missions !

Keep them coming ïŠ

Share this post


Link to post
Share on other sites

Added small bugfix where east and west spawned same time and started killing eachother before they got into heli.

Displayed script, readme and demo mission link is updated with fixed version.

Added in line 117 in parareinf.sqf

	// use helispawn if east units selected for paragroup.
if (_side == east) then {
	_spawnmarker = _spawn;
};

Edited by Demonized

Share this post


Link to post
Share on other sites

Cool script - any chance of adding russian (ArmA2) unit types?

EDIT

Just found the classnames and variables in the parareinf.sqf. Sorted now ta.

Edited by Enders

Share this post


Link to post
Share on other sites

script updated to v1.2

Now including all arma2 and OA west, east, resistance as well as BAF.

Added Arma 2 only demo mission as well.

Update changelog in first post under spoiler.

Share this post


Link to post
Share on other sites

script and demo missions updated, small change to script default flying height now since patch 1.57 fixes AI flying.

Changelog now in text file in demo mission file, because i reached 50k letter limit here in post.

Set the correct A2 and OA standalone option in demo missions, adjust to CO in top of parareinf.sqf if you are using CO

2=Combined Operations (a2 + OA)

_Arma2Version = 2;

Edited by Demonized
Script updated to v1.21

Share this post


Link to post
Share on other sites

Hi Demonized,

I seem to have a little issue , when they para jump from the heli they end up faling to the ground without a parashoot only about 2 have them on, and the other parashoots come down without anybody attached ? is this a bug ?

Love the script by the way !

Share this post


Link to post
Share on other sites
Hi Demonized,

I seem to have a little issue , when they para jump from the heli they end up faling to the ground without a parashoot only about 2 have them on, and the other parashoots come down without anybody attached ? is this a bug ?

Love the script by the way !

Thank you :)

I will check this tonight, are you using any beta patch or mods?

It was working for all AI in 1.56, and i maybe did not test this fully in 1.57.

Tho if height is extreme low AI paras will fall dead anyway but should still open chute.

AI is using standard eject command so they should use paras automatically, need to investigate, also ive been tinkerig with using config groups as well, will bug hunt and try to release fixed version tonight.

Share this post


Link to post
Share on other sites

Hi, no not using any Beta patch just using 1.57, and just some island Mods.

It was tested on Takistan, but I just tested again today and they all come out fine might just have been one of those things will give it a few more goes.

This was tested on a Dedi server BTW

I set the trigger as repeat by mistake and OMG how much fun was that they just kept on coming :)

If I could suggest / request a few things that would really enhance this already great script!?

1) Have the ability to select spawns , numbers and delay i.e once /Repeated/ wave

Repeated = Once they have been killed another heli drop will come in

Wave= after x amount of time another will spawn

Once= will spawn just once

With number of spawns and delay

i.e

_null = ["marker","para","taspecial",12,â€onceâ€,1,1] execVM "spawns\parareinf.sqf";

....Will spawn once 1 sec delay

_null = ["marker","para","taspecial",12,â€waveâ€,5,60] execVM "spawns\parareinf.sqf";

Will spawn 5 times 60 sec apart

_null = ["marker","para","taspecial",12,â€repeatedâ€,5,120] execVM "spawns\parareinf.sqf";

Will spawn 5 more times 120 sec apart after all para drop has been killed

Not sure if this can be done but would save a lot of triggers and make para dropping a dodle

Keep up the great scripts :)

---------- Post added at 03:57 PM ---------- Previous post was at 03:48 PM ----------

I thought this might help I dug this out as it uses the suggestion above.

//    File: murk_spawn.sqf
//	Function: To allow for simple trigger based spawning using editor placed units and waypoints.
//		    The script deletes all units when the mission start and the recreate them on command.
//    Parameters: 
//			_this select 0: OBJECT - unit name (this) 
//			_this select 1: OBJECT - trigger name
//			_this select 2: STRING - spawn type ("once","repeated","wave" and "reset")
//			_this select 3 (optional): NUMBER - spawn lives (the amount of time the unit respawns, or wave number)
//			_this select 4 (optional): NUMBER - spawn delay
//			_this select 5 (optional): STRING - init string called for the leader of the group
//			_this select 6 (optional): NUMBER-  will start removal sequence of all dead group members after X seconds (default 120)
//	Usage: 
//		Example trigger: Anybody Once (or whatever you want), onActivation: this setVariable ["murk_spawn",true,true];
//		Unit (leader of group):	nul = [this,triggername,"once"] exec "murk_spawn.sqf"; 
//		init.sqf: triggername setVariable ["murk_spawn",false,false]; 
//
// V6 - Dedicated to Xeno, for his advice
// - Fix: Performance/effiency optimizations across the board
//	- Shortened parameters
// 	- Improved group cleanup, units in groups are now always deleted so that the group can be deleted
//	- New type of unit cleanup, no longer spawns eventhandlers for each unit
//	- Better array usage, no more additions over multiple arrays
//	- Moved the internal turret crew function out
//	- Further attempt to make vehicle/infantry storage and recreation more similar in order to cut code
// - Fix: Now supports mixed infantry and vehicle groups
// V5
// - Change: Removed group and function scripts, everything done in a single file
// - Change: Spawn trigger variable is now a setVariable of the trigger instead of a global variable
// - Add: Option to enable removal of dead units, eventhandler attached to everyone spawning
// - Fix: Should now work in multiplayer on a dedicated server (only tested on a local dedicated/join setup however)
// - Fix: Performance issues with helos from V4 resolved
// - Fix: Some minor bugs with the optional parameters
// - Fix: Now properly support crews in turrets-on-turrets (had to bring in some BIS made functions)
// V4
// - See older versions
// This script is serverside
if(!isServer) exitWith {};

// -------------------  Init  ----------------------- //
_waitingPeriod = 10; // Change this for the default waiting period
_countThis = count _this;

// ----------------  Parameters  -------------------- //
_unit = _this select 0;
_trigger = _this select 1;
_spawntype = _this select 2;
_spawnlives = if (_countThis >= 4) then { _this select 3; } else { 1 }; // Optional
_spawndelay = if (_countThis >= 5) then { _this select 4; } else { 1 }; // Optional
_initString = if (_countThis >= 6) then { _this select 5; } else { "" }; // Optional
_bodyRemove = if (_countThis >= 7) then { _this select 6; } else { 120 }; // Optional

// --  Delete the unit (this is always done ASAP)  -- //
_unitArray = [];
_unitGroup = group _unit;
_unitsInGroup = units _unitGroup;
_unitCount = count _unitsIngroup;
_unitsInGroupAdd = [];

while { _unitCount > 0 } do { 
// The currently worked on unit
_unitsInGroup = units _unitGroup;
_unit = _unitsInGroup select 0;
_unitCount = count _unitsInGroup;
// Check if its a vehicle
if ( (vehicle _unit) isKindOf "LandVehicle" OR (vehicle _unit) isKindOf "Air") then { 
	_vcl = vehicle _unit;
	if (!(_vcl in _unitsInGroupAdd) AND (typeOf _vcl != "")) then {
		_unitsIngroupAdd set [count _unitsInGroupAdd, _vcl];
		_unitCrewArray = [];
		_crew = crew _vcl;
		{ _unitCrewArray set [count _unitCrewArray, typeOf _x]; } forEach _crew;
		_unitInfoArray = [typeOf _vcl,getPos _vcl,getDir _vcl,vehicleVarName _vcl,skill _vcl,rank _vcl,weapons _vcl,magazines _vcl,_unitCrewArray];
		_unitArray set [count _unitArray, _unitInfoArray];
		deleteVehicle _vcl;
		{ deleteVehicle _x; } forEach _crew;
	};
}
// Otherwise its infantry
else {
	_unitInfoArray = [typeOf _unit,getPos _unit,getDir _unit,vehicleVarName _unit,skill _unit,rank _unit,weapons _unit,magazines _unit,[]]; 
	_unitArray set [count _unitArray, _unitInfoArray];
	deleteVehicle _unit;
};
sleep 0.01;
};

// -----------------  Functions  -------------------- //

// *WARNING* BIS FUNCTION RIPOFF - Taken from fn_returnConfigEntry as its needed for turrets and shortened a bit
_fnc_returnConfigEntry = {
private ["_config", "_entryName","_entry", "_value"];
_config = _this select 0;
_entryName = _this select 1;
_entry = _config >> _entryName;
//If the entry is not found and we are not yet at the config root, explore the class' parent.
if (((configName (_config >> _entryName)) == "") && (!((configName _config) in ["CfgVehicles", "CfgWeapons", ""]))) then {
	[inheritsFrom _config, _entryName] call _fnc_returnConfigEntry;
}
else { if (isNumber _entry) then { _value = getNumber _entry; } else { if (isText _entry) then { _value = getText _entry; }; }; };
//Make sure returning 'nil' works.
if (isNil "_value") exitWith {nil};
_value;
};

// *WARNING* BIS FUNCTION RIPOFF - Taken from fn_fnc_returnVehicleTurrets and shortened a bit
_fnc_returnVehicleTurrets = {
private ["_entry","_turrets", "_turretIndex"];
_entry = _this select 0;
_turrets = [];
_turretIndex = 0;
//Explore all turrets and sub-turrets recursively.
for "_i" from 0 to ((count _entry) - 1) do {
	private ["_subEntry"];
	_subEntry = _entry select _i;
	if (isClass _subEntry) then {
		private ["_hasGunner"];
		_hasGunner = [_subEntry, "hasGunner"] call _fnc_returnConfigEntry;
		//Make sure the entry was found.
		if (!(isNil "_hasGunner")) then {
			if (_hasGunner == 1) then {
				_turrets = _turrets + [_turretIndex];		
				//Include sub-turrets, if present.
				if (isClass (_subEntry >> "Turrets")) then { _turrets = _turrets + [[_subEntry >> "Turrets"] call _fnc_returnVehicleTurrets]; } 
				else { _turrets = _turrets + [[]]; };
			};
		};
		_turretIndex = _turretIndex + 1;
	};
};
_turrets;
};

_fnc_moveInTurrets = {	
private ["_turrets","_path","_i"];
_turrets = _this select 0;
_path = _this select 1;
_currentCrewMember = _this select 2;
_crew = _this select 3;
_spawnUnit = _this select 4;
_i = 0;     
while {_i < (count _turrets)} do { 
	 _turretIndex = _turrets select _i;
	_thisTurret = _path + [_turretIndex];
	(_crew select _currentCrewMember) moveInTurret [_spawnUnit, _thisTurret]; _currentCrewMember = _currentCrewMember + 1;
	//Spawn units into subturrets.
	[_turrets select (_i + 1), _thisTurret, _currentCrewmember, _crew, _spawnUnit] call _fnc_moveInTurrets;
	_i = _i + 2;
};
};

// This is the general cleanup function running in the background for the group, replaces the removebody eventhandler and delete group in V5
_fnc_cleanGroup = {
_group = _this select 0;
_unitsGroup = units _group;
_sleep = _this select 1;
// Hold until the entire group is dead
while { ({alive _x} count _unitsGroup) > 0 } do { sleep 5; };
sleep _sleep;
{
	_origPos = getPos _x;
	_z = _origPos select 2;
	_desiredPosZ = if ( (vehicle _x) iskindOf "Man") then { (_origPos select 2) - 0.5 } else { (_origPos select 2) - 3 };
	if ( vehicle _x == _x ) then {
		_x enableSimulation false;
		while { _z > _desiredPosZ } do { 
			_z = _z - 0.01;
			_x setPos [_origPos select 0, _origPos select 1, _z];
			sleep 0.1;
		};
	};
	deleteVehicle _x; 
	sleep 5;
} forEach _unitsGroup;		
// Now we know that all units are deleted
deleteGroup _group;
};

_fnc_spawnUnit = {
// We need to pass the old group so we can copy waypoints from it, the rest we already know
_oldGroup = _this select 0;
_newGroup = createGroup (side _oldGroup);
_newGroup copyWaypoints _oldGroup;
// If the old group doesnt have any units in it its a spawned group rather than respawned
if ( count (units _oldGroup) == 0) then { deleteGroup _oldGroup; };
{
	_spawnUnit = Object;
	_unitType = _x select 0; _unitPos  = _x select 1; _unitDir  = _x select 2;
	_unitName = _x select 3; _unitSkill = _x select 4; _unitRank = _x select 5;
	_unitWeapons = _x select 6; _unitMagazines = _x select 7; _unitCrew = _x select 8;
	// Check if the unit has a crew, if so we know its a vehicle
	if (count _unitCrew > 0) then { 
		if (_unitPos select 2 >= 10) then { 
			_spawnUnit = createVehicle [_unitType,_unitPos, [], 0, "FLY"]; 
			_spawnUnit setVelocity [50 * (sin _unitDir), 50 * (cos _unitDir), 0];
		}
		else { _spawnUnit = _unitType createVehicle _unitPos; };
		// Create the entire crew
		_crew = [];
    			{ _unit = _newGroup createUnit [_x, getPos _spawnUnit, [], 0, "NONE"]; _crew set [count _crew, _unit]; } forEach _unitCrew;
      	// We assume that all vehicles have a driver, the first one of the crew
		(_crew select 0) moveInDriver _spawnUnit;
		// Count the turrets and move the men inside	      	
      	_turrets = [configFile >> "CfgVehicles" >> _unitType >> "turrets"] call _fnc_returnVehicleTurrets;
      	[_turrets, [], 1, _crew, _spawnUnit] call _fnc_moveInTurrets; 	      	
	}
	// Otherwise its infantry
	else { 
		_spawnUnit = _newGroup createUnit [_unitType,_unitPos, [], 0, "NONE"]; 
		removeAllWeapons _spawnUnit;
		{_spawnUnit removeMagazine _x} forEach magazines _spawnUnit;
		removeAllItems _spawnUnit;
		{_spawnUnit addMagazine _x} forEach _unitMagazines;
		{_spawnUnit addWeapon _x} forEach _unitWeapons;
		_spawnUnit selectWeapon (primaryWeapon _spawnUnit);
	};
	// Set all the things common to the spawned unit
	_spawnUnit setDir _unitDir;
	_spawnUnit setSkill _unitSkill;
	_spawnUnit setUnitRank _unitRank;
	if (_spawntype == "once" OR _spawntype == "repeated") then { 
		_spawnUnit setVehicleVarName _unitName;
		if (vehiclevarname _spawnUnit != "") then { _spawnUnit setVehicleInit format["%1=this;",_unitName]; processInitCommands; };
	};
} forEach _unitArray;
// setting the leaders init and the groups body removal time
(vehicle (leader _newGroup)) setVehicleInit _initString; processInitCommands;
// Run the cleanup function for this group
[_newGroup, _bodyRemove] spawn _fnc_cleanGroup;
// Have to return the new group
_newGroup;
};

// --------------  Waiting period  ------------------ //
while { !(_trigger getVariable "murk_spawn") } do { sleep _waitingPeriod; };

// ---------------  Spawn Modes  ------------------- //
// REPEAT MODE, ie basic respawn based on lives
if (_spawntype == "repeated") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	_unitsGroup = units _unitGroup;	
	while { ({alive _x} count _unitsGroup) > 0 } do { sleep 2; };
	sleep _spawndelay;
};
};

// WAVE MODE, this is fairly simple, just sleep a while then respawn. Spawnlives in this case is number of waves
if (_spawntype == "wave") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	sleep _spawndelay;
};
};

// RESET MODE, sleep a while then set the variable to false (even if you set it like 50 times over). Spawn lives is used to tick how many times its possible to reset.
if (_spawntype == "reset") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	sleep (_waitingPeriod + 10);
	_trigger setVariable ["murk_spawn",false,false];
	while { !(_trigger getVariable "murk_spawn") } do { sleep _waitingPeriod; };
};
};

// ONCE MODE
if (_spawntype == "once") then { _unitGroup = [_unitGroup] call _fnc_spawnUnit; };

Share this post


Link to post
Share on other sites

Lol youre a fricking mind reader :)

Im actually working right now on the reinforce repeat, or wave as you much better describing call it, doing final tests now will release later tonight.

Will adapt your suggestions.

Regarding no chute problem:

I did tests on both chernarus and takistan using both heli and plane paradrop.

Also tried above with upsmon active and not.

Also tried with latest beta and official 1.57.

All worked fine as you said in last post, but i did see in chernarus map 1 soldier dropped to the ground when dropped by heli, but i could not replicate it after first time.

Tried increasing amount of AI on map, still all dropped fine, also did test with sure death very low drops, all dropped fine and deployed parachute, but ofc died when they hit ground.

I did download the mission from the 1st post incase there was a problem with the download aswell.

Think we can write it off as Arma native hickup for now.

This was tested on a Dedi server BTW

Sweet tnx.

Share this post


Link to post
Share on other sites

HAHAH

Just tested again on Dedi and they all come out fine all 10 heli drops perfect ! and using UPSMON.

Cannot wait for the revised script will be awsome no more coundown triggers :)

Share this post


Link to post
Share on other sites

spent last night creating the wave functions, then i got a missing { error, spent hours hunting for the missing one....

Was way to tired to acomplish anything useful, then today i realised i did not miss one, i had accidently inserted one in a hint line creating the error, well, anyway updated release will be postponed as i need to rewrite large parts of script to work as i want.

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  

×