Jump to content

Recommended Posts

  Hi Guys,

my second project and this time for AI aircrafts.


                          Helicopter Patrol



                          Fixed Wing Patrol





  • Developed for AI Aircraft (helicopters and fixed wings)
  • Aircraft patrols between markers and adjusts the height based on setup
  • Possiblity to limit speed
  • In case enemy is noticed during patrol, aircraft engages
  • Intel share from ground units in search distance. Which means if there is ongoing battle air unit will be aware of enemy positions if they are in search distance (adjustable)
  • Adjustable communication delay for intel share
  • Restarting the patrol after aircraft finds no more enemy after an engagement
  • Possibility to have multiple aircraft patrols in a scenario
  • Script can be called from triggers or init.sqf
  • Detecting all enemies inside kill zone. From now on aircrafts will not ignore infantry which do not fire on them. Advanced optics will detect all inside kill zone (adjustable)
  • Return to base (RTB) if fuel is low (20% considered as bingo fuel)
  • RTB based on damage situation (less tolerance to damage during normal flight compared to being in combat)
  • RTB based on ammo. The decision is made based on cannon ammo count.
  • RTB if gunner dies.
  • Refuel, repair and reload ammo at base
  • Target priority rules. Enemy aircrafts are highest value targets. After that comes tanks, armored vehicles, static weapons and infantry. Dense enemy formations have value multiplier which means 10 infantry in close formation is more valuable target than a single Humwee
  • Laser guidence is used if aircraft has any missiles/bombs which can benefit from laser lock.


Future Plans


  • Possibility to have multiple bases


Known Issue(s)


  • I didn't code anything to improve the aiming of AI pilots. So still vanilla skils and attack methods are in play which means helicopters are also doing fly by to attack and they cannot hit that accurate.





Sample Mission





  • Details are in readMe.txt inside the zip. Examples about how to add custom code or adjust patrol behaviour are inside AirPatrolEnd.sqf. Sample mission can be found above.


Version History



  • Fixed: Independent aircrafts were not using laser guidence.
  • Fixed: Logic Objects on map can cause aircraft to stuck in combat mode over an area as such objects might be categorized as enemy.
  • Added: After attack while waiting the restart countdown, aircrafts will do loiter over the area.
  • Tweaked: Some code optimizations.



  • Fixed: Workaround applied due to bug in BIS_fnc_EnemyTargets function which does not consider static weapons as enemy
  • Added: Fixed wing support
  • Added: RTB based on ammunition
  • Added: RTB if gunner is dead
  • Added: Aircraft uses laser for guided bombs
  • Added: Target priority rules



  • Fixed: Possiblity that aircraft stucks at a marker and starts turning around it
  • Added: RTB based on damage
  • Tweaked: Adjustable ServiceTime option removed from script call. Service time is now depending on how much fuel is missing or how much damage is taken
  • Tweaked: AltitudeArray removed from script call. Multi-dimensional array will be used to hold markers and altitude together



  • Initial version



  • Like 16

Share this post

Link to post
Share on other sites

A medium release which contains a bug fix and new functionality is just released :)


Share this post

Link to post
Share on other sites

Sounds nice!

Do you think about to share a sample mission with us? ;)

Share this post

Link to post
Share on other sites

I am working on the extension of script for jets at the moment :(

Maybe after that I can prepare a sample scenario or a video

Share this post

Link to post
Share on other sites

Yes it does work. I am creating missions for my team as well and I have a dedicated server. So whatever I develop is based on the ideas for my own missions initally but then they grow with extra functionalities during development cycle :) 
As this is purely AI related work, it will work in mp at dedi without any issue because AI (also vehicles of AI) will be local to server


Share this post

Link to post
Share on other sites

Hi All,

a major release ready. It fixes following point as well


Thanks to Grumpy Old Man, I applied his workaround until BI fixes their function.


Main changes are related to fix wing, laser guidence and RTB based on ammo.


p.s. Foxhound can you rename the script at armaholic? It is from now on "Devas Aircraft Patrol" with fix wing adjustment :)

  • Like 2

Share this post

Link to post
Share on other sites

Thanks Foxhound :)
I forgot to put info regarding
Added: Target priority rules


can you please update armaholic ? :(

Share this post

Link to post
Share on other sites



i'am doing my first steps in Mission Building and using scripts.

I have build an Airpatrol with one Y-32 and 3 waypoints.

So far everything is good, but after the last waypoint it just flys straight.

i want it to repeat the patrol and adjusted the AirPatrolEnd, but nothing is happening.



// AirPatrolEnd.sqf
// © v.2 DECEMBER 2016 - Devastator_cm

private _Vehicle = _this select 0;
private _LastMarker = _this select 1; // Last marker which air unit reached

if(_Vehicle == aircraft_1) then {_handle = [aircraft_1, [["pos_1", 200], ["pos_2", 200], ["pos_3", 200]], 3500, 200, 30, [10, 30, 60], Base1, 150] spawn DEVAS_AirPatrol;};

///////             CUSTOM CODE CAN BE USED FROM THIS POINT ON           ///////////
// From this point on, you can add the logic which you want to happen when air unit arrives to final point (i.e. calling your own scripts).
// You can use the _Vehicle to choose different actions based on the air unit which arrived in case there are multiple air units in your Scenario.


is that the right way to do it?


greetings Mike

Share this post

Link to post
Share on other sites

This is the init of the Y-32

i start it with a trigger.

_handle = [aircraft_1, [["pos_1", 200], ["pos_2", 200], ["pos_3", 200], 3500, 250, 30, [10, 30, 60], base_1, 150]] spawn DEVAS_AirPatrol;


thanks for your help!

Share this post

Link to post
Share on other sites


1- So first mistake (which I didn't notice from your message right away) is the wrong syntax
Right after I run the initial call it shows the error message in black screen



to fix it you need to put the ] properly


_handle = [aircraft_1, [["pos_1", 200], ["pos_2", 200], ["pos_3", 200]], 3500, 250, 30, [10, 30, 60], base1, 150] spawn DEVAS_AirPatrol;


2- The base marker which you created is base_1 and not base1. You wrote wrong one in end script and also in your trigger


fix both and all looks working


Share this post

Link to post
Share on other sites

I am back with a new release to fix some issues and optimize the code a bit.
I add video to demenstrate the behaviour when the script is used.
I also add a sample mission.
All can be find in first message in thread

Share this post

Link to post
Share on other sites

I really love this script. I have not tried this yet, but will it allow a group or flight of 3 aircraft(Pawnees or MELB) to work and fly together as one group controlled by the script?


Will this work on dedicated?



Share this post

Link to post
Share on other sites

it works on dedicated. Formation flight is not implemented to so you need to trigger the script 3 times if you want 3 aircraft. They might look like they are in formation though :)

Share this post

Link to post
Share on other sites

Awesome work and thanks for taking the time to make it and share 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