Editors Depot - Mission Editing and Scripting > ArmA - Editing/Scripting Resources Beta Testing & Submission

HCA - Helicopter Collision Avoidance - ArmA Version (ACCEPTED)

(1/2) > >>

Mr.Peanut:
If you have ever made a mission with more than one AI helicopter, you are well aware of how skilled the AI are at flying into one another. Here is a solution.

HCA - Helicopter Collision Avoidance
ArmA Version
by Mr.Peanut
Version 1.1 : July 1, 2008
Formerly called HeliCAS, before I knew CAS meant Close Air Support.

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 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.  There is a degree of randomness involved.
The helicopters will not always successfully avoid collision. In the demo provided there are eight AI helicopters,
one of which will crash about 50% of the time in the first thirty seconds.

MP USAGE:
HCA will work in multiplayer if is run with the same arguments on all nodes i.e. server and clients.
It will also work with helicopters piloted by players, and AI helicopters under player command.
There are limitations. Two helicopters approaching collision at high speed might crash. A player trying very hard
to crash his helicopter into another will eventually succeed.

I would be greatful if someone would test the demo mission on a dedicated server. I don't have the horsepower to do so myself.

http://ca.youtube.com/watch?v=Eexpx1BvRMs
Here is the embed object info for the youtube link. I don't have a clue what to do with it.

--- Code: ---<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/Eexpx1BvRMs"></param><embed src="http://www.youtube.com/v/Eexpx1BvRMs" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

--- End code ---

;======================================================================
;
; OFPEC Keywords: helicas,helicopter,helicopters,heli,helis,chopper,choppers,collision,collide,avoid,avoidance,crash
; SMUC Code: M for Multiplayer
; Originally released on www.ofpec.com
;
; Thanks to Mandoble for ArmA conversion advice and prodding me to re-release.
;
;Changelog
;2008/06/10 - Optimised code for sqs syntax. Added prefix tags to all global variables.
;             Tested for MP compatibility including player and player controlled pilots.
;             Functions no longer need to be initialised in init.sqs
;2008/07/01 - ArmA conversion. Tweaked default values for ArmA.

Get HCA v1.1

kju:
Quite impressive.  :)

Mr.Peanut:
Thanks. It is funny. The OFP version of this script is several years old, and as far as I know it was only used by a couple people. Hopefully the new ArmA version will find a little more use. It would work with fixed winged aircraft but it would take experimentation with the parameters.

loki72:
very nice :clap:

bedges:
Might be interesting to see a version without the script in action, y'know, just for comparison...  :whistle:

Navigation

[0] Message Index

[#] Next page

Go to full version