Vince_ 6 Posted October 16, 2016 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
ussrlongbow 116 Posted October 16, 2016 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
Vince_ 6 Posted October 16, 2016 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
Tajin 349 Posted October 17, 2016 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
inlesco 234 Posted October 17, 2016 There's no effective way to apply filtering of enemy targets by type for a selected entity (be it infantry, vehicle or air veh). Try asking in this thread: https://forums.bistudio.com/topic/150499-ai-discussion-dev-branch/? A BI dev may respond to you and offer a solution. Share this post Link to post Share on other sites
Tajin 349 Posted October 17, 2016 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