Results 1 to 5 of 5

Thread: AI helicopter pilot to rotate helicopter?

  1. #1

    AI helicopter pilot to rotate helicopter?

    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.

  2. #2
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    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.

    Code:
    _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.
    Last edited by twirly; Jun 21 2011 at 21:44.

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

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  3. #3
    Have you tried setFormDir?
    VBS Designer

    Quote Originally Posted by Armored_Sheep View Post
    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?

  4. #4
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    this works, at least for a SP mission:
    Spoiler:


    setFormDir only works on man units.
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    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.

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •