Results 1 to 1 of 1

Thread: AI Transport Script

  1. #1
    Gunnery Sergeant Dirty Haz's Avatar
    Join Date
    Nov 29 2011
    Location
    Birmingham, United Kingdom
    Posts
    499

    AI Transport Script

    How would I go about making the AI not go into certain zones until they are clear ? I have the zone markers and triggers setup in the towns. Maybe somehow I would go about making it if obj is false then don't move there but I do not know how to write this.

    Code:
    //////////////////////////////////////////////////////////////////
    // Function file for Armed Assault
    // Created by: (AEF)Wolffy.au [2CAV]
    // Created: 20090326
    // Version: 20090326 - Initial release
    // Version: 20090410 - Added helicopter support
    // Version: 20090414 - Fixed AI flying into trees on take off and
    // hover on landing (helps on slopes)
    // Contact: http://www.aef-hq.com.au
    // Purpose: Give directions to any AI transport inc helis
    ///////////////////////////////////////////////////////////////////
    if (isServer) then {
        PV_AID = [];
        PublicVariable "PV_AID";
        [] spawn {
            while {true} do {
                waitUntil {(count PV_AID) != 0};
                _driver = PV_AID select 0;
                _pos = PV_AID select 1;
                if (vehicle _driver iskindof "Helicopter") then {
                    _driver move (position _driver);
                    _driver flyInHeight 50;
                    waitUntil {(getPos _driver select 2) + (_driver distance (getPos _driver)) > 40};
                };
                _driver move _pos;
                // Originally from Myke's cep_move.sqf
                if (vehicle _driver iskindof "Helicopter") then {
                    _driver flyInHeight 50;
                    _land = "HeliHEmpty" createVehicle _pos;
                    waitUntil {(_driver distance _land) < 150};
                    _driver land "GET OUT";
                    waitUntil {(getPos _driver select 2) + (_driver distance (getPos _driver)) < 5};
                     _driver flyInHeight 3;
                    deletevehicle _land;
                };
                PV_AID = [];
                PublicVariable "PV_AID";
            };
        };
    };
    
    if (count _this > 0) then {
        _driver = _this select 0;
        _id = floor random 10000;
        //hint format["%1", _id];
        call compile format["click%1 = [];", _id];
        titleText ["Click on your map where you would like the driver to move to.", "PLAIN DOWN", 1];
        onMapSingleClick format["click%1 = _pos; onMapSingleClick """"", _id];
        waitUntil {call compile format["(count click%1) > 0", _id]};
        waitUntil {(count PV_AID) == 0};
        call compile format["PV_AID = [_driver, click%1]", _id];
        _driver sideChat "Moving out";
        PublicVariable "PV_AID";
    };
    This will not work but its something like this I think .
    Code:
    if (_obj1=false) then {driver1=something to disable move} else {allow him to move to that zone}
    Last edited by Dirty Haz; Apr 10 2012 at 16:06.

Similar Threads

  1. Mulitple vehicle - transport script
    By DTM2801 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Sep 30 2009, 14:08
  2. need some help with a transport script
    By DTM2801 in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 0
    Last Post: Sep 29 2009, 14:06
  3. Transport
    By mazza in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 11
    Last Post: Apr 18 2009, 16:15
  4. Transport help
    By WebDog in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Nov 20 2001, 08:20

Posting Permissions

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