Jump to content

Virtual Supply drop - Vehicle drop help

Recommended Posts

I found this script on BIS forums. It works beautifully until the vehicle, in this case a V44 Blackfish, has dropped its vehicle. It circles the drop off point. It drops the vehicle but does not return to the original spawn point of the Virtual support module and despawn. No scripting experience sorry to say. However this is exactly what I need so if someone has a fix it would be appreciated.


_veh = _this;
if !(_veh isKindOf "uns_ach47_m200") exitWith {}; // choose the helicopter class you want for car drop, the other ones will drop crates.

_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', 'uns_xm706e2', 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]]"";
      _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;
      _crate attachTo [_chute, [0, 0, 0]];
      waitUntil {position _crate select 2 < 0.5 || isNull _chute};
      detach _crate;
      _chute setVelocity [0,5,0];

_grpVeh setCurrentWaypoint _wpt;
_veh land "none";

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