Question regarding patrolling helis code

Torndeco

Valued Member!
Plz geel free to ignore the question...

Just lookin for roughly how the patroling heli works...
Had a look @ the code & just want to verify thats how it works.
If u don't mind... saves some time on trying to debug & verify it

--------

Heli spawns,
Gets told to move to a waypoint & @ end of waypoint it spawns the code to generate a random waypoint.
https://github.com/dayzai/DayZBanditAI/blob/1.9/DZAI/spawn_functions/spawn_heliPatrol.sqf#L141

Also spawns code to tell it to move to another waypoint ?
https://github.com/dayzai/DayZBanditAI/blob/1.9/DZAI/spawn_functions/spawn_heliPatrol.sqf#L143
https://github.com/dayzai/DayZBanditAI/blob/1.9/DZAI/init/dzai_functions.sqf#L102

----------

So if am right, that means heli patrols move @ starting location + 3 waypoints.
Once its done arma repeats the patrol using the same waypoints..

Or am i missing something in the code that generates the next waypoint for heli patrols ??

-------

Just wondering as looking @ adding a trigger into a mission to add its postion to heli patrol to call it over to mission site.
 
In spawn_heliPatrol.sqf, the initial waypoint (index "0") is modified so that completing the waypoint allows the helicopter to detect nearby players. A second waypoint (index "1") is added so that completing the waypoint randomizes the location of the two waypoints together. Note that waypoints 0 and 1 are always pointing at identical positions.

The DZAI_heliRandomPatrol is the function responsible for relocating waypoints 0 and 1 together after waypoint 1 is completed. It selects the next waypoint location from a list of pre-generated positions for all towns/cities/locations on the map, then slightly varies the exact position by up to 300m.

So a short summary:

Waypoint 0: This waypoint is completed very quickly (1 second after arrival) so that the helicopter is aware of nearby players by the time it proceeds to waypoint 1.

Waypoint 1: This waypoint takes more time to complete. During this time, the helicopter either loiters for a while or begins searching the area. After this waypoint is completed, waypoints 0 and 1 have their locations randomized and the helicopter cycles back to waypoint 0.

Edit: Ignore the commented line in dzai_functions mentioning "selects a random dynamic trigger to use as AI helicopter's next waypoint". I haven't changed this comment since the super-early days of AI heli patrols.
 
Back
Top