Jump to content
Sign in to follow this  
Grumpy Old Man

[Release] GOM_AD - Aerial Denial script

Recommended Posts

Aerial Denial Script

by Grumpy Old Man

2dadniq.jpg

Tired of nasty pilots unloading troops right in the middle of an AO?

Got a score to settle with that filthy Kajman?

Want to show off in the next duck hunting season?

This script will put an end to all of your issues, force pilots to carry a second pair of pants and spawn static weapons armed with 35mm autocannons on predefined marker locations.



http://vimeo.com/98261014

It's pretty easy to use and should work fine in multiplayer.

Copy this into a file and name it GOM_fnc_AD.sqf:

//No-Fly-Zone script by Grumpy Old Man
//description: spawns static units armed with a 20mm gatling on predefined markers
//note: be very careful when placing the markers since the engagement range can be really high
//usage : place markers and name them, i.e.: noflyzone1, noflyzone2 etc
//use this line in the missions init field or wherever you want to call this script:
//
//[["noflyzone1","noflyzone1","noflyzone3","noflyzone4"],3,50,west] execVM "GOM_fnc_AD.sqf";
//
//param1 = array of markers where AA units should be placed
//param2 = amount of AA units to place on each(!) marker (don't go nuts with this, even 5 units per marker will annihilate any aircrafts)
//param3 = areasize used for unit placement in metres (should be 50 or higher for effectiveness)
//param4 = side of the AA units (west,east,resistance)
//
//optional:
//"missiles" command will add missiles to the weapon
if (isServer) then {
_locationarray = _this select 0;
_amount = _this select 1;
_area = _this select 2;
_side = _this select 3;
GOM_list_ADunits = [];
{

_spawnlocation = getmarkerpos _x;
_grp = creategroup _side;

for "_i" from 1 to _amount do {

	_rndx = (random _area) - (_area / 2);
	_rndy = (random _area) - (_area / 2);

	_static = "";
	_tracer = 0;
	if (_side == west) then {_static = "B_HMG_01_high_F";_tracer = 2;};
	if (_side == east) then {_static = "O_HMG_01_high_F";_tracer = 1;};
	if (_side == resistance) then {_static = "I_HMG_01_high_F";_tracer = 3;};

	_randompos = [(_spawnlocation select 0) + _rndx, (_spawnlocation select 1) + _rndy,0];
	_spawnpos = _randompos findEmptyPosition [5,35,_static];

	while {count _spawnpos < 1} do {

		_spawnpos = _randompos findEmptyPosition [5,35,_static];

	};

_spawnedstatic = [_spawnpos,random 360,_static,_grp] call BIS_fnc_spawnVehicle;
_spawnedweapon = _spawnedstatic select 0;

GOM_list_ADunits set [count GOM_list_ADunits,_spawnedweapon];

_spawnedweapon setvehicleammo 0; [_spawnedweapon,"autocannon_35mm",8,_tracer] call BIS_fnc_addWeapon;

if ("MISSILES" in _this AND _i <= 1) then {
	[_spawnedweapon,"missiles_Zephyr",8] call BIS_fnc_addWeapon;
};


};
} foreach _locationarray;
};

Usage:

place markers and name them, i.e.: noflyzone1, noflyzone2 etc.

Call this file from where you seem fit with a line like this:

nul = [["noflyzone1","noflyzone1","noflyzone3","noflyzone4"],3,50,west] execVM "GOM_fnc_AD.sqf";

param1 = array of markers where AA units should be placed

param2 = amount of AA units to place on each(!) marker (don't go nuts with this, even 5 units per marker will annihilate any aircrafts)

param3 = occupied area (should be 50 or higher for effectiveness)

param4 = side of the AA units (west,east,resistance)

If you need to delete all AA units simply use:

{deletevehicle _x} foreach GOM_list_ADunits;

note: be careful when placing the markers since the engagement range can be really high

1z6fw4o.jpg

Feel free to use!

Enjoy!

Edit: Added all units to an array for easier deletion.

Edited by Grumpy Old Man
Updated script
  • Thanks 1

Share this post


Link to post
Share on other sites

Added: Short demo Video

Added: "MISSILES" parameter - adds one AA missile launcher to each Aerial Denial Zone

Changed: switched the 20mm gatling into a 35mm autocannon with side specific tracers

Share this post


Link to post
Share on other sites

This looks really neat! Thanks for making this :D

I've been looking for ways of making a mission where infantry needs to clear out pre-defined AA-sites before making CAS available/usable. I've done this story mode only so far (empty Tigrises for the inf to blow up, but there's actually nothing that stops CAS from roaming free and destroy pretty much anything :/) since having a bunch of active AA-units (Tigris in this case) that actually will make life hard for CAS also will annihilate several infantry squads in a flash.

This script looks like it will make my end goal of having a few empty Tigrises for inf. to blow up, along with defending technicals and infantry but still deny fixed wing CAS from entering the AO.

Is there any way to disable the script via trigger or can I just remove the noflyzone* markers with the trigger? Will that perhaps break anything?

Two Qs tho:

The Occupied Area parameter, is that how many enemy units that need to be within the marker to define it as hostile so AA counter measures spawn?

Just to make clear since I can be a bit of a dummy; If I want to use the missiles option, will the init look something like this?

[["noflyzone1","noflyzone2"],3,50,east,MISSILES] execVM "GOM_fnc_AD.sqf";

Share this post


Link to post
Share on other sites

LOL!

Nothing better than Schubert to give ambience to some pretty / nasty AA..

Maria Callas, isn't it?

Share this post


Link to post
Share on other sites

Hey bamse,

added all AA units to an array called GOM_list_ADunits, if you need to delete them simply use:

{deletevehicle _x} foreach GOM_list_ADunits;

If you want to spawn them again simply call the script again.

:coop:

To your first question:

AA units will spawn as soon as you use the execVM command.

The occupied area parameter (param3) just indicates the size of the area used to place those AA units.

Additional parameters are best entered as a string at the end of the arguments: "MISSILES" so it looks like this:

[["noflyzone1","noflyzone2"],3,50,east,"MISSILES"] execVM "GOM_fnc_AD.sqf";

@barbolani

no idea, unfortunately. I'm only sure that it isn't Maria Callas, heh. I have a few versions of this particular piece and the singer is missing on this one, it's from the Hitman Absolution soundtrack if that's of any help.:p

Cheers

Edited by Grumpy Old Man

Share this post


Link to post
Share on other sites

Grumpy: sweet! will try as soon as I get some spare time on my hands. thanks a bunch!

Share this post


Link to post
Share on other sites

This looks like fun thanks for releasing it

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  

×