Jump to content

slammandan

Member
  • Content Count

    47
  • Joined

  • Last visited

  • Medals

Posts posted by slammandan


  1. 19 hours ago, pierremgi said:

    Feel free to change the flare / smoke for the vehicle category (tank / APC / crate or car). You can modify /add a category. Make your choice and drop all you want.

    The array of load arrays is an example, of course. I preferred to hard code it in a line, rather than open a dialog. If someone is motivated...



     

      Hide contents

     

    
    
    MGI_fnc_dropVeh =
    {
      _veh = _this;
      _vehPayloadArray = [
        ["B_Heli_Light_01_F","B_supplyCrate_F"],
        ["B_T_VTOL_01_armed_F","I_MRAP_03_F"],
        ["B_T_VTOL_01_vehicle_F","B_T_MBT_01_cannon_F"],
        ["I_Heli_Transport_02_F","B_supplyCrate_F","B_supplyCrate_F","B_supplyCrate_F"],
        ["B_T_VTOL_01_infantry_F","B_T_LSV_01_armed_F","O_LSV_02_armed_F","I_MRAP_03_F"],
        ["B_Heli_Transport_03_unarmed_F","B_T_MBT_01_cannon_F"]
      ];
    comment "choose all your sub-arrays made of 1 helo/ x crate(s) in the lines above and report all helos in vehicle type of the module.";
    _veh setVariable ["MGI_dropChoice",(_vehPayloadArray select {(_x select 0) == typeOf _veh}) select 0,true];
    _home = getpos _this;
     _grpVeh = group _veh;
    sleep 3;
    _currentwpt = [_grpVeh, currentWaypoint _grpVeh];
    _currentwptPos = waypointPosition _currentwpt;
    _currentwptdesc = waypointDescription _currentwpt;
    deleteWaypoint _currentwpt;
    _wpt = _grpVeh addWaypoint [_currentwptPos,0];
    _wpt setWaypointDescription _currentwptdesc;
    
    _wpt setWaypointStatements ["TRUE", "
      if (isServer) then {
        [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', vehicle this getVariable 'MGI_dropChoice' , this getVariable 'BIS_SUPP_selectedModule'] spawn {
          _pilot = _this select 0;
          _wpPos = _this select 1;
          _chuteType = _this select 2;
          _loadArray = (_this select 3) select [1,count (_this select 3)];
          _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; _flare = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{'smokeShellYellow'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]""; comment 'optional remove the _crateCode line if you dont want an arsenal';
          _oldDist = _pilot distance _wpPos;
          while {_oldDist >= _pilot distance _wpPos} do {
            _oldDist = _pilot distance _wpPos;
            sleep 0.1
          };
          _pilot setVariable ['BIS_SUPP_supporting', FALSE];
    
          private _chuteVeh1 = objNull;
          private _chuteVeh2 = objNull;
          private _chuteVeh3 = objNull;
          private _chuteVeh4 = objNull;
          private _chuteVeh5 = objNull;
          for '_i' from 0 to count _loadArray -1 do {
            _crateType = _loadArray select _i;
            call {
              if (getText (configfile >> 'CfgVehicles' >> _crateType >> 'editorSubcategory') isEqualTo 'EdSubcat_Tanks') exitWith {
                _chuteVeh1 = _chuteType createVehicle [0,0,0];
                _chuteVeh2 = _chuteType createVehicle [0,0,0];
                _chuteVeh3 = _chuteType createVehicle [0,0,0];
                _chuteVeh4 = _chuteType createVehicle [0,0,0];
                _chuteVeh5 = _chuteType createVehicle [0,0,0];
                _chuteVeh1 setPosATL [position _pilot select 0,position _pilot select 1, (position _pilot select 2) - 20];
                _chuteVeh1 disableCollisionWith vehicle _pilot;
                _chuteVeh2 attachTo [_chuteVeh1,[0,0,0]];
                _chuteVeh3 attachTo [_chuteVeh1,[0,0,0]];
                _chuteVeh4 attachTo [_chuteVeh1,[0,0,0]];
                _chuteVeh5 attachTo [_chuteVeh1,[0,0,0]];
                _chuteVeh1 setVectorUp [0,0,1];
                _chuteVeh2 setVectorUp [0.5,0,0.6];
                _chuteVeh3 setVectorUp [-0.5,0,0.6];
                _chuteVeh4 setVectorUp [0,0.5,0.6];
                _chuteVeh5 setVectorUp [0,-0.5,0.6];
              };
              if (getText (configfile >> 'CfgVehicles' >> _crateType >> 'editorSubcategory') isEqualTo 'EdSubcat_APCs') exitWith {
                _chuteVeh1 = _chuteType createVehicle [0,0,0];
                _chuteVeh1 disableCollisionWith vehicle _pilot;
                _chuteVeh2 = _chuteType createVehicle [0,0,0];
                _chuteVeh3 = _chuteType createVehicle [0,0,0];
                _chuteVeh1 setPosATL [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 20];
                _chuteVeh2 attachTo [_chuteveh1,[0,0,0]];
                _chuteVeh3 attachTo [_chuteveh1,[0,0,0]];
                _chuteVeh1 setVectorUp [0.6,0,0.6];
                _chuteVeh2 setVectorUp [-0.5,0.4,0.6];
                _chuteVeh3 setVectorUp [-0.5,-0.4,0.6];
              };
              _chuteVeh1 = _chuteType createVehicle [0,0,0];
              _chuteVeh1 disableCollisionWith vehicle _pilot;
              _chuteVeh1 setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 20];
    
            };
            _crate = createVehicle [_crateType, position _chuteVeh1, [], 0, 'FLY'];
            vehicle _pilot setVariable ['MGI_crate'+str _i,_crate,true];
            _crate call _crateCode; comment 'to be removed also, if the _crateCode line is removed above.';
            _crate attachTo [_chuteVeh1,[0,0,-4]];
            [_crate,_chuteVeh1,_chuteVeh2,_chuteVeh3,_chuteVeh4,_chuteVeh5,_i,_pilot] spawn {
              params ['_crate','_chuteVeh1','_chuteVeh2','_chuteVeh3','_chuteVeh4','_chuteVeh5','_i','_pilot'];
              waitUntil {position _crate select 2 < 3 || isNull _chuteVeh1};
              detach _crate;
              deleteVehicle _chuteVeh1;
              if (!isnull _chuteVeh2) then {
                detach _chuteVeh3;
                detach _chuteVeh2;
              };
              if (!isnull _chuteVeh4) then {
                detach _chuteVeh4;
                detach _chuteVeh5;
              };
              comment '_chuteVeh1 setVelocity [0,5,0]';
              vehicle _pilot setVariable ['MGI_crate'+str _i,nil,true];
            };
          };
        };
       };
    "];
    _grpVeh setCurrentWaypoint _wpt;
    _wp2 = _grpVeh addWaypoint [_home, 0];
    _wp2 setWaypointType "Move";
    _wp2 setWaypointBehaviour "SAFE";
    _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"];
    _veh land "none";
    waitUntil {!isnil {_veh getVariable "MGI_crate"}};
    sleep 60;
    {deleteVehicle _x} forEach crew _veh;
    deleteVehicle _veh;
    };
    
    _this spawn MGI_fnc_dropVeh;

     

     

     

     

     

    pierremgi ,  Wow!  This is perfect.  Thank You So Much!

    Dan

    • Like 1

  2. 6 hours ago, pierremgi said:

    Yep! Need some time but feasible.

    _crateCode =  compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; 
          _flare = if (sunOrMoon <0.5) then [{'B_IRStrobe'},{'SmokeShell'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0, 0, 0.45 ]];
          _flare2 = if (sunOrMoon <0.5) then [{'Chemlight_red'},{'SmokeShellRED'}]; _fumi2 = _flare2 createvehicle getPosATL _this; _fumi2 attachTo [_this,[0.4, 0, 0.45]];
          _flare3 = if (sunOrMoon <0.5) then [{'Chemlight_blue'},{'SmokeShellBLUE'}]; _fumi3 = _flare3 createvehicle getPosATL _this; _fumi3 attachTo [_this,[-0.4, 0, 0.45]];
          _flare4 = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{''}]; _fumi4 = _flare4 createvehicle getPosATL _this; _fumi4 attachTo [_this,[0, 0, 0.45 ]]""; comment 'optional remove the _crateCode line if you dont want an arsenal';

    This Is the crate code I use for supply drop, I would like to use yours for vehicles.

    You Sir, Are Awesome!

    Dan


  3. 7 hours ago, pierremgi said:

    If my code runs, the aircraft will be deleted after 60 sec. (I hope).

    As you know, the code is made the drop a vehicle but you can drop a crate as well. It's just a class name question.

     

    For working around BI problem,  we could determine what we want to drop along with vehicle classes. Instead of exiting the code if a crate is required, we can manage the couple type Of aircraft/type of "crate" (payload).


     

    
    _veh = _this;
    _vehPayloadArray = [["B_T_VTOL_01_armed_F","B_T_MBT_01_cannon_F"],["B_T_VTOL_01_vehicle_F","B_T_MBT_01_cannon_F"],["B_Heli_Transport_03_unarmed_F","B_supplyCrate_F"]];
    comment "choose all your couples helo/crate on the line above and report all helos in vehicle type of the module";
    _veh setVariable ["MGI_payload",(_vehPayloadArray select {(_x select 0) == typeOf _veh}) select 0 select 1,true];
    _home = getpos _this;
     _grpVeh = group _veh;
    sleep 3;
    _currentwpt = [_grpVeh, currentWaypoint _grpVeh];
    _currentwptPos = waypointPosition _currentwpt;
    _currentwptdesc = waypointDescription _currentwpt;
    deleteWaypoint _currentwpt;
    _wpt = _grpVeh addWaypoint [_currentwptPos,0];
    _wpt setWaypointDescription _currentwptdesc;
    
    _wpt setWaypointStatements ["TRUE", "
      if (isServer) then {
        [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', vehicle this getVariable 'MGI_payload' , this getVariable 'BIS_SUPP_selectedModule'] spawn {
          _pilot = _this select 0;
          _wpPos = _this select 1;
          _chuteType = _this select 2;
          _crateType = _this select 3;
          _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; _flare = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{'smokeShellYellow'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]""; comment 'optional remove the _crateCode line if you dont want an arsenal';
          _oldDist = _pilot distance _wpPos;
          while {_oldDist >= _pilot distance _wpPos} do {
            _oldDist = _pilot distance _wpPos;
            sleep 0.1
          };
          _pilot setVariable ['BIS_SUPP_supporting', FALSE];
          _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
          _chute setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
          _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];
          vehicle _pilot setVariable ['MGI_crate',_crate,true];
          _crate call _crateCode; comment 'to be removed also, if the _crateCode line is removed above.';
          _crate attachTo [_chute, [0, 0, 0]];
          waitUntil {position _crate select 2 < 3 || isNull _chute};
          detach _crate;
          _chute setVelocity [0,5,0];
          vehicle _pilot setVariable ['MGI_crate',nil,true];
        };
       };
    "];
    _grpVeh setCurrentWaypoint _wpt;
    _wp2 = _grpVeh addWaypoint [_home, 0];
    _wp2 setWaypointType "Move";
    _wp2 setWaypointBehaviour "SAFE";
    _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"];
    _veh land "none";
    waitUntil {!isnil {_veh getVariable "MGI_crate"}};
    sleep 60;
    {deleteVehicle _x} forEach crew _veh;
    deleteVehicle _veh;

     

     

     

    This works!  Works exactly like its supposed to.  Now...I do have a few requests!  LOL.  2 of the requests you had in your scripts before, and I liked them.  1.  The 3 parachutes for heavy vehicles.  2.  Ability to drop 2 vehicles from certain helo.  and   3.  If possible to do separate crate code for vehicles different than supply crate.  I use chemlights and an ir strobe on my supply drop.  To get them in correct position on supply drop makes them float in air a bit on vehicles.  It just doesn't look too good.  But,  if that is too much a hassle, it is no biggie.  Really like what you have now.  I appreciate it ALOT!

    Thanks 

    Dan


  4. Ok, after more testing.  No Mods, no code, just mission.sqf, two guys on malden with vanilla suppy drop.  Host works fine, client every aircraft drops supplies, returns to start and lands.  So it is a BI issue.  I would like to use two aircraft for arsenal delivery the B_Heli_Transport_03_unarmed_F"", and ""B_T_VTOL_01_armed_F".  Do you think I should make a trigger to detect if they are <2m and then delete them?  Or?????

    Thanks again for all your help

    Dan


  5. Hello, I am back.  After more testing, using your newest script from 8-3-18, I have two aircraft I can call 

     ["B_T_VTOL_01_armed_F","B_T_VTOL_01_vehicle_F"]

    In Vehicle Init

    _this spawn MGI_fnc_dropVeh 

    In Crate Init

    [_this,{ _this addAction ["<t color='#ffff11'>Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal},nil,10,false,true,"", ""]} ] remoteExec ["call"];    _flare = if (sunOrMoon <0.5) then [{"F_20mm_Yellow"},{"smokeShellYellow"}];   _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]; 

    In MGI_fnc_dropVeh.sqf

    _veh = _this;
    if !(_veh isKindOf "B_T_VTOL_01_armed_F") exitWith {}; comment "choose the helicopter class you want for car drop, the other ones will drop simple crates.";
    _home = getpos _this; 
     _grpVeh = group _veh; 
    sleep 3; 
    _currentwpt = [_grpVeh, currentWaypoint _grpVeh]; 
    _currentwptPos = waypointPosition _currentwpt; 
    _currentwptdesc = waypointDescription _currentwpt; 
    deleteWaypoint _currentwpt; 
     
    _wpt = _grpVeh addWaypoint [_currentwptPos,0]; 
    _wpt setWaypointDescription _currentwptdesc; 
    _wpt setWaypointStatements ["TRUE", " 
      if (isServer) then { 
        [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', 'B_MRAP_01_hmg_f', this getVariable 'BIS_SUPP_selectedModule'] spawn { 
          _pilot = _this select 0; 
          _wpPos = _this select 1; 
          _chuteType = _this select 2; 
          _crateType = _this select 3; 
          _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; _flare = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{'smokeShellYellow'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]""; comment 'optional remove the _crateCode line if you dont want an arsenal';
          _oldDist = _pilot distance _wpPos; 
          while {_oldDist >= _pilot distance _wpPos} do { 
            _oldDist = _pilot distance _wpPos; 
            sleep 0.1 
          }; 
          _pilot setVariable ['BIS_SUPP_supporting', FALSE]; 
          _chute = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY']; 
          _chute setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50]; 
          _crate = createVehicle [_crateType, position _chute, [], 0, 'NONE'];
          vehicle _pilot setVariable ['MGI_crate',_crate,true]; 
          _crate call _crateCode; comment 'to be removed also, if the _crateCode line is removed above.';
          _crate attachTo [_chute, [0, 0, 0]]; 
          waitUntil {position _crate select 2 < 3 || isNull _chute}; 
          detach _crate; 
          _chute setVelocity [0,5,0]; 
          vehicle _pilot setVariable ['MGI_crate',nil,true]; 
        }; 
       }; 
    "]; 
    _grpVeh setCurrentWaypoint _wpt; 
    _wp2 = _grpVeh addWaypoint [_home, 0]; 
    _wp2 setWaypointType "Move"; 
    _wp2 setWaypointBehaviour "SAFE"; 
    _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"]; 
    _veh land "none"; 
    waitUntil {!isnil {_veh getVariable "MGI_crate"}}; 
    sleep 60; 
    {deleteVehicle _x} forEach crew _veh; 
    deleteVehicle _veh;

    Just two Players.  When host calls either aircraft it works perfect, the first one drops a vehicle, the second drops arsenal, fly back to start and delete.  

    When client calls first (Vehicle Drop), Works perfect, aircraft drops vehicle flys back to start, deletes.  But if he calls reg supply drop ("B_T_VTOL_01_vehicle_F") It flys over, drops arsenal, flys back to start and lands.

    Im sorry to be a bother.

    All of your help is very apreciated!

    Thank You

    Dan


  6. 5 hours ago, pierremgi said:

    This should work fine, even in MP.

    Added a public variable linked to the helo, for helo deletion.

    I replaced the //comment by plain comment "" in the script (for those who'd like to spawn it straight in init vehicle).

     

    The dropping helo should disappear about one minute after being back for landing.

     

    It's better to choose your available helos (for any drop)by declaring them in the "vehicle types" field of the virtual module. If not, BI module decides what is available by default (medium - heavy helos).

    There is no reason to drop a vehicle instead of a crate if you pay attention for the class name(s) of your helo(s). With such line:

    if !(typeOf _veh in ["B_T_VTOL_01_vehicle_F","B_Heli_Transport_03_unarmed_F"]) exitWith {};

    you decide what helos can drop something else than a standard crate (depending on the crate init field here).

    As the code exit, it's impossible to spawn a vehicle.

    Pay attention for this line. Classes array is case sensitive (used with "in").

    I feel so bad.  This script and previous one works when I put them in new mission.  Something else in my mission must be conflicting with the delete part of script.  It works great in new mission.  So sorry for the extra work I caused you.

    Thank You For Your Efforts

    Dan


  7. On ‎8‎/‎1‎/‎2018 at 12:01 AM, pierremgi said:

    Probably a variable localization on server instead of clients. I can't test right now. Try to publicVariable the MGI_crate variable:

     

    Write:

    MGI_crate = true;

    publicVariable "MGI_crate";

    for the 2 occurrences.

     

     I tried this.  They still return to where supply module is and find a place to land.  Here is the code.

    _veh = _this;
      if !(typeOf _veh in ["B_T_VTOL_01_vehicle_F","B_Heli_Transport_03_unarmed_F"]) exitWith {};
      _home = getpos _this;
      _grpVeh = group _veh;
      sleep 3;
      _currentwpt = [_grpVeh, currentWaypoint _grpVeh];
     _currentwptPos = waypointPosition _currentwpt;
     _currentwptdesc = waypointDescription _currentwpt;
     deleteWaypoint _currentwpt;
     
     _wpt = _grpVeh addWaypoint [_currentwptPos,0];
     _wpt setWaypointDescription _currentwptdesc;
     _wpt setWaypointStatements ["TRUE", "
     
      if (isServer) then {
        [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', ['B_T_MBT_01_cannon_F','B_T_LSV_01_armed_F'], this getVariable 'BIS_SUPP_selectedModule'] spawn {
          _pilot = _this select 0;
          _wpPos = _this select 1;
          _chuteType = _this select 2;
          _crates = _this select 3;
          _crateType = _crates select (vehicle _pilot isKindOf 'B_Heli_Transport_03_unarmed_F');
          
          _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call'];
          _flare = 'F_20mm_Yellow' createvehicle getPosATL _this;
          _flare attachTo [_this,[0,0,-2]];
          _fumi = 'smokeShellYellow' createvehicle getPosATL _this;
          _fumi attachTo [_this,[0,0,-2]]"";
    
          _oldDist = _pilot distance _wpPos;
          while {_oldDist >= _pilot distance _wpPos} do {
            _oldDist = _pilot distance _wpPos;
            sleep 0.1
          };
          _pilot setVariable ['BIS_SUPP_supporting', FALSE];
          
          private ['_chute1','_chute2','_chute3'];
          call {
            if (vehicle _pilot isKindOf 'B_T_VTOL_01_vehicle_F') exitWith {
              _chute1 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _chute2 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _chute3 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _posRef = [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
              _chute1 setpos (_posRef vectorAdd [0.58,0,0]);
              _chute2 setpos (_posRef vectorAdd [-0.5,0.3,0]);
              _chute3 setpos (_posRef vectorAdd [-0.5,-0.3,0]);
              _crate = createVehicle [_crateType, position _chute1, [], 0, 'NONE'];
              _crate call _crateCode;
              _crate attachTo [_chute1,[0,1.5,-4]];
              _chute2 attachTo [_chute1,[0,0,0]];
              _chute3 attachTo [_chute1,[0,0,0]];
              _chute1 setVectorUp [0.6,0,0.6];
              _chute2 setVectorUp [-0.5,0.4,0.6];
              _chute3 setVectorUp [-0.5,-0.4,0.6];
              waitUntil {position _crate select 2 < 3 || isNull _chute1};
              detach _crate;
              deleteVehicle _chute1;
              detach _chute3;
              detach _chute2;
              MGI_crate = true;
              publicVariable "MGI_crate"; 
              _chute1 setVelocity [0,5,0];
            };
            for '_i' from 0 to 1 do {
              _chute1 = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
              _chute1 setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
              _crate = createVehicle [_crateType, position _chute1, [], 0, 'NONE'];
              _crate call _crateCode;
              _crate attachTo [_chute1, [0, 0, 0]];
              [_chute1,_crate] spawn {
                params ['_chute1','_crate'];
                waitUntil {position _crate select 2 < 3 || isNull _chute1};
                detach _crate;
                _chute1 setVelocity [0,5,0];
              };
              sleep 1;
            };
          };
          MGI_crate = true;
          publicVariable "MGI_crate"; 
        };
      };
    "];
    _grpVeh setCurrentWaypoint _wpt;
    _wp2 = _grpVeh addWaypoint [_home, 0];
    _wp2 setWaypointType "Move";
    _wp2 setWaypointBehaviour "SAFE";
    _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"];
    _veh land "none";
    waitUntil {!isnil "MGI_crate"};
    sleep 60;
    {deleteVehicle _x} forEach crew _veh;
    deleteVehicle _veh;
    MGI_crate = nil;

     

    On ‎5‎/‎20‎/‎2017 at 4:47 PM, Vanished00One said:

    Its working, VR supply vehicles are deleting themselves. There are two issues I've found.

    
    _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call']; _flare = if (sunOrMoon <0.5) then [{'F_20mm_Yellow'},{'smokeShellYellow'}]; _fumi = _flare createvehicle getPosATL _this; _fumi attachTo [_this,[0,0,-2]]""; // optional remove the _crateCode line if you don't want an arsenal

    Removing this optional line for arsenal also requires removal of

    
    _crate call _crateCode; 

    Or you receive an error message

     

    Last issue is both crate and vehicle drops are deploying a vehicle.

     

    I have found a work around for this by simply adding another virtual supply drop set only with defaults of the module and it works.

    I also tried this as I am running my own arsenal code in crate ini. on supply module.  Still same result.  Only in mp.  When I am by myself, everything works great


  8.  

    On ‎7‎/‎26‎/‎2017 at 11:06 PM, pierremgi said:

    Just need one module.
    Don't forget to add ["B_T_VTOL_01_vehicle_F","B_Heli_Transport_03_unarmed_F"]  at least in vehicle types of the module.

    You can add all extra helo (example "B_Heli_Light_01_F") you want for standard crate. Add also some init crate in the module if needed (as explained above). It's better like this.

     

      Hide contents

     

    
    
    _veh = _this;
      if !(typeOf _veh in ["B_T_VTOL_01_vehicle_F","B_Heli_Transport_03_unarmed_F"]) exitWith {};
      _home = getpos _this;
      _grpVeh = group _veh;
      sleep 3;
      _currentwpt = [_grpVeh, currentWaypoint _grpVeh];
     _currentwptPos = waypointPosition _currentwpt;
     _currentwptdesc = waypointDescription _currentwpt;
     deleteWaypoint _currentwpt;
     
     _wpt = _grpVeh addWaypoint [_currentwptPos,0];
     _wpt setWaypointDescription _currentwptdesc;
     _wpt setWaypointStatements ["TRUE", "
     
      if (isServer) then {
        [this, this getVariable 'BIS_SUPP_supportRunCoords', 'B_Parachute_02_F', ['B_APC_Tracked_01_rcws_F','B_T_LSV_01_armed_F'], this getVariable 'BIS_SUPP_selectedModule'] spawn {
          _pilot = _this select 0;
          _wpPos = _this select 1;
          _chuteType = _this select 2;
          _crates = _this select 3;
          _crateType = _crates select (vehicle _pilot isKindOf 'B_Heli_Transport_03_unarmed_F');
          
          _crateCode = compile ""[_this,{_this addAction ['Arsenal',{['Open',true] spawn BIS_fnc_arsenal},nil,10,false,true,'', '']}] remoteExec ['call'];
          _flare = 'F_20mm_Yellow' createvehicle getPosATL _this;
          _flare attachTo [_this,[0,0,-2]];
          _fumi = 'smokeShellYellow' createvehicle getPosATL _this;
          _fumi attachTo [_this,[0,0,-2]]"";
    
          _oldDist = _pilot distance _wpPos;
          while {_oldDist >= _pilot distance _wpPos} do {
            _oldDist = _pilot distance _wpPos;
            sleep 0.1
          };
          _pilot setVariable ['BIS_SUPP_supporting', FALSE];
          
          private ['_chute1','_chute2','_chute3'];
          call {
            if (vehicle _pilot isKindOf 'B_T_VTOL_01_vehicle_F') exitWith {
              _chute1 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _chute2 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _chute3 = createVehicle [_chuteType, [0, 0, 200], [], 0, 'FLY'];
              _posRef = [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
              _chute1 setpos (_posRef vectorAdd [0.58,0,0]);
              _chute2 setpos (_posRef vectorAdd [-0.5,0.3,0]);
              _chute3 setpos (_posRef vectorAdd [-0.5,-0.3,0]);
              _crate = createVehicle [_crateType, position _chute1, [], 0, 'NONE'];
              _crate call _crateCode;
              _crate attachTo [_chute1,[0,1.5,-4]];
              _chute2 attachTo [_chute1,[0,0,0]];
              _chute3 attachTo [_chute1,[0,0,0]];
              _chute1 setVectorUp [0.6,0,0.6];
              _chute2 setVectorUp [-0.5,0.4,0.6];
              _chute3 setVectorUp [-0.5,-0.4,0.6];
              waitUntil {position _crate select 2 < 3 || isNull _chute1};
              detach _crate;
              deleteVehicle _chute1;
              detach _chute3;
              detach _chute2;
              MGI_crate = true;
              _chute1 setVelocity [0,5,0];
            };
            for '_i' from 0 to 1 do {
              _chute1 = createVehicle [_chuteType, [100, 100, 200], [], 0, 'FLY'];
              _chute1 setPos [position _pilot select 0, position _pilot select 1, (position _pilot select 2) - 50];
              _crate = createVehicle [_crateType, position _chute1, [], 0, 'NONE'];
              _crate call _crateCode;
              _crate attachTo [_chute1, [0, 0, 0]];
              [_chute1,_crate] spawn {
                params ['_chute1','_crate'];
                waitUntil {position _crate select 2 < 3 || isNull _chute1};
                detach _crate;
                _chute1 setVelocity [0,5,0];
              };
              sleep 1;
            };
          };
          MGI_crate = true;
        };
      };
    "];
    _grpVeh setCurrentWaypoint _wpt;
    _wp2 = _grpVeh addWaypoint [_home, 0];
    _wp2 setWaypointType "Move";
    _wp2 setWaypointBehaviour "SAFE";
    _wp2 setWaypointStatements ["TRUE", "vehicle this land 'LAND'"];
    _veh land "none";
    waitUntil {!isnil "MGI_crate"};
    sleep 60;
    {deleteVehicle _x} forEach crew _veh;
    deleteVehicle _veh;
    MGI_crate = nil;

     

     

    Sorry to bring up an old thread.  I really like this script, but im having trouble in MP if any joined players call supply drops the vehicles that are dropping the supplies still do not get deleted.  It works fine when host calls supply drop. 

    Thanks For Any Help

    Dan


  9. On ‎8‎/‎9‎/‎2017 at 9:11 AM, Boerstil said:

    I'll share my ai taxi/takeoff script

     

    
    /*
    	Author: Boerstil
    
    	Description:
    	- Function for aircraft to taxi to catapult then takeoff.
    
    	Exucution:
    	- Call the function via code/script
    
    		[_plane,["Catapult1","Catapult2","Catapult3","Catapult4"],_carrier] call BIS_fnc_AircraftCatapultLaunch;
    
    	Parameter(s):
    		0: plane/object
    		1: array of possible catapults
    		2: carrier/object
    		3: posWorld of plane (optional)
    
    
    	Returns: nothing
    
    
    */
    
    bor_fnc_CarrierTakeOff =
    {
    
    scopeName "takeOff";
    
    _veh = param [0,objNull,[objNull]];
    _catapults = param [1,["Catapult1","Catapult2"],[[]]];
    _carrier = param [2,objNull,[objNull]];
    _pos = param [3,(getPosWorld _veh),[[]]];
    private _dir = getDir _veh;
    private _height = _pos select 2;
    private _catapult = selectRandom _catapults;
    
    
    private _partClass = "";
    
    if ((_catapult == "Catapult1") || (_catapult == "Catapult2")) then 
    {
       _partClass = "Land_Carrier_01_hull_04_F";
    } else
    {
    	_partClass = "Land_Carrier_01_hull_07_F";
    };
    
    private _carrierObjects = _carrier nearObjects [_partClass , 200];
    private _part = _carrierObjects param [0, objNull];
    private _configPath = configfile >> "CfgVehicles" >> _partClass >> "Catapults" >> _catapult;
    private _animations = getArray (_configPath >> "animations");
    private _memPoint = getText (_configPath >> "memoryPoint");
    private _dirOffset = getNumber (_configPath >> "dirOffset");
    private _posCatapult = _part modelToWorld (_part selectionPosition _memPoint); _posCatapult set [2, _height];
    private _dirCatapult = (getDir _part - _dirOffset - 180) % 360;
    private _configPlane = configFile >> "CfgVehicles" >> typeOf _veh;
    private _velocityLaunch = getNumber (_configPlane >> "CarrierOpsCompatability" >> "LaunchVelocity") max 210;
    private _velocityIncrease = getNumber (_configPlane >> "CarrierOpsCompatability" >> "LaunchVelocityIncrease") max 75;
    private _accelerationStep = getNumber (_configPlane >> "CarrierOpsCompatability" >> "LaunchAccelerationStep") max 0.025;
    private _launchBar = getText (_configPlane >> "CarrierOpsCompatability" >> "LaunchBarMemoryPoint");
    
    if (true) then 
    {
    	waitUntil 
    	{
    		if (!alive (driver _veh)) exitWith {breakto "takeOff";true};
    		!(_carrier getVariable ["landing",false]) && (_part animationPhase (_animations select 0) < 2)
    	};
    	_veh setFuel 1;
    	_veh engineOn True;
    	_veh setPosWorld _pos;	
    	sleep 5;
    	
    	waitUntil
    	{
    		if (!alive (driver _veh)) exitWith {breakto "takeOff";true};	
    		isEngineOn _veh
    	};
    
    	while {(_veh distance _pos) < 15} do
    	{
    		_veh setAirplaneThrottle 0.3;
    		_veh setDir _dir;
    		_veh setVelocity [(sin _dir  * (25 / 3.6)),(cos _dir  * (25 / 3.6)),(velocity _veh select 2)];
    		if ((_veh distance _posCatapult) < 15) exitWith {_veh setVelocity [0,0,0];};
    		if (!alive (driver _veh)) exitWith {breakto "takeOff"};	
    		sleep 0.02
    	};
    	
    	while {!((getDir _veh) > ((_veh getDir _posCatapult) - 3) && (getDir _veh) < ((_veh getDir _posCatapult) + 3))} do
    	{ 
    		_veh setAirplaneThrottle 0.3;	
    		if (!alive (driver _veh)) exitWith {breakto "takeOff"};
    		if ((getDir _veh) < (_veh getDir _posCatapult)) then {_veh setDir ((getDir _veh) + 0.5);_veh setVelocityModelSpace [0, (25 / 3.6), 0];} else {_veh setDir ((getDir _veh) - 0.5);_veh setVelocityModelSpace [0, (25 / 3.6), 0];};
    		sleep 0.025
    	};
    
    	_veh setVelocity [0,0,0];
    	private _memoryPos = getPosWorld _veh;
    	_veh setVariable ["memoryPos",_memoryPos];
    	_veh setVariable ["memoryDir",_dir];
    	_veh animate ["wing_fold_l", 0];
    	_veh animate ["wing_fold_r", 0];
    	_veh animate ["wing_fold_cover_l", 0];
    	_veh animate ["wing_fold_cover_r", 0];
    
    	while {(_veh distance _posCatapult) >= 1} do
    	{
    		waitUntil {(_part animationPhase (_animations select 0) < 1)};
    		_veh setAirplaneThrottle 0.3;
    		_veh setDir (_veh getDir _posCatapult);
    		_veh setVelocity [(sin (_veh getdir _posCatapult) * (25 / 3.6)),(cos (_veh getdir _posCatapult) * (25 / 3.6)),(velocity _veh select 2)];
    		if (!alive (driver _veh)) exitWith {breakto "takeOff"};
    		sleep 0.025
    	};	
    	_veh setPosWorld _posCatapult;
    	_veh setDir _dirCatapult;
    	_veh setBehaviour "AWARE";
    	_jetPark =  
    	[ 
    		(str _veh) + "_parked", "onEachFrame",  
    		{ 
    			(_this select 0) setAirplaneThrottle 0.3;
    			(_this select 0) setVelocity [0, 0, 0]; 
    			(_this select 0) setPosWorld (_this select 1);
    			(_this select 0) setDir (_this select 2); 		
    		},[_veh,_posCatapult,_dirCatapult] 
    	] call BIS_fnc_addStackedEventHandler; 
    
    	[_part, _animations, 10] spawn BIS_fnc_Carrier01AnimateDeflectors;
    
    	sleep 10;
    
    	[format ["%1",_jetPark], "onEachFrame"] call BIS_fnc_removeStackedEventHandler; 
    	_jetPark2 =
    	[ 
    		(str _veh) + "_parked", "onEachFrame",  
    		{ 
    			(_this select 0) setAirplaneThrottle 1;
    			(_this select 0) setVelocity [0, 0, 0]; 
    			(_this select 0) setPosWorld (_this select 1);
    			(_this select 0) setDir (_this select 2); 		
    		},[_veh,_posCatapult,_dirCatapult] 
    	] call BIS_fnc_addStackedEventHandler; 
    
    	sleep 5;
    
    	[format ["%1",_jetPark2], "onEachFrame"] call BIS_fnc_removeStackedEventHandler; 
    	
    	
    	_veh allowDamage false;
    	_veh setAirplaneThrottle 1; 
    	_veh setPosWorld _posCatapult;	
    	_veh setDir _dirCatapult;
    	private _velocity = 0;
    	private _timeStart = time;
    	private _timeDelta = 0;
    
    	while
    	{
    		speed _veh < _velocityLaunch && {isEngineOn _veh && {((getPos _veh) param [2,0]) < 1}}
    	}
    	do
    	{
    		if (!alive (driver _veh)) exitWith {breakto "takeOff"};
    		_veh setDir _dirCatapult;
    		_veh setAirplaneThrottle 1;
    	
    
    		_timeDelta = time - _timeStart;
    		_velocity = _velocityIncrease * _timeDelta;
    
    		_veh setVelocity [sin _dirCatapult * _velocity,cos _dirCatapult * _velocity,velocity _veh select 2];
    
    		sleep _accelerationStep;
    	};
    	
    
    	[_part, _animations, 10] spawn BIS_fnc_Carrier01AnimateDeflectors;
    
    	private _t = time + 1;
    
    	waitUntil
    	{
    		if (!alive (driver _veh)) exitWith {breakto "takeOff";true};
    		_velocity = velocity _veh;
    		_velocity set [2,2];
    
    		_veh setVelocity _velocity;
    
    		time > _t
    	};
    
    	[_part, _animations, 0] spawn
    	{
    		sleep 6;
    		_this spawn BIS_fnc_Carrier01AnimateDeflectors;
    	};
    
    	sleep 5;
    	
    	_veh allowDamage True;
    	_veh setFuel ((_veh getVariable ["savedFuel",1]) - (1 - (fuel _veh)));
    	driver _veh action ["LandGearUp", driver _veh];
    
    };
    }

     

    Sorry for being totally ignorant, but how do I get this to work?


  10. Wondering If Anyone Else Is Having This Problem.  Have Been Using LEA Load Out Editor For Arma 3For A Long Time With No Probs, But Now I Have This -filePatching Prob.  I Use Play With Six, I Unchecked The -NofilePatching But Still Have The Script Not Found Error.  If I Use ARMA Launcher With -filePatching Enabled It Works No Problem.  I Know This Is Probably A Play With Six Prob.  Just Looking For Some Help If Anyone Else Has Had This.

    Thanks

    Dan


  11. Wondering If Anyone Else Is Having This Problem.  Have Been Using LEA For A Long Time With No Probs, But Now I Have This -filePatching Prob.  I Use Play With Six, I Unchecked The -NofilePatching But Still Have The Script Not Found Error.  If I Use ARMA Launcher With -filePatching Enabled It Works No Problem.  I Know This Is Probably A Play With Six Prob.  Just Looking For Some Help If Anyone Else Has Had This.

    Thanks

    Dan


  12. Names will not change and you don't need to be grouping anything. Its likely an issue with your trigger itself. If it fires the first time are you setting it up to fire again?

    However, this is a general question rather than an Alive question. Search forums and/or post elsewhere and you'll likely get proper help.

    Thanks for your replies JCae, Delta. I did search forums first, really didnt find anything except a vehicle respawn script, but since Alive respawns it vehicles itself I was hoping for help from them. The triggers do work repeatedly until the vehicle respawns.

    Thanks Again

    Dan

×