Re-attached this resource since it somehow disappeared from the ED in the past half year. Feel free to delete this post once it is back in so that the thread sinks to its proper place in time
OFPR, SMUC code is C, demo mission included. Text from script header to help for ED entry:
;======================================================================
;HeliCAS - A Helicopter Collision Avoidance System for AI pilots;
;by Mr.Peanut
;Version 1.0 : March 7, 2005
;
;SYNTAX: [_heli] Exec "helicas.sqs"
;EXAMPLE: [[H1,H2,H3,H4,H5,H6,H7,H8,...,H?]] Exec "helicas.sqs"
; where H1-H? are the helicopter names. In this case the default values will be used for the input parameters.
;
; OR for total control
;
;SYNTAX: [_heli, _dist, _ spd, _dt, _delay] Exec "helicas.sqs"
;EXAMPLE: [[H1,H2,H3,H4,H5,H6,H7,H8,...,H?],10,2.0,1.0,0.05] Exec "helicas.sqs"
; where H1-H? are the helicopter names
;
;INPUT VARIABLES:
; _heli = array of helicopters piloted by AI
; _dist = collision detection distance (m)
; _spd = collision avoidance speed (m/s)
; _dt = collision prediction time (seconds)
; _delay = collision detection delay (seconds)
;
;FUNCTIONS USED:
; The following functions must be declared in init.sqs
; Distance3D = preprocessFile "distancepos3d.sqf"
; Sign = preprocessFile "sign.sqf"
;
;DESCRIPTION:
; This script works by predicting each helicopter's position _dt seconds from present. If any of the helicopters are
; closer to each other than distance _dist, then they are nudged apart from each other with a speed based on the value
; of _spd. The _delay variable is the loop delay between collision checks. The helicopters will not always successfully avoid
; collision, but that is true of the real world too.
;
; I have found the following values to work well and provided them as defaults:
; _dist = 10
; _spd = 2
; _dt = 1
; _delay = 0.05
;
; Increasing _delay above 0.1 is not advised if you have more than three helicopters. Increasing _spd above 5
; will make the helicopters flit and bounce around unnaturally. If you decrease _dist, it is a good idea to increase _dt.
;
; For fewer helicopters, decrease _dist, decrease _spd, decrease _dt and increase _delay.
;
;WARNING:
; There is no check for whether the array _hlist is a valid list of helicopters. I did not want to hard code a list
; of helicopter types.
;