Jump to content
Sign in to follow this  
Vince_

Make AI AA Tanks not attack infantry???

Recommended Posts

Is there a way to make enemy AI AA tanks not attack infantry units on the ground and strictly only attack aerial vehicles?

Share this post


Link to post
Share on other sites

It is easy with making a mod, changing the config of a vehicle, with script would be a bit more complicated. Anyway, that makes no sense, as AA gun is damn good against infantry.

Share this post


Link to post
Share on other sites

I want to make it so enemy AI AA tanks do not attack us infantry units on the ground

Share this post


Link to post
Share on other sites

Never tried it, but this might do the job:

// put it in .sqf file and execute from unit init: 
// 0=[_this] execVM "yoursqf.sqf";

params ["_aa"];

while {alive _aa} do {
	sleep 0.5;
	if ((assignedTarget _aa) isKindOf "Man") then {
		_aa doWatch objNull;
	};
};

It also shouldn't affect normal targeting as air units have a higher priority.

Share this post


Link to post
Share on other sites

There's no effective way to apply filtering of enemy targets by type for a selected entity (be it infantry, vehicle or air veh).

I wouldn't say that.

Sure its not perfect and it would be nicer to have something like a "handleTarget" eventhandler, but still...

 

 

 

Also, if the above doesn't work you can also use something like this (which basically give you full control, by assigning targets manually):

// put it in .sqf file and execute from unit init: 
// 0=[_this] execVM "yoursqf.sqf";

params ["_aa"];

_aa disableAI "AUTOTARGET";
while {alive _aa} do {
	sleep 2;
	{
		_last = 0;
		_x params [_pos,_type,_side,_cost,_obj,_acc];
		if ((_aa countEnemy [_obj]) isEqualTo 1) then {
			if (_type isKindOf "Air") then {
				if (_cost > _last) then {
					_aa doTarget _obj;
				};
			};
		};
	} count nearTargets 2000;
};

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  

×