Jump to content
Sign in to follow this  
infiltrator_2k

Dynamic AI Helicopter/Jet Spawn Script?

Recommended Posts

I've got various vehicle and air spawn scripts, although I'm looking for one that works similar to I&A where AI air assets will keep spawning until an object is destroyed - in I&A's case the radio towers.

I'm currently working on a CQC mission but I'd also like to have helicopters and jets to add a little more of a challenge and dimension to the mission, but I'd ideally like an array of air assets to spawn at any one time and perhaps at different times oppose to set intervals where players know what's coming and at what time albeit until a trigger's activated to stop the air assets spawning.

Does anyone have any scripts that can achieve this?

Cheers

Infil

Share this post


Link to post
Share on other sites
Thank you Gunter, I'll have a good look ;)

Feel free to pull the one out of I&A, it should be reasonably modular with some tweaking.

What spawn conditions did you require, and what sort of air assets were you intending for it to spawn?

Share this post


Link to post
Share on other sites
Feel free to pull the one out of I&A, it should be reasonably modular with some tweaking.

What spawn conditions did you require, and what sort of air assets were you intending for it to spawn?

I&A is an awesome mission and I've hosted and played many hours of it. The air assets and trigger conditions it has would be absolutely perfect for what I need, but the structure of I&A is pretty complex for a noob like me to decipher and I wouldn't know where to start pulling it :(

Share this post


Link to post
Share on other sites

Not tested.

Hostile_Air.sqf :

// Created by: Haz

if (!isServer) exitWith {};

_Start = [_this, 0, objNull] call BIS_fnc_param;
_Side = [_this, 1, objNull] call BIS_fnc_param;
_Types = [_this, 2, objNull] call BIS_fnc_param;
_Amount = [_this, 3, objNull] call BIS_fnc_param;
_Delay = [_this, 4, objNull] call BIS_fnc_param;

_Position = "";

if (_Start in allMapMarkers) then {
_Position = getMarkerPos _Start;
} else {
if (typeName _Position == "ARRAY") then {
_Position = _Start;
} else {
_Position = getPos _Start;
};
};

_Center = createCenter _Side;
_Group = createGroup _Side;

for "_i" from 0 to _Amount do {
_Type = _Types call BIS_fnc_selectRandom;
_Air = createVehicle [_Type, _Position, [], 0, "FLY"];
_Crew = [_Air, _Group] call BIS_fnc_spawnCrew;
sleep 1;
};

_Sleep = (_Delay select 0) + random (_Delay select 1);

sleep _Sleep;

nul = [_Start, _Side, _Types, _Amount, _Delay] execVM "Hostile_Air.sqf";

nul = ["Marker", opfor, ["O_Heli_Light_02_F", "O_Heli_Attack_02_F", "O_Plane_CAS_02_F"], 2, [600, 1200]] execVM "Hostile_Air.sqf";

Dirty Haz

Edited by Dirty Haz

Share this post


Link to post
Share on other sites
Not tested.

Hostile_Air.sqf :

// Created by: Haz

if (!isServer) exitWith {};

_Start = [_this, 0, objNull] call BIS_fnc_param;
_Side = [_this, 1, objNull] call BIS_fnc_param;
_Types = [_this, 2, objNull] call BIS_fnc_param;
_Amount = [_this, 3, objNull] call BIS_fnc_param;
_Delay = [_this, 4, objNull] call BIS_fnc_param;

_Position = "";

if (_Start in allMapMarkers) then {
_Position = getMarkerPos _Start;
} else {
if (typeName _Position == "ARRAY") then {
_Position = _Start;
} else {
_Position = getPos _Start;
};
};

_Center = createCenter _Side;
_Group = createGroup _Side;

for "_i" from 0 to _Amount do {
_Type = _Types call BIS_fnc_selectRandom;
_Air = createVehicle [_Type, _Position, [], 0, "FLY"];
_Crew = [_Air, _Group] call BIS_fnc_spawnCrew;
sleep 1;
};

_Sleep = (_Delay select 0) + random (_Delay select 1);

sleep _Sleep;

nul = [_Start, _Side, _Types, _Amount, _Delay] execVM "Hostile_Air.sqf";

nul = ["Marker", opfor, ["O_Heli_Light_02_F", "O_Heli_Attack_02_F", "O_Plane_CAS_02_F"], 2, [600, 1200]] execVM "Hostile_Air.sqf";

Dirty Haz

Thank you Dirty Haz I'll give it go.

Share this post


Link to post
Share on other sites

There's an ambient jet/helicopter spawning script (TPW AIR) in TPW MODS which you also might be able to adopt to your needs.

Share this post


Link to post
Share on other sites
There's an ambient jet/helicopter spawning script (TPW AIR) in TPW MODS which you also might be able to adopt to your needs.

Sweet :)

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  

×