Jump to content

Recommended Posts

does anyone know how to use the simplecachev2 script? i can only get the original one to run?

---------- Post added at 13:10 ---------- Previous post was at 12:35 ----------

the details about the simplecachev2 and how to use it are not noob friendly at all :(

Share this post


Link to post
Share on other sites

To be honest I don't know at all how to use the simplecache and would like to know how to.

I did place a marker and then placed a trigger for militarize ( there I added in the onAct field the parameters from the AISSP Tool ) - so the guys are spawning and fighting but because of permanent respawn in the area of combat I had to increase the trigger area so we would not by accident leave the trigger zone and this way piling up new spawns ....

One other thing thats bothering me is this that we get in a nice firefight but after we start cleaning the streets, alley ways and so un we suddenly stumble across non responsive soldiers - they just walk by and make no attempt to fight us even though we engage them for the sake of provocation.

Share this post


Link to post
Share on other sites
How Can I have the dead bodies removed??

There are plenty of dead body removal scripts out there, Google is your friend :).

Share this post


Link to post
Share on other sites

When I set the simplecache as follows:

nul = [[2],[],100,true,true] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";

so that it should work for all playable units, the units spawn instantly when you are not within the spawn distance and do not despawn. it only works if I leave the player settings as default:

nul = [[2],[player],100,true,false] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";

Any ideas?

Share this post


Link to post
Share on other sites
There are plenty of dead body removal scripts out there, Google is your friend :).

Thank you so much for your help.

Please excuse my ignorance and stupidity!!

This is getting a major annoyance that someone asks a question for help and people have nothing better to do to tell people to go and search for it rather than to help.

If I would have done so everytime a question was asked by someone than a lot of computer systems would be turned into rubbish or people would not be able to do a lot of things on their systems.

Share this post


Link to post
Share on other sites
First off thank you for your hard work, on this script.

Ok to simplify this, I'll explain exactly what I am trying to do.

I am currently running Wasteland 1.0b.

I want to run militorize.sqf every time a player from a faction captures a territory, the script will run and spawn AI to protect the territory for the team that captured it.

ANY help would be greatly appreciated.

Thank you for your help in advance!!!

-Steve

If you've made any progress, please let me know.

Share this post


Link to post
Share on other sites

How would I go about choosing custom groups to be spawned? I don't want to spawn CSAT but units from a custom faction

Share this post


Link to post
Share on other sites
How would I go about choosing custom groups to be spawned? I don't want to spawn CSAT but units from a custom faction

you need to find the script file you want to change (ak Militarize / ambient combat / reinforcement )

and change the following (see lines below wich are in BOLD) parts to the troops you want (my _redManArray is already changed from CSAT to Middle Eastern IS fighters)

[b]_blueMenArray[/b] = ["B_Soldier_A_F","B_soldier_AR_F","B_medic_F","B_engineer_F","B_soldier_exp_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AA_F","B_soldier_AT_F","B_officer_F","B_soldier_repair_F","B_Soldier_F","B_soldier_LAT_F","B_Soldier_lite_F","B_Soldier_SL_F","B_Soldier_TL_F","B_soldier_AAR_F","B_soldier_AAA_F","B_soldier_AAT_F"];
[b]_redMenArray[/b] = ["MEC_IS_SquadLeader","MEC_IS_Rifleman","MEC_IS_MachineGunner","MEC_IS_Medic","MEC_IS_AutoRifleman","MEC_IS_Rifleman","MEC_IS_Rifleman","MEC_IS_Rifleman","MEC_IS_RPG7Soldier","MEC_IS_Rifleman","MEC_IS_Rifleman","MEC_IS_Rifleman"];
[b]_greenMenArray[/b] = ["I_Soldier_A_F","I_soldier_AR_F","I_medic_F","I_engineer_F","I_soldier_exp_F","I_Soldier_GL_F","I_soldier_M_F","I_soldier_AA_F","I_soldier_AT_F","I_officer_F","I_soldier_repair_F","I_Soldier_F","I_soldier_LAT_F","I_Soldier_lite_F","I_Soldier_SL_F","I_Soldier_TL_F","I_soldier_AAR_F","I_soldier_AAA_F","I_soldier_AAT_F"];
[b]_yellowMenArray[/b] = ["C_man_p_beggar_F","C_man_1","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F",
"C_man_shorts_1_F","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_p_fugitive_F","C_man_p_shorts_1_F","C_man_hunter_1_F",
"C_man_pilot_F","C_man_shorts_2_F","C_man_shorts_3_F","C_man_shorts_4_F","C_man_w_worker_F",
"C_man_p_beggar_F_euro","C_man_1_euro","C_man_polo_2_F_euro","C_man_polo_3_F_euro","C_man_polo_4_F_euro","C_man_polo_5_F_euro","C_man_polo_6_F_euro",
"C_man_shorts_1_F_euro","C_man_p_fugitive_F_euro","C_man_p_shorts_1_F_euro","C_man_shorts_2_F_euro","C_man_shorts_3_F_euro","C_man_shorts_4_F_euro",
"C_man_p_beggar_F_afro","C_man_1_afro","C_man_polo_2_F_afro","C_man_polo_3_F_afro","C_man_polo_4_F_afro","C_man_polo_5_F_afro","C_man_polo_6_F_afro",
"C_man_shorts_1_F_afro","C_man_p_fugitive_F_afro","C_man_p_shorts_1_F_afro","C_man_shorts_2_F_afro","C_man_shorts_3_F_afro","C_man_shorts_4_F_afro",
"C_man_p_beggar_F_asia","C_man_1_asia","C_man_polo_2_F_asia","C_man_polo_3_F_asia","C_man_polo_4_F_asia","C_man_polo_5_F_asia","C_man_polo_6_F_asia",
"C_man_shorts_1_F_asia","C_man_p_fugitive_F_asia","C_man_p_shorts_1_F_asia","C_man_shorts_2_F_asia","C_man_shorts_3_F_asia","C_man_shorts_4_F_asia"];

_BLUdivers = ["B_diver_F","B_diver_exp_F","B_diver_TL_F"];
_OPFdivers = ["O_diver_F","O_diver_exp_F","O_diver_TL_F"];
_INDdivers = ["I_diver_F","I_diver_exp_F","I_diver_TL_F"];

_yellowCarArray = ["C_Offroad_01_F","C_Quadbike_01_F","C_Hatchback_01_F","C_Hatchback_01_sport_F","C_SUV_01_F","C_Van_01_transport_F","C_Van_01_box_F"];

Edited by supergruntsb78
provide extra info

Share this post


Link to post
Share on other sites
i love your script, i made world war IV and its awesome and performance friendly even with many AI spawning around you.

but i have some ideas you could do, so me and others can do world war V in arma 3:

1. what about an ambient air combat script ? the script spawn mainly jets when u are in the air and the BLUFOR-OPFOR-INDFOR jets fighting each other and you when u are flying with a helicopter or a jet. same as ambient combat you could define which faction jets appear, how many jets at once spawn in the air, min delay spawn, max delay spawn, distance spawn etc...

the only hardest part of it would be = to make them spawn only if you are in the air.

but if you can´t do that, its no problem when they spawn even if you are on the ground, it would be awesome too.

for the rest: i think it wouldnt be hard to do, just copy the ambientcombat script, paste it with a new name and replace all the units that ambient combat spawn, with jets & helicopters and make them spawn in flying mode.

2. could you add a script which let you spawn random convoys near @ you ? just like the ALIVE module had it (but they removed it idk why). and here the define of max amount spawn at the same time, spawn delay etc..

3. could you add a define for the ambientcombat script which let you define of how many vehicles spawn at the same time ? like on the militarize script, it lets you define of how many vehicles spawn.

4. could you make a trigger version of the militarize script ? so the militarize script spawn units near at you no matter where you go, just like the ambientcombat script.

or is it possible to make it as trigger in the editor or via script ? if yes, can you explain how ?

5. could you make a script which spawns random artillery/mortar impacts and CAS support (all types, missle run, gun run, missile & gun run) around you ? where you can define the amount of mortar/artillery impacts and CAS attacks ?

the mortar/artillery/CAS attacks could be spawn together when units/vehicles spawn, for example when a group of opfor spawn, then a CAS jet will spawn at the same time and attack the opfor group which spawned at the same time with the group and you could make it that not every group that spawn, will automaticlly attacked by mortars/artillery impacts and/or CAS attacks. example:

first time:

BLUFOR group spawn, at the same time, artillery will impact where the group spawned

second time:

a group spawn again, but this time there wont be a artillery/mortar/CAS attack.

third time:

there could be another attack, but must not be.

here is a example script where helis spawn and may crash, you can define there the chance that the helicopter crash and its random, means: first time heli spawn, no crash, second time the heli spawns, there maybe a crash etc: http://forums.bistudio.com/showthread.php?185574-RELEASE-Helicopter-Crash-Script-Scripted-Heli-Flyovers

if this isnt possible, could you make the script just spawn random artillery/mortar/CAS attacks around you ? since factions from all 3 sides spawn around you, there could be a chance that the artillery/mortar/CAS attacks hit them and there could be a chance of friendly hits/friendly fire, which is also realistic too.

thats all for now. nice work :)

i want to know too. is it possible ?

Share this post


Link to post
Share on other sites

Hey spunFIN ive been using your awesome script pack for a good while now and its been great, but it seems since the last BIS update my Ambient spawned units are not patrolling or receiving waypoints they just stand in formation until they are engaged or spot an enemy. I was wondering if you have encountered this problem recently? I have tried adjusting things on my end but with no luck which led me to assume maybe the last BIS update broke something. Also im not really getting any script errors on my debug console that would give me any clues as to what is happening.

Share this post


Link to post
Share on other sites

SpunFIN i love this script :) works really well, many thanks for it.

Now, does anyone have any idea how i can remove First Aid Kits from every unit ? I tried adding removeItems "FirstAidKit"; in the players init via the flash script, I just get errors about missing simicolons

This is my code

nul = [logic,3,150,[true,false],[false,false,false],false,[10,0],[3,0],"default",nil,"removeItems "FirstAidKit";",1] execVM "LV\militarize.sqf";

Thanks in advance

Share this post


Link to post
Share on other sites

Change the double quotes (" ") around FirstAidKit to single quotes (' ') and see if that helps.

Share this post


Link to post
Share on other sites

nul = [logic,3,150,[true,false],[false,false,false],false,[10,0],[3,0],"default",nil,"this removeItems 'FirstAidKit';",1] execVM "LV\militarize.sqf";

should working ;

Share this post


Link to post
Share on other sites

That worked perfectly, thank you JShock and Mariodu62 :)

Can i be a pest and ask for one more bit of help ? how would i also remove their backpack ? I don't want players gearing up from them.

I thought the following would work but nope :(

init="nul = [l3,3,400,[true,false],[false,false,false],false,[1,1],[3,0],1,nil,""this removeItems 'FirstAidKit';this removeBackpack;"",3] execVM ""LV\militarize.sqf"";";

* Edit *

Never mind i got it, had this wrong, it should of been :

init="nul = [l3,3,400,[true,false],[false,false,false],false,[1,1],[3,0],1,nil,""this removeItems 'FirstAidKit';removeBackpack this;"",3] execVM ""LV\militarize.sqf"";";

Edited by Richie

Share this post


Link to post
Share on other sites
That worked perfectly, thank you JShock and Mariodu62 :)

Can i be a pest and ask for one more bit of help ? how would i also remove their backpack ? I don't want players gearing up from them.

I thought the following would work but nope :(

init="nul = [l3,3,400,[true,false],[false,false,false],false,[1,1],[3,0],1,nil,""this removeItems 'FirstAidKit';this removeBackpack;"",3] execVM ""LV\militarize.sqf"";";

You got it backwards it's "removeBackpack this".

Share this post


Link to post
Share on other sites

How do I remove the groups from a paradrop?

That is a really simple and fun script. Like it a lot!

Share this post


Link to post
Share on other sites
Hey spunFIN ive been using your awesome script pack for a good while now and its been great, but it seems since the last BIS update my Ambient spawned units are not patrolling or receiving waypoints they just stand in formation until they are engaged or spot an enemy. I was wondering if you have encountered this problem recently? I have tried adjusting things on my end but with no luck which led me to assume maybe the last BIS update broke something. Also im not really getting any script errors on my debug console that would give me any clues as to what is happening.

I am having the exact same issue here.

Share this post


Link to post
Share on other sites

I have the problem, that the helicopter is coming but no paratroops jump from him. He´s going to the correct spot, but nur paratroops. Any suggestions?

Share this post


Link to post
Share on other sites
I have the problem, that the helicopter is coming but no paratroops jump from him. He´s going to the correct spot, but nur paratroops. Any suggestions?

Yes, i have one.

I had this issue when i was using a server cleaner.

This cleaner was deleting the empty groups.

The solution was to stop deleting empty groups automaticly.

Now arma3 delete automaticly empty groups.

Try do delay the group creation to just before the guy jump.

Here is the corrected code i used in our mission to solve the issue.

Try it, it was working for me, but never tried with the new functionnality of arma.

BR

/*
			***		ARMA3Alpha HELI PARADROP v1.1 - by SPUn / lostvar	***

				Spawns chopper which delivers paradrop group to scene

	Calling the script:

		default: 		nul = [this] execVM "LV\heliParadrop.sqf";

		custom: 		nul = [spot, side, allowDamage, captive, distance, direction, flyby, fly height, jump distance,
							group size, jump delay, open height, smokes, flares, chems, patrol, target, cycle, skills,
							group, custom init, ID, MP] execVM "LV\heliParadrop.sqf";

Parameters:

spot 	= 	drop spot 		(name of marker or object or unit, or position array) 									DEFAULT: --
side 	= 	1 or 2 or 3		(1 = west, 2 = east, 3 = independent)													DEFAULT: 2
allowDamage = 	true/false	(allow or disallow damage for chopper)													DEFAULT: true
captive 	= 	true/false 	(if true, enemies wont notice chopper) 													DEFAULT: false
distance 	= 	number 		(from how far chopper comes from) 														DEFAULT: 1500
direction 	= 	"random" or 0-360 (direction where chopper comes from, use quotes with random!) 					DEFAULT: "random"
flyby	=	true/false		(true = chopper just flies thru target, false = stays still while dropping units)		DEFAULT: true
fly height	= number 		(how high chopper flies)																DEFAULT: 200
jump distance =	number 		(how many meters before target location units starts jumping out of heli)				DEFAULT: 150
group size	= number 		(how many units is in para drop group)													DEFAULT: 8
jump delay	= number 		(how many seconds is the delay between jumps)											DEFAULT: 0.5
open height = number		(in which height units opens their parachutes)											DEFAULT: 50
smokes	=	true/false		(will units throw cover smokes (on 10m height))											DEFAULT: false
flares	=	true/false		(will units throw flares (on 30m height))												DEFAULT: false	
chems	=	true/false		(will units throw chemlights (on 30m height))											DEFAULT: false
patrol 	= 	true/false 		(if false, units wont patrol in any way <- handy if you set (group player) as *group) 	DEFAULT: true
target 	= 	patrol target 	(patrolling target for infantry group, options:											DEFAULT: player
						unit 	= 	units name, ex: enemyunit1
						marker 	= 	markers' name, ex: "marker01" (remember quotes with markers!)
						marker array = array of markers in desired order, ex: ["marker01","marker02","marker03"]
						group	= 	groups name, ex: (group enemy1)	OR BlueGroup17
						group array, ex: [(group player), (group blue2)]
						["PATROL",center position,radius] = uses patrol-vD.sqf, ex: ["PATROL",(getPos player),150]										
cycle 		= 	true or false (if true and target is array of markers, unit will cycle these markers) 				DEFAULT: false
skills 		= 	"default" 	(default AI skills) 																	DEFAULT: "default"
			or	number	=	0-1.0 = this value will be set to all AI skills, ex: 0.8
			or	array	=	all AI skills invidiually in array, values 0-1.0, order:
					[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, reloadSpeed] 
					ex: 	[0.75,0.5,0.6,0.85,0.9,1,1,0.75,1] 
group 		= 	group name OR nil (if you want units in existing group, set it here. if this is left empty, new group is made) 	DEFAULT: nil
custom init = 	"init commands" (if you want something in init field of units, put it here) 									DEFAULT: nil
			NOTE: Keep it inside quotes, and if you need quotes in init commands, you MUST use ' or "" instead of ",
				ex: "hint 'this is hint';"
ID 			= 	number (if you want to delete units this script creates, you'll need ID number for them)						DEFAULT: nil
MP			= 	true/false	true = 'drop spot' will automatically be one of alive non-captive players							DEFAULT: false

EXAMPLE: 	nul = [player, 2, false, true, 1000, "random", true, 500, 200, 6, 1, 50, true, false, true, true, player, false, 0.75, nil, nil, 1,false] execVM "LV\heliParadrop.sqf";


*/
if (!isServer)exitWith{};
private ["_mp","_grp","_heliType","_men","_grp2","_center","_man1","_man2","_landingSpot","_side","_flyHeight","_openHeight","_jumpDelay","_jumperAmount","_heliDistance","_heliDirection","_flyBy","_allowDamage","_BLUmen","_OPFmen","_INDmen","_BLUchopper","_OPFchopper","_INDchopper","_landingSpotPos","_spos","_heli","_crew","_dir","_flySpot","_jumpDistanceFromTarget","_captive","_smokes","_flares","_chems","_skls","_cPosition","_cRadius","_patrol","_target","_cycle","_skills","_customInit","_grpId","_wp0","_wp1","_doorHandling"];

//Extra settings:
_doorHandling = true;
//

_landingSpot = if (count _this > 0) then {_this select 0};
_side = if (count _this > 1) then {_this select 1}else{2};
_allowDamage = if (count _this > 2) then {_this select 2}else{true};
_captive = if (count _this > 3) then {_this select 3}else{false};
_heliDistance = if (count _this > 4) then {_this select 4}else{1500};
_heliDirection = if (count _this > 5) then {_this select 5}else{"random"};
_flyBy = if (count _this > 6) then {_this select 6}else{true};
_flyHeight = if (count _this > 7) then {_this select 7}else{200};
_jumpDistanceFromTarget = if (count _this > 8) then {_this select 8}else{150};
_jumperAmount = if (count _this > 9) then {_this select 9}else{8};
_jumpDelay = if (count _this > 10) then {_this select 10}else{0.5};
_openHeight = if (count _this > 11) then {_this select 11}else{50};
_smokes = if (count _this > 12) then {_this select 12}else{false};
_flares = if (count _this > 13) then {_this select 13}else{false};
_chems = if (count _this > 14) then {_this select 14}else{false};
_patrol = if (count _this > 15) then {_this select 15; }else{true;};
_target = if (count _this > 16) then {_this select 16; }else{player;};
_cycle = if (count _this > 17) then {_this select 17; }else{false;};
_skills = if (count _this > 18) then {_this select 18; }else{"default";};
_grp2 = if (count _this > 19) then {_this select 19; }else{nil;};
_customInit = if (count _this > 20) then {_this select 20; }else{nil;};
_grpId = if (count _this > 21) then { _this select 21;} else {nil};
_mp = if (count _this > 22) then { _this select 22;} else {false};

//Prepare functions:
if(isNil("LV_ACskills"))then{LV_ACskills = compile preprocessFile "LV\LV_functions\LV_fnc_ACskills.sqf";};
if(isNil("LV_vehicleInit"))then{LV_vehicleInit = compile preprocessFile "LV\LV_functions\LV_fnc_vehicleInit.sqf";};
if(_mp)then{if(isNil("LV_GetPlayers"))then{LV_GetPlayers = compile preprocessFile "LV\LV_functions\LV_fnc_getPlayers.sqf";};};

//Classnames:
_BLUmen = ["B_Soldier_A_F","B_soldier_AR_F","B_medic_F","B_engineer_F","B_soldier_exp_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AA_F","B_soldier_AT_F","B_officer_F","B_soldier_repair_F","B_Soldier_F","B_soldier_LAT_F","B_Soldier_lite_F","B_Soldier_SL_F","B_Soldier_TL_F","B_recon_exp_F","B_recon_JTAC_F","B_recon_M_F","B_recon_medic_F","B_recon_F","B_recon_LAT_F","B_recon_TL_F","B_soldier_AAR_F","B_soldier_AAA_F","B_soldier_AAT_F"];
_OPFmen = ["O_Soldier_A_F","O_soldier_AR_F","O_medic_F","O_engineer_F","O_soldier_exp_F","O_Soldier_GL_F","O_soldier_M_F","O_soldier_AA_F","O_soldier_AT_F","O_officer_F","O_soldier_repair_F","O_Soldier_F","O_soldier_LAT_F","O_Soldier_lite_F","O_Soldier_SL_F","O_Soldier_TL_F","O_recon_exp_F","O_recon_JTAC_F","O_recon_M_F","O_recon_medic_F","O_recon_F","O_recon_LAT_F","O_recon_TL_F","O_soldier_AAR_F","O_soldier_AAA_F","O_soldier_AAT_F"];
_INDmen = ["I_Soldier_A_F","I_soldier_AR_F","I_medic_F","I_engineer_F","I_soldier_exp_F","I_Soldier_GL_F","I_soldier_M_F","I_soldier_AA_F","I_soldier_AT_F","I_officer_F","I_soldier_repair_F","I_Soldier_F","I_soldier_LAT_F","I_Soldier_lite_F","I_Soldier_SL_F","I_Soldier_TL_F","I_soldier_AAR_F","I_soldier_AAA_F","I_soldier_AAT_F"];
_BLUchopper = "B_Heli_Transport_01_F";
_OPFchopper = "O_Heli_Light_02_unarmed_F";
_INDchopper = "I_Heli_Transport_02_F";

//Side related group creation:
switch(_side)do{
case 1:{
	_center = createCenter west;
	_grp = createGroup west;
	_men = _BLUmen;
	_heliType = _BLUchopper;
};
case 2:{
	_center = createCenter east;
	_grp = createGroup east;
	_men = _OPFmen;
	_heliType = _OPFchopper;
};
case 3:{
	_center = createCenter resistance;
	_grp = createGroup resistance;
	_men = _INDmen;
	_heliType = _INDchopper;
};
};

if(_mp)then{
_landingSpot = call LV_GetPlayers;
_landingSpotPos = getPos(_landingSpot call BIS_fnc_selectRandom);
_landingSpot = _landingSpotPos;
}else{
//Check if target is marker/object/position
if(_landingSpot in allMapMarkers)then{
	_landingSpotPos = getMarkerPos _landingSpot;
}else{
	if (typeName _landingSpot == "ARRAY") then{
		_landingSpotPos = _landingSpot;
	}else{
		_landingSpotPos = getPos _landingSpot;
	};
};
};

//Spawn chopper
if(typeName _heliDirection == "STRING")then{_heliDirection = random 360;};
_spos = [(_landingSpotPos select 0) + (sin _heliDirection) * _heliDistance, (_landingSpotPos select 1) + (cos _heliDirection) * _heliDistance, _flyHeight];
_heli = createVehicle [_heliType, _spos, [], 0, "FLY"];
_heli allowDamage _allowDamage;
_crew = [_heli,_grp] call bis_fnc_spawncrew;
if(_captive)then{
_heli setCaptive true;
{ _x setCaptive true; } forEach units _grp;
};
//NOTE! This next line should make sure AI does fly where it's set to fly, BUT in recent stable release
//AI sometimes acts weirdly while CARELESS, they might skip waypoints or domoves. 
//_grp setBehaviour "CARELESS";

//Count angle between chopper and target, and end spot for chopper
_dir = ((_landingSpotPos select 0) - (_spos select 0)) atan2 ((_landingSpotPos select 1) - (_spos select 1));
_flySpot = [(_landingSpotPos select 0) + (sin _dir) * _heliDistance, (_landingSpotPos select 1) + (cos _dir) * _heliDistance, _flyHeight];

//Heli to go
if(_flyBy)then{
_wp0 = _grp addWaypoint [_landingSpotPos, 0, 1];
[_grp,0] setWaypointBehaviour "CARELESS";
[_grp,0] setWaypointCompletionRadius 60;
_wp1 = _grp addWaypoint [_flySpot, 0, 2];
[_grp,1] setWaypointBehaviour "CARELESS";
[_grp,1] setWaypointCompletionRadius 60;
}else{
_wp0 = _grp addWaypoint [_landingSpotPos, 0, 1];
[_grp,0] setWaypointBehaviour "CARELESS";
[_grp,0] setWaypointCompletionRadius 60;
};
_heli flyInHeight _flyHeight;

//Make heli & crew dissapear if something goes wrong or if heli is at its end spot
[_heli,_grp,_flySpot,_landingSpotPos,_heliDistance] spawn {
private ["_heli","_grp","_flySpot","_landingSpotPos","_heliDistance"];
_heli = _this select 0;
_grp = _this select 1;
_flySpot = _this select 2;
_landingSpotPos = _this select 3;
_heliDistance = _this select 4;
while{([_heli, _flySpot] call BIS_fnc_distance2D)>200}do{
	if(!alive _heli || !canMove _heli)exitWith{};
	sleep 5;
};
waitUntil{([_heli, _landingSpotPos] call BIS_fnc_distance2D)>(_heliDistance * .5)};
{ deleteVehicle _x; } forEach units _grp;
deleteVehicle _heli;
waituntil {sleep 1;(count units _grp)==0};
deletegroup _grp;
};

//Wait till it's close enough
waitUntil{([_heli, _landingSpotPos] call BIS_fnc_distance2D)<_jumpDistanceFromTarget};

//Side related para group creation :
switch(_side)do{
case 1:{
	if(isNil("_grp2"))then{_grp2 = createGroup west;}else{_grp2 = _grp2;};
};
case 2:{
	if(isNil("_grp2"))then{_grp2 = createGroup east;}else{_grp2 = _grp2;};
};
case 3:{
	if(isNil("_grp2"))then{_grp2 = createGroup resistance;}else{_grp2 = _grp2;};
};
};

//Create para group
for "_i" from 1 to _jumperAmount step 1 do{
_man1 = _men select (floor(random(count _men)));
_man2 = _grp2 createUnit [_man1, [(getPos _heli) select 0,(getPos _heli) select 1, ((getPos _heli) select 2) - 3], [], 0, "NONE"];
_man2 setPos [(getPos _heli) select 0,(getPos _heli) select 1, ((getPos _heli) select 2) - 3];
if(typeName _skills != "STRING")then{_skls = [_man2,_skills] call LV_ACskills;};
if(!isNil("_customInit"))then{ 
	[_man2,_customInit] spawn LV_vehicleInit;
};
[_man2,_heli,_openHeight,_smokes,_flares,_chems] spawn{
	private ["_man2","_heli","_openHeight","_para","_smokes","_flares","_chems","_smoke","_flare","_chem"];
	_man2 = _this select 0;
	_heli = _this select 1;
	_openHeight = _this select 2;
	_smokes = _this select 3;
	_flares = _this select 4;
	_chems = _this select 5;
	waitUntil{((getPos _man2)select 2)<_openHeight};
	_para = createVehicle ["NonSteerable_Parachute_F", position _man2, [], ((direction _heli)-25+(random 50)), 'NONE'];
	_para setPos (getPos _man2);
	_man2 moveInDriver _para;

	if(_smokes)then{
		waitUntil{((getPos _man2)select 2)<10};
		_smoke = "SmokeShell" createVehicle (getPos _man2);
	};
	if(_flares)then{
		waitUntil{((getPos _man2)select 2)<30};
		_flare = "F_40mm_Red" createVehicle [(getPos _man2) select 0,(getPos _man2) select 1,0]; //Chemlight_red
	};
	if(_chems)then{
		waitUntil{((getPos _man2)select 2)<30};
		_chem = "Chemlight_red" createVehicle (getPos _man2);
	};
};
_man2 allowFleeing 0;
sleep _jumpDelay;
};

if(!isNil("_grpId"))then{
call compile format ["LVgroup%1 = _grp2",_grpId];
};

//If it wasnt flyby, send heli to its end spot
if(!_flyBy)then{ 
_wp1 = _grp addWaypoint [_flySpot, 0, 2];
[_grp,1] setWaypointBehaviour "CARELESS";
[_grp,1] setWaypointCompletionRadius 60;
};

//Patrol stuff for para group (same as in reinforcementHeli, works but needs 'a bit' rework)
if(_patrol)then{
if(typeName _target == "ARRAY")then{ //TARGET is array
	if((!((_target select 0) in allMapMarkers))&&(!((_target select 0) in allGroups)))then{
		if((typeName (_target select 0)) == "STRING")then{
			if((_target select 0) == "PATROL")then{ ////USE patrol-vD.sqf
				{
					_cPosition = _target select 1;
					_cRadius = _target select 2;
					nul = [_x,_cPosition,_cRadius,_doorHandling] execVM "LV\patrol-vD.sqf";
				}forEach units _grp2;
			};
		};
	}else{ //TARGET is array of Markers or Groups
		{ 
			_x setVariable ["target0",_target,false];
			_x setVariable ["mDis0", 1000, false];
			if(_cycle)then{
				nul = [_x,true] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			}else{
				nul = [_x,false] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			};
			sleep 2;
		}forEach units _grp2;
	};
}else{
	if(_target in allMapMarkers)then{ /////TARGET is single Marker
		{ _x doMove getMarkerPos _target; } forEach units _grp2;
	}else{
			{ ////TARGET is single Unit/Object
				_x setVariable ["target0",_target,false];
				_x setVariable ["mDis0", 1000, false];
				nul = [_x] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			}forEach units _grp2;
	};
};
}else{
//If patrol is set to false, units will idle. Additionally you can set custom actions here:

};

Edited by Mariodu62
add script use in our mission

Share this post


Link to post
Share on other sites

Great! Works like a charm now :-) Thanks a lot!

Edited by CommanderX

Share this post


Link to post
Share on other sites
Yes, i have one.

I had this issue when i was using a server cleaner.

This cleaner was deleting the empty groups.

The solution was to stop deleting empty groups automaticly.

Now arma3 delete automaticly empty groups.

Try do delay the group creation to just before the guy jump.

Here is the corrected code i used in our mission to solve the issue.

Try it, it was working for me, but never tried with the new functionnality of arma.

BR

/*
			***		ARMA3Alpha HELI PARADROP v1.1 - by SPUn / lostvar	***

				Spawns chopper which delivers paradrop group to scene

	Calling the script:

		default: 		nul = [this] execVM "LV\heliParadrop.sqf";

		custom: 		nul = [spot, side, allowDamage, captive, distance, direction, flyby, fly height, jump distance,
							group size, jump delay, open height, smokes, flares, chems, patrol, target, cycle, skills,
							group, custom init, ID, MP] execVM "LV\heliParadrop.sqf";

Parameters:

spot 	= 	drop spot 		(name of marker or object or unit, or position array) 									DEFAULT: --
side 	= 	1 or 2 or 3		(1 = west, 2 = east, 3 = independent)													DEFAULT: 2
allowDamage = 	true/false	(allow or disallow damage for chopper)													DEFAULT: true
captive 	= 	true/false 	(if true, enemies wont notice chopper) 													DEFAULT: false
distance 	= 	number 		(from how far chopper comes from) 														DEFAULT: 1500
direction 	= 	"random" or 0-360 (direction where chopper comes from, use quotes with random!) 					DEFAULT: "random"
flyby	=	true/false		(true = chopper just flies thru target, false = stays still while dropping units)		DEFAULT: true
fly height	= number 		(how high chopper flies)																DEFAULT: 200
jump distance =	number 		(how many meters before target location units starts jumping out of heli)				DEFAULT: 150
group size	= number 		(how many units is in para drop group)													DEFAULT: 8
jump delay	= number 		(how many seconds is the delay between jumps)											DEFAULT: 0.5
open height = number		(in which height units opens their parachutes)											DEFAULT: 50
smokes	=	true/false		(will units throw cover smokes (on 10m height))											DEFAULT: false
flares	=	true/false		(will units throw flares (on 30m height))												DEFAULT: false	
chems	=	true/false		(will units throw chemlights (on 30m height))											DEFAULT: false
patrol 	= 	true/false 		(if false, units wont patrol in any way <- handy if you set (group player) as *group) 	DEFAULT: true
target 	= 	patrol target 	(patrolling target for infantry group, options:											DEFAULT: player
						unit 	= 	units name, ex: enemyunit1
						marker 	= 	markers' name, ex: "marker01" (remember quotes with markers!)
						marker array = array of markers in desired order, ex: ["marker01","marker02","marker03"]
						group	= 	groups name, ex: (group enemy1)	OR BlueGroup17
						group array, ex: [(group player), (group blue2)]
						["PATROL",center position,radius] = uses patrol-vD.sqf, ex: ["PATROL",(getPos player),150]										
cycle 		= 	true or false (if true and target is array of markers, unit will cycle these markers) 				DEFAULT: false
skills 		= 	"default" 	(default AI skills) 																	DEFAULT: "default"
			or	number	=	0-1.0 = this value will be set to all AI skills, ex: 0.8
			or	array	=	all AI skills invidiually in array, values 0-1.0, order:
					[aimingAccuracy, aimingShake, aimingSpeed, spotDistance, spotTime, courage, commanding, general, reloadSpeed] 
					ex: 	[0.75,0.5,0.6,0.85,0.9,1,1,0.75,1] 
group 		= 	group name OR nil (if you want units in existing group, set it here. if this is left empty, new group is made) 	DEFAULT: nil
custom init = 	"init commands" (if you want something in init field of units, put it here) 									DEFAULT: nil
			NOTE: Keep it inside quotes, and if you need quotes in init commands, you MUST use ' or "" instead of ",
				ex: "hint 'this is hint';"
ID 			= 	number (if you want to delete units this script creates, you'll need ID number for them)						DEFAULT: nil
MP			= 	true/false	true = 'drop spot' will automatically be one of alive non-captive players							DEFAULT: false

EXAMPLE: 	nul = [player, 2, false, true, 1000, "random", true, 500, 200, 6, 1, 50, true, false, true, true, player, false, 0.75, nil, nil, 1,false] execVM "LV\heliParadrop.sqf";


*/
if (!isServer)exitWith{};
private ["_mp","_grp","_heliType","_men","_grp2","_center","_man1","_man2","_landingSpot","_side","_flyHeight","_openHeight","_jumpDelay","_jumperAmount","_heliDistance","_heliDirection","_flyBy","_allowDamage","_BLUmen","_OPFmen","_INDmen","_BLUchopper","_OPFchopper","_INDchopper","_landingSpotPos","_spos","_heli","_crew","_dir","_flySpot","_jumpDistanceFromTarget","_captive","_smokes","_flares","_chems","_skls","_cPosition","_cRadius","_patrol","_target","_cycle","_skills","_customInit","_grpId","_wp0","_wp1","_doorHandling"];

//Extra settings:
_doorHandling = true;
//

_landingSpot = if (count _this > 0) then {_this select 0};
_side = if (count _this > 1) then {_this select 1}else{2};
_allowDamage = if (count _this > 2) then {_this select 2}else{true};
_captive = if (count _this > 3) then {_this select 3}else{false};
_heliDistance = if (count _this > 4) then {_this select 4}else{1500};
_heliDirection = if (count _this > 5) then {_this select 5}else{"random"};
_flyBy = if (count _this > 6) then {_this select 6}else{true};
_flyHeight = if (count _this > 7) then {_this select 7}else{200};
_jumpDistanceFromTarget = if (count _this > 8) then {_this select 8}else{150};
_jumperAmount = if (count _this > 9) then {_this select 9}else{8};
_jumpDelay = if (count _this > 10) then {_this select 10}else{0.5};
_openHeight = if (count _this > 11) then {_this select 11}else{50};
_smokes = if (count _this > 12) then {_this select 12}else{false};
_flares = if (count _this > 13) then {_this select 13}else{false};
_chems = if (count _this > 14) then {_this select 14}else{false};
_patrol = if (count _this > 15) then {_this select 15; }else{true;};
_target = if (count _this > 16) then {_this select 16; }else{player;};
_cycle = if (count _this > 17) then {_this select 17; }else{false;};
_skills = if (count _this > 18) then {_this select 18; }else{"default";};
_grp2 = if (count _this > 19) then {_this select 19; }else{nil;};
_customInit = if (count _this > 20) then {_this select 20; }else{nil;};
_grpId = if (count _this > 21) then { _this select 21;} else {nil};
_mp = if (count _this > 22) then { _this select 22;} else {false};

//Prepare functions:
if(isNil("LV_ACskills"))then{LV_ACskills = compile preprocessFile "LV\LV_functions\LV_fnc_ACskills.sqf";};
if(isNil("LV_vehicleInit"))then{LV_vehicleInit = compile preprocessFile "LV\LV_functions\LV_fnc_vehicleInit.sqf";};
if(_mp)then{if(isNil("LV_GetPlayers"))then{LV_GetPlayers = compile preprocessFile "LV\LV_functions\LV_fnc_getPlayers.sqf";};};

//Classnames:
_BLUmen = ["B_Soldier_A_F","B_soldier_AR_F","B_medic_F","B_engineer_F","B_soldier_exp_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AA_F","B_soldier_AT_F","B_officer_F","B_soldier_repair_F","B_Soldier_F","B_soldier_LAT_F","B_Soldier_lite_F","B_Soldier_SL_F","B_Soldier_TL_F","B_recon_exp_F","B_recon_JTAC_F","B_recon_M_F","B_recon_medic_F","B_recon_F","B_recon_LAT_F","B_recon_TL_F","B_soldier_AAR_F","B_soldier_AAA_F","B_soldier_AAT_F"];
_OPFmen = ["O_Soldier_A_F","O_soldier_AR_F","O_medic_F","O_engineer_F","O_soldier_exp_F","O_Soldier_GL_F","O_soldier_M_F","O_soldier_AA_F","O_soldier_AT_F","O_officer_F","O_soldier_repair_F","O_Soldier_F","O_soldier_LAT_F","O_Soldier_lite_F","O_Soldier_SL_F","O_Soldier_TL_F","O_recon_exp_F","O_recon_JTAC_F","O_recon_M_F","O_recon_medic_F","O_recon_F","O_recon_LAT_F","O_recon_TL_F","O_soldier_AAR_F","O_soldier_AAA_F","O_soldier_AAT_F"];
_INDmen = ["I_Soldier_A_F","I_soldier_AR_F","I_medic_F","I_engineer_F","I_soldier_exp_F","I_Soldier_GL_F","I_soldier_M_F","I_soldier_AA_F","I_soldier_AT_F","I_officer_F","I_soldier_repair_F","I_Soldier_F","I_soldier_LAT_F","I_Soldier_lite_F","I_Soldier_SL_F","I_Soldier_TL_F","I_soldier_AAR_F","I_soldier_AAA_F","I_soldier_AAT_F"];
_BLUchopper = "B_Heli_Transport_01_F";
_OPFchopper = "O_Heli_Light_02_unarmed_F";
_INDchopper = "I_Heli_Transport_02_F";

//Side related group creation:
switch(_side)do{
case 1:{
	_center = createCenter west;
	_grp = createGroup west;
	_men = _BLUmen;
	_heliType = _BLUchopper;
};
case 2:{
	_center = createCenter east;
	_grp = createGroup east;
	_men = _OPFmen;
	_heliType = _OPFchopper;
};
case 3:{
	_center = createCenter resistance;
	_grp = createGroup resistance;
	_men = _INDmen;
	_heliType = _INDchopper;
};
};

if(_mp)then{
_landingSpot = call LV_GetPlayers;
_landingSpotPos = getPos(_landingSpot call BIS_fnc_selectRandom);
_landingSpot = _landingSpotPos;
}else{
//Check if target is marker/object/position
if(_landingSpot in allMapMarkers)then{
	_landingSpotPos = getMarkerPos _landingSpot;
}else{
	if (typeName _landingSpot == "ARRAY") then{
		_landingSpotPos = _landingSpot;
	}else{
		_landingSpotPos = getPos _landingSpot;
	};
};
};

//Spawn chopper
if(typeName _heliDirection == "STRING")then{_heliDirection = random 360;};
_spos = [(_landingSpotPos select 0) + (sin _heliDirection) * _heliDistance, (_landingSpotPos select 1) + (cos _heliDirection) * _heliDistance, _flyHeight];
_heli = createVehicle [_heliType, _spos, [], 0, "FLY"];
_heli allowDamage _allowDamage;
_crew = [_heli,_grp] call bis_fnc_spawncrew;
if(_captive)then{
_heli setCaptive true;
{ _x setCaptive true; } forEach units _grp;
};
//NOTE! This next line should make sure AI does fly where it's set to fly, BUT in recent stable release
//AI sometimes acts weirdly while CARELESS, they might skip waypoints or domoves. 
//_grp setBehaviour "CARELESS";

//Count angle between chopper and target, and end spot for chopper
_dir = ((_landingSpotPos select 0) - (_spos select 0)) atan2 ((_landingSpotPos select 1) - (_spos select 1));
_flySpot = [(_landingSpotPos select 0) + (sin _dir) * _heliDistance, (_landingSpotPos select 1) + (cos _dir) * _heliDistance, _flyHeight];

//Heli to go
if(_flyBy)then{
_wp0 = _grp addWaypoint [_landingSpotPos, 0, 1];
[_grp,0] setWaypointBehaviour "CARELESS";
[_grp,0] setWaypointCompletionRadius 60;
_wp1 = _grp addWaypoint [_flySpot, 0, 2];
[_grp,1] setWaypointBehaviour "CARELESS";
[_grp,1] setWaypointCompletionRadius 60;
}else{
_wp0 = _grp addWaypoint [_landingSpotPos, 0, 1];
[_grp,0] setWaypointBehaviour "CARELESS";
[_grp,0] setWaypointCompletionRadius 60;
};
_heli flyInHeight _flyHeight;

//Make heli & crew dissapear if something goes wrong or if heli is at its end spot
[_heli,_grp,_flySpot,_landingSpotPos,_heliDistance] spawn {
private ["_heli","_grp","_flySpot","_landingSpotPos","_heliDistance"];
_heli = _this select 0;
_grp = _this select 1;
_flySpot = _this select 2;
_landingSpotPos = _this select 3;
_heliDistance = _this select 4;
while{([_heli, _flySpot] call BIS_fnc_distance2D)>200}do{
	if(!alive _heli || !canMove _heli)exitWith{};
	sleep 5;
};
waitUntil{([_heli, _landingSpotPos] call BIS_fnc_distance2D)>(_heliDistance * .5)};
{ deleteVehicle _x; } forEach units _grp;
deleteVehicle _heli;
waituntil {sleep 1;(count units _grp)==0};
deletegroup _grp;
};

//Wait till it's close enough
waitUntil{([_heli, _landingSpotPos] call BIS_fnc_distance2D)<_jumpDistanceFromTarget};

//Side related para group creation :
switch(_side)do{
case 1:{
	if(isNil("_grp2"))then{_grp2 = createGroup west;}else{_grp2 = _grp2;};
};
case 2:{
	if(isNil("_grp2"))then{_grp2 = createGroup east;}else{_grp2 = _grp2;};
};
case 3:{
	if(isNil("_grp2"))then{_grp2 = createGroup resistance;}else{_grp2 = _grp2;};
};
};

//Create para group
for "_i" from 1 to _jumperAmount step 1 do{
_man1 = _men select (floor(random(count _men)));
_man2 = _grp2 createUnit [_man1, [(getPos _heli) select 0,(getPos _heli) select 1, ((getPos _heli) select 2) - 3], [], 0, "NONE"];
_man2 setPos [(getPos _heli) select 0,(getPos _heli) select 1, ((getPos _heli) select 2) - 3];
if(typeName _skills != "STRING")then{_skls = [_man2,_skills] call LV_ACskills;};
if(!isNil("_customInit"))then{ 
	[_man2,_customInit] spawn LV_vehicleInit;
};
[_man2,_heli,_openHeight,_smokes,_flares,_chems] spawn{
	private ["_man2","_heli","_openHeight","_para","_smokes","_flares","_chems","_smoke","_flare","_chem"];
	_man2 = _this select 0;
	_heli = _this select 1;
	_openHeight = _this select 2;
	_smokes = _this select 3;
	_flares = _this select 4;
	_chems = _this select 5;
	waitUntil{((getPos _man2)select 2)<_openHeight};
	_para = createVehicle ["NonSteerable_Parachute_F", position _man2, [], ((direction _heli)-25+(random 50)), 'NONE'];
	_para setPos (getPos _man2);
	_man2 moveInDriver _para;

	if(_smokes)then{
		waitUntil{((getPos _man2)select 2)<10};
		_smoke = "SmokeShell" createVehicle (getPos _man2);
	};
	if(_flares)then{
		waitUntil{((getPos _man2)select 2)<30};
		_flare = "F_40mm_Red" createVehicle [(getPos _man2) select 0,(getPos _man2) select 1,0]; //Chemlight_red
	};
	if(_chems)then{
		waitUntil{((getPos _man2)select 2)<30};
		_chem = "Chemlight_red" createVehicle (getPos _man2);
	};
};
_man2 allowFleeing 0;
sleep _jumpDelay;
};

if(!isNil("_grpId"))then{
call compile format ["LVgroup%1 = _grp2",_grpId];
};

//If it wasnt flyby, send heli to its end spot
if(!_flyBy)then{ 
_wp1 = _grp addWaypoint [_flySpot, 0, 2];
[_grp,1] setWaypointBehaviour "CARELESS";
[_grp,1] setWaypointCompletionRadius 60;
};

//Patrol stuff for para group (same as in reinforcementHeli, works but needs 'a bit' rework)
if(_patrol)then{
if(typeName _target == "ARRAY")then{ //TARGET is array
	if((!((_target select 0) in allMapMarkers))&&(!((_target select 0) in allGroups)))then{
		if((typeName (_target select 0)) == "STRING")then{
			if((_target select 0) == "PATROL")then{ ////USE patrol-vD.sqf
				{
					_cPosition = _target select 1;
					_cRadius = _target select 2;
					nul = [_x,_cPosition,_cRadius,_doorHandling] execVM "LV\patrol-vD.sqf";
				}forEach units _grp2;
			};
		};
	}else{ //TARGET is array of Markers or Groups
		{ 
			_x setVariable ["target0",_target,false];
			_x setVariable ["mDis0", 1000, false];
			if(_cycle)then{
				nul = [_x,true] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			}else{
				nul = [_x,false] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			};
			sleep 2;
		}forEach units _grp2;
	};
}else{
	if(_target in allMapMarkers)then{ /////TARGET is single Marker
		{ _x doMove getMarkerPos _target; } forEach units _grp2;
	}else{
			{ ////TARGET is single Unit/Object
				_x setVariable ["target0",_target,false];
				_x setVariable ["mDis0", 1000, false];
				nul = [_x] execVM "LV\LV_functions\LV_fnc_follow.sqf";
			}forEach units _grp2;
	};
};
}else{
//If patrol is set to false, units will idle. Additionally you can set custom actions here:

};

Ty! i was looking for a fix like this, it works now!

Share this post


Link to post
Share on other sites

I am wondering if any one is having problems with the Unarmed Little Bird for reinforcementChopper. I see the little bird land, but it lands 2 infantry instead of 6. I do see lines for moveinturret in the script, but could the heli DLC be causing a problem since the bench seats are different now?

Share this post


Link to post
Share on other sites

Guys what if i want to use another script on the "custom init" ?? i have a SQF with a loadout presset for the enemy side, but dont know how to call it in that custom init field.

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

×