Jump to content
pierremgi

[HOW TO... SOLVED] drop a car instead of a crate with standard BI module

Recommended Posts

Hi all,

I'm frequently scripting around BI modules overriding. I scripted some "multiple bombs" + "napalm" CAS for thus who knows MGI tactical pack addon.

Today, I'd like to share a little script if you would like to drop a car (any vehicle) instead of a crate.

 

Place a BI support module (virtual drop). It should work also with a real support. Not tested.

Name it.

Don't forget the BI support requester, sync modules as usual.

 

In the BI module, write all vehicle types you want (helicopter classes existing in your cfgVehicles);

In my example, as I'm fond of UNSUNG: ["uns_ach47_m200","uns_ch47_m60_army"]

and this remark: the APEX V44 Blackfish ("B_T_VTOL_01_armed_F") is a plane but you can use it for faster drop!

 

add what you want in the crate init, for example, I like to signal the crate with smoke/flare and add virtual arsenal on it:

[_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]];

Remark: this code is for standard drop of a crate, but will be overridden with vehicle code.

 

add a simple calling code in the Vehicle init of the module (here vehicle is the helicopter, not the parcel!):

_this spawn MGI_fnc_dropVeh

with the following remark: I use to compile sqf in init.sqf:

MGI_fnc_dropVeh = compileFinal preprocessFileLineNumbers "MGI_fnc_dropVeh.sqf";

(You can also directly execVM it, writing _this execVM "MGI_fnc_dropVeh.sqf" in vehicle init of the module).

 

Now, the sqf code:

MGI_fnc_dropVeh.sqf:

Last version 03rd/08/18

_veh = _this;
if !(_veh isKindOf "uns_ach47_m200") 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;

 

Hope you'll have fun with that.:don14:

 

An adapted version is now included in the MGI advanced Modules addon.

 

 

  • Like 6

Share this post


Link to post
Share on other sites

Have this working in my mission. Only problem is, after dropping the vehicle (which btw is awesome, thanks for the script) The Heli just stays there. Using the virtual module so I expected it to return to the module location and disappear but it just hangs around.

 

When using the "B_T_VTOL_01_armed_F"  it circles the waypoint of the supply drop without returning to the modules position.

Edited by Vanished00One
More information

Share this post


Link to post
Share on other sites

Due to scenario scripts and scheduler. That works fine in Vanilla and simple scenario, that can fail if heavier.

Added some lines for deleting the virtual chopper in case of staying around.

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, pierremgi said:

Due to scenario scripts and scheduler. That works fine in Vanilla and simple scenario, that can fail if heavier.

Added some lines for deleting the virtual chopper in case of staying around.

 

I have a simple test mission set up so I can test MP and SP situation. Unfortunately it seems the new script is not dropping anything. Neither the supply ammo drop or vehicle drop deploy anything. Both vehicles are also landing at the last waypoint and not being deleted.

 

Suppy drop Virtual module set up

Player set up. Im using the BIS_fnc_addSupportLink for multiplayer/server

This is my basic set up just for testing purposes

 

This is my basic set up just for testing purposes no mods enabled

 

It does seem to work on and off. Odd behavior at times then works perfectly. I don't think there is anything wrong with the script just Arma being Arma.

Share this post


Link to post
Share on other sites
21 hours ago, Vanished00One said:

It does seem to work on and off. Odd behavior at times then works perfectly. I don't think there is anything wrong with the script just Arma being Arma.

No, Arma is OK. It's my bad trying to alter a working module "on the fly". I changed some lines. I Hope it's OK now.

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

No, Arma is OK. It's my bad trying to alter a working module "on the fly". I changed some lines. I Hope it's OK now.

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.

Share this post


Link to post
Share on other sites

Yep, two lines to be removed if the crate code for arsenal is not wanted. You can keep the smokes and flares.

The script exits if the helicopter/plane is not of the right type. If you want to drop a normal crate, just let the code exit if the type of helo doesn't meet the type(s) you declared in 2nd line (and the vehicles line in module of course). Thanks

  • Like 1

Share this post


Link to post
Share on other sites

For some reason I an get everything to work except the dropping of the car. I am using a Blackfish and its suppose to drop a tracked vehicle. When I choose the other 2 helos I have in the support module they drop a crate. The blackfish doesn't drop anything.

_veh = _this;
  if !(_veh isKindOf "B_T_VTOL_01_armed_F") exitWith {}; // optional, choose the helicopter class you want for car drop, the other ones will drop 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_APC_Tracked_01_rcws_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]]""; // optional remove the _crateCode line if you don't 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']; 
      _crate call _crateCode;                          // to be removed if the _crateCode line is removed above.
      _crate attachTo [_chute, [0, 0, 0]]; 
      waitUntil {position _crate select 2 < 3 || isNull _chute}; 
      detach _crate; 
      MGI_crate = true; 
      _chute setVelocity [0,5,0]; 
      MGI_crate = nil; 
    }; 
  }; 
"]; 
_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; 

Thanks for helping in advance,

Reed

Share this post


Link to post
Share on other sites

Working fine for me. You must have a 3 sec flight, at least, to obtain the vehicle instead of the standard crate.

If you Blackfish doesn't drop anything, check where you are running the code. You have probably one comment line remaining where they are not accepted (function placed in a trigger or else).

 

You can place a:  hint "ok" , step by step, in different lines to find where your code halts.

Share this post


Link to post
Share on other sites

Got it figured. Thanks for quick response.

 

If I wanted to have the Blackfish drop 2 prowlers, how would I do this?

 

Also sunOrMoon only returns a 1 or 0 after 1.70.

Can we get rid of that parameter and just have a chemlight yellow, yellow flare, and yellow smoke attached to supply crate when it spawns?

 

Thanks again,

Reed

Share this post


Link to post
Share on other sites

Replace the code by:
 

Spoiler



_veh = _this;
  if !(_veh isKindOf "B_T_VTOL_01_armed_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_LSV_01_armed_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 = '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 '_chute';
      for '_i' from 0 to 1 do {
        _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'];
        _crate call _crateCode;
        _crate attachTo [_chute, [0, 0, 0]];
        [_chute,_crate] spawn {
          params ['_chute','_crate'];
          waitUntil {position _crate select 2 < 3 || isNull _chute};
          detach _crate;
          _chute 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; 


 

 

Share this post


Link to post
Share on other sites

Do I still need the code in the crate init of the support module if we've added it to the .sqf file being called?

 

Thanks again,

Reed

Share this post


Link to post
Share on other sites

Yes, for normal crates. I just changed the code for vehicle. SunOrMoon still works fine but if you want something simpler and always true, just copy / paste the 4 lines about _flare and _fumi and change that also in the crate code.

Share this post


Link to post
Share on other sites

Makes since and thank you for helping. Added this script to my teams template.

Share this post


Link to post
Share on other sites
18:38:24 Error in expression < _flare = 'F_20mm_Yellow' createvehicle getPosATL _this;
      _flare attachTo [>
18:38:24   Error position: <getPosATL _this;
      _flare attachTo [>
18:38:24   Error getposatl: Type Array, expected Object

I'm getting this error

Share this post


Link to post
Share on other sites

I can't reproduce your error.

If you use my last code for vehicle or:

 [_this,{ _this addAction ["<t color='#ffff11'>Arsenal</t>", {["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]];

 

in crate init for standard crate, you will get the flare + smoke, (+ arsenal), any time, without error.

 

Did you script something else with a spawn code and some crate's position for _this instead of the crate itself?

  • Like 1

Share this post


Link to post
Share on other sites

Got it sorted. The double drop works.

 

What would be the best way for me to have the ability to choose the single APC or the Double LSV drop.

Could I just add an additional supply drop module with the APC drop code and change the kind of Blackfish so it uses a different class name?

 

This script really is awesome, used it last night in our online COOP mission.

 

Thanks,

Again

Reed

Share this post


Link to post
Share on other sites

Didn't see your last posts. Do you want to choose between one or two vehicles drop? As far as i'm using the BI module menu, the way I can suggest is to manage two different air assets for vehicle drop, say one armed for single drop, unarmed version for dual drop. (All others can be classical for crates).

 

There is no problem to change for any existing classes (within your addons possibilities) but you need for manually add it in the module and correct the script to exit or not before running the replacement code. Then, for mono/dual drop, you need an extra condition, not very difficult.

Share this post


Link to post
Share on other sites

Yes,

I would like to be able to call either a single drop or a double drop dependent on the situation. Having both available would be best.

 

I think your right. Use a different asset to determine which gets dropped. Say the BlackFish for the APC and the Huron for the double prowlers. I just didn't know if you could have 2 supply drop modules at same time.

 

I assume your code for the double drop or single drop will work fine is either module. I also like how you added the flare and smoke as default true for the double drop, how can I adjust the single drop to reflect this?

 

Thanks again for any help and awesome script.

 

Reed

Share this post


Link to post
Share on other sites

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.

 

Spoiler



_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;

 

 

Share this post


Link to post
Share on other sites

THis is awesome work.

Thank you again for accommodating my request.

Sincerely,

Reed

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites
9 hours ago, 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.

 

Ok, I will try this when I get home.

Thank You Sir

Dan

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×