Jump to content
easyeb

Paratroop with ai on map click?

Recommended Posts

Hello!

 

so, I’m looking for a lightweight, straight forward parachute script that lets you

 

1. Click map to teleport to freefall

2. Keep your backpack

3. Bring (selected) ai group members.

 

Anyone know of any good ones?

 

Now, I know there are lots of different parachute/halo-scripts, and its probably just my thick head, but I cant seem to get them to work properly (all three points in the list).

 

Any help would be much appreciated.

 

Cheers!

Share this post


Link to post
Share on other sites

I use THIS SCRIPT from @pierremgi which work flawlessly and is easy to set up.

Just choose an object in the map ( a flagpole, a PC, a static plane...whatever...) and in the init field of that object put

0 = [this,2000,90,true] execVM "MGI_HALO.sqf" 

(where 2000 is the JUMP height , 90 is the self-opening safety altitude...but you can change that if you like to suite it to your mission )

then, in the folder of your mission copy/paste this file, named MGI_HALO.sqf

Spoiler

params [["_pole",objNull,[objNull]],["_jump_alt",2000,[0]],["_jump_safety",90,[0]],["_MGI_forSquad",true,[true]]]; 
 
MGI_compHALO = compileFinal " 
  _plyr = _this; 
  MGI_fnc_orient = { 
    _obj = _this select 0; 
    _p = _this select 1; 
    _obj setVectorDirAndUp [ 
      [ 0,cos _p,sin _p], 
      [[0,-sin _p,cos _p],0] call BIS_fnc_rotateVector2D 
    ] 
  }; 
  _plyr setVariable ['bpk',unitBackpack _plyr]; 
  if (backpack _plyr != '') then { 
    _whs = createVehicle ['WeaponHolderSimulated_Scripted',getpos _plyr,[],0,'can_collide'];  
    _plyr action ['DropBag', _whs, typeOf (_plyr getVariable 'bpk')];
    ['EHid','onEachFrame', { 
      params ['_plyr','_whs'];
      call{ 
        if (stance _plyr == 'UNDEFINED') exitWith { 
          _whs attachTo [_plyr,[-0.1,-0.05,-0.7],'leaning_axis']; 
          [_whs,-180]  call MGI_fnc_orient 
        }; 
        if (stance _plyr == 'STAND') exitWith { 
          _whs  attachTo [_plyr,[-0.1,0.75,-0.05],'leaning_axis']; 
          [_whs,-90] call MGI_fnc_orient 
        }; 
      }; 
      if (isNil {_plyr getVariable ['bpk',nil]}) then { 
        ['EHid', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler 
      }; 
    },[_plyr,_whs] ] call BIS_fnc_addStackedEventHandler 
  };
"; 
 
waitUntil {time >0 && count allPlayers >0 }; 
_pole addAction ["<t color='#2222ff'>HALO jump</t>",{ 
  params ["_target","_caller","_id","_parameters"]; 
  openmap [true,false]; 
  titleText["Select Map Position", "PLAIN"]; 
  _parameters params ["_jump_alt","_jump_safety","_MGI_forSquad"]; 
  _MGI_units =  if (_MGI_forSquad) then [{(units _caller) select {local _x && alive _x &&  _x distanceSqr _caller < 100000 && isnull objectParent _x}},{[_caller]}]; 
  _parameters pushBack _MGI_units; 
  ["Jump","onMapSingleClick", { 
    0 cutText ["","black",0.01,true]; 
    params ["","_pos","","","_jump_alt","_jump_safety","","_MGI_units"]; 
    { 
      [_x,_forEachIndex,_pos,_jump_alt,_jump_safety] spawn { 
        params ["_unit","_index","_pos","_jump_alt","_jump_safety"]; 
        private ["_bpk","_bpktype","_whs","_para","_caller"];
        if (isPlayer _unit) then {
          _unit call MGI_compHALO;
        }; 
        uisleep 2; 
        _unit allowDamage false; 
        _unit setPos [(_pos select 0)-60 + random 30,(_pos select 1) -60 + random 30, (_jump_alt max 200) + (12 *_index)]; 
        waitUntil {(getpos _unit select 2) > _jump_safety -50}; 
        uisleep 0.2; 
        if (isPlayer _unit) then {
          _bpk = _unit getVariable "bpk"; 
          _bpktype = typeOf (_unit getVariable "bpk");
          _whs = objectParent _bpk;
          _unit addBackpackGlobal "B_parachute";
        }; 
        0 cutText ["","black in",1,true];
        waitUntil {(getpos _unit select 2) < ([_jump_safety max 90,_jump_safety] select (isPlayer _unit)) +20 or  (!isnull objectParent player) };
        if (!isplayer _unit) then {
          uisleep 0.8; 
          _chute = createVehicle ["Steerable_Parachute_F", getpos _unit, [], 0, "can_collide"]; 
          _unit moveInDriver _chute; 
        } else {
          _unit allowDamage true; 
          if (!isTouchingGround _unit) then { 
          _unit action ["OpenParachute", _unit];
          } 
        };
        _para = objectParent _unit;
        waitUntil {!isnull _para};
        _para allowDamage false;
        waitUntil {sleep 0.5; (isTouchingGround _unit && isNull _para) or !alive _unit}; 
        if (isPlayer _unit) then {
          _unit setVariable ["bpk",nil]; 
          waitUntil {isNull _para}; 
          disableUserInput true;
          sleep 0.5;
          detach _whs;
          if (!isNull _whs) then { 
            _unit action ["AddBag",objectParent _bpk, _bpktype];
            sleep 2; 
            disableUserInput false; 
            disableUserInput true; 
            disableUserInput false;
            deleteVehicle _whs;
          };
        } else {
          uisleep 2;
          _unit allowdamage true;
        };
      }; 
    } forEach _MGI_units; 
    openmap [false,false]; 
    ["Jump","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; 
    false 
  },_parameters] call bis_fnc_addStackedEventHandler; 
},[_jump_alt,_jump_safety,_MGI_forSquad], 5,false, true,"","vehicle _this == _this"];

 

 

DONE!!!

  • Like 1

Share this post


Link to post
Share on other sites
35 minutes ago, easyeb said:

Zagor, I could kiss you!

No problem man...glad to help....but let's leave the kiss part at the "could" stage, ok?...hahahahahha

 

edit:.... @pierremgi is the one that really deserve a big one....LOL

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

×