Jump to content

Photo
- - - - -

AI helicopter pilot to rotate helicopter?


  • Please log in to reply
4 replies to this topic
rejenorst
rejenorst

    Gunnery Sergeant

  • Members
  • 403 posts

#1

Posted 21 June 2011 - 20:35

I am trying to find a way to get a helicopter pilot to rotate in the direction of a laser target. When playing as gunner, the setting of waypoints via the move command have to be apprx 200 meters from the heli.

Any help would be appreciated. Have tried dotarget but this gives me an error.

Dowatch and lookat don't work either.

Thanks.

twirly
twirly

    Master Gunnery Sergeant

  • Members
  • 1302 posts

#2

Posted 21 June 2011 - 21:41

I personally don't think anything will work. In any vehicle with an AI driver... being a gunner is almost impossible. That's just my opinion however.... maybe others have different ideas about it.

You can rotate the helo by using setDir.... but this is not an ideal solution.

The code below will rotate a helo. This particular code was used to rotate a helo on landing so that it points to the direction it came in to the LZ.

_dir = getDir _helo;

//turns the helo
for [{_i=0},{_i<180},{_i=_i+1}] do {
	_helo setDir _dir + _i;
	sleep 0.01;
};

You would have to keep applying the setDir to the helo every .x seconds to keep it pointing at the target. What this will end up looking like I have no idea.

Edited by twirly, 21 June 2011 - 21:44.


"Learn by doing!" - Quoted from a post by Imutep

OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

Big Dawg KS
Big Dawg KS

    Captain

  • Members
  • 6363 posts

#3

Posted 21 June 2011 - 21:46

Have you tried setFormDir?
VBS Designer

I like to call Arma a sandbox game that works pretty much like LEGO - you buy it not just because you want to have a nice car from the main picture on its box, do you?


Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

#4

Posted 21 June 2011 - 22:09

this works, at least for a SP mission:
Spoiler


setFormDir only works on man units.
My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

rejenorst
rejenorst

    Gunnery Sergeant

  • Members
  • 403 posts

#5

Posted 22 June 2011 - 05:33

Cheers will play around with some of these suggestions and see if I can get a simple N,S,SW,SE,NW,NE direction system happening. I can confirm that Setformdir only works on man units.