Jump to content
Sign in to follow this  
eazye

Enemy AI choppers won't engage.

Recommended Posts

Seems like there should be a simple explanation to this that I am missing. I looked through the old post and tried the listed suggestions but still isn't working for me. Basically when I set a simple response trigger for the enemy to respond in a chopper the chopper never engages my guys. I purposely place the group in the open to get mowed down but the chopper continues to ignore us. Combat, engage at will, search & destroy, hold, nothing seems to work and the heli will just keep flying by. Sometimes the heli ignores the waypoints and just hovers there not doing anything. What am I doing wrong?

Share this post


Link to post
Share on other sites

Thanks for the reply but how do you apply those commands to target the entire blufor side?

Share this post


Link to post
Share on other sites
Thanks for the reply but how do you apply those commands to target the entire blufor side?

Depending on the situation (location of chopper and location of units that should be engaged) there are a few solutions.

Let's assume you got a blufor blackfoot chopper named "chopper" and an opfor infantry squad with the group leader named SL1.

If the chopper is already in the air and within engagement range of an infantry group you could use this:

{chopper reveal [_x,4]} foreach units group SL1

No further commands needed, the blackfoot will immediately engage the squad until the last member is dead.

  • Like 1

Share this post


Link to post
Share on other sites
Thanks for the reply but how do you apply those commands to target the entire blufor side?

I don't actually recommend doing this, but the following line will turn your AI chopper into an omniscient god of destruction:

{if (side _x == west) then {yourChopper reveal [_x,4]}} forEach allUnits;

Share this post


Link to post
Share on other sites

Hmm, tried both solutions multiple times, neither seem to be working. The chopper seems to line up like its going to engage but still doesn't fire. If it matters the chopper is grounded in another area until the trugger fires. I place units inside with the moveincargo, moveingunner etc and tried the codes on the chopper, trigger and each individual.

Share this post


Link to post
Share on other sites

This should deal the death you seek.

In the the chopper init field paste:

null = [this] execVM "aircraft_masochism.sqf"

Make a script called aircraft_masochism.sqf in the root folder and paste this in:

	//aircraft_masochism.sqf
private ["_vcl", "_vicPosArr", "_targets", "_wPArray", "_i", "_wp1", "_grpMemberPos", "_sel", "_rnd_sel", "_attackPos", "_victim"];

_vcl = _this select 0;

waitUntil {time >3};

while {alive _vcl} do
{
	_vicPosArr = [];
	_targets = [];
	_vcl setvehicleammo 1;
	_vcl setfuel 1;	

	_wPArray = waypoints (group _vcl);
	for "_i" from 0 to (count _wPArray -1) do {
		deleteWaypoint [(group _vcl), _i]
	};

	_wp1 = (group _vcl) addWaypoint [(getPos _vcl), 0];
	_wp1 setWaypointType "MOVE";

	{
		if ((alive _x) && (captiveNum _x == 0)) then {				
			_grpMemberPos = getPos _x;

			if (format ["%1", _grpMemberPos] != "[0,0,0]") then	{
				_vicPosArr pushBack _grpMemberPos;
				_targets pushBack _x;
			};
		};
	} forEach units yourGroupName;// change yourGroupName to your actual group name.

	if (count _vicPosArr !=0) then {
		_sel = (count _vicPosArr) -1;
		_rnd_sel = floor random _sel;			
		_attackPos = _vicPosArr select _rnd_sel;
		_victim = _targets select _rnd_sel;

		_wp1 setWaypointPosition [_attackPos, floor(random 50)];
		(group _vcl) setCurrentWaypoint _wp1;

		{
			_x reveal _victim;
			_x doTarget _victim;
			_x doFire _victim;
		} forEach (units group _vcl);	
	};

	//if ((!alive _victim) || (captiveNum _x == 1)) exitWith {};// remove comment for non continous loop
	sleep (random 120);
};

Share this post


Link to post
Share on other sites

Well if the chopper is grounded you need 2 additional lines of code:

engage = [] spawn {
chopper move getposatl leader group SL1;
waituntil {chopper distance getposatl leader group SL1 < 500};
{chopper reveal [_x,4]} foreach units group SL1;
};

Just tested it with both gunship (blackfoot/kajman) choppers, works even at night and full overcast.

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  

×