Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: A little script help

  1. #1

    A little script help

    Hey guys ive got an idea for a script but dont quite have the skill to pull it off.

    Basic concept i want is as follows;

    I want an SQF script when activated vior my radio alpha trigger does this;

    'heli_1' is to depart my HQ, off 'pad_1' and fly to a map-click position on the map and wait for all members of my patrol to board. Once my patrol is on 'heli_1' it will then fly to another map-click position. Here it will wait until all my patrol is off then it will fly back to my HQ and land on a heli pad named 'pad_1'. I want this to be a repeated script, one i can call on anytime for heli/dynamic movement.

    1. The helicopter is a blackhawk named 'heli_1'.
    2. The heli pad is named 'pad_1'.
    3. I have a trigger that is radio alpha, repeated.
    4. My patrol consists of 6 members; my player (no name) and five others named 'a', 'b', 'c', 'd' and 'e'.

    SOMEONE PLEASE HELP

  2. #2
    You don't need to write a script for that. Just use the SecOps Module!

    http://community.bistudio.com/wiki/S...ations_Manager

    http://forums.bistudio.com/showthread.php?t=73329
    | My Campaigns | Grey Sky | Operation Red Star |

  3. #3
    I know the SECOP way, just would like to actually script it for my own learning. Can anyone do this??

  4. #4
    Alrighty, what I did for you is

    I placed a second pad over pad_1 called it pad_2, its invisible.

    Then the code should be self explaining

    hint "Click on the map to select a pickup point";
    onMapSingleClick "pad_2 setPos _pos; onMapSingleClick ''; true;";
    waitUntil {pad_1 distance pad_2 > 20};
    hint "Location Confirmed";
    heli_1 move getPos pad_2;
    waitUntil {heli_1 distance pad_2 < 120};
    heli_1 land "LAND";
    waitUntil {player in (crew heli_1)};
    heli_1 move getPos pad_1;
    waitUntil {heli_1 distance pad_1 < 120};
    heli_1 land "LAND";

  5. #5
    Will try, cheers mate hope it goes well!

    ---------- Post added at 09:10 PM ---------- Previous post was at 08:41 PM ----------

    Okay it works but the helicopter wont land to pick me up it just hovers... ?

  6. #6
    Should be picking you up. Tested it on Utes airport and it seemed to be working for you if it doesn't you should use the PICKUP waypoint, search through the forums for it.

    In addition to that you might want to add a if condition around the code to clarify whether the helicopter is available or not.

    Could be a distance check to pad_1 or or so. Or just check whether the engine is on or not.

  7. #7
    wow thats a bit advanced for me!! im a learner ok cheers will try look around a bit more

  8. #8
    Code with the if condition checking whether pad_1 is at pad_2 location and setting pad_2 back to pad_1 as soon as the helicopter has the people inside.

    Spoiler:
    Also what you could do to get some more stuff into it + learn some sqf basics. Calculate a ETA of the helicopter to the pickup.

    Idea

    Spoiler:


    Calculation

    Spoiler:


    Code

    Spoiler:
    Last edited by Joshii; Apr 27 2010 at 05:25.

  9. #9
    Kool joshii i'll try that now, hope it works...

    ---------- Post added at 06:38 PM ---------- Previous post was at 05:45 PM ----------

    Seriously the helicopter wont land....???? I have the exact same script the heli wont land??

  10. #10
    Right.. Check this out.



    It was working on every single of my tests.

    The only problem that may be there is that if the heli doesn't get too close to the landing pad ( 200 meter ) in this case. Then it won't land. But it should be working fine. Post a feedback asap please.
    Last edited by Joshii; Apr 27 2010 at 12:28.

Page 1 of 2 12 LastLast

Posting Permissions

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