Jump to content
HptFw. MoinxDGamer

Script to save backpack and stuff inside

Recommended Posts

Hey friends,

 

I want to write a small script to make a player able to save his backpack (via addAction) so that he can use a parachute and after the player landed and took his parachute of he can load his backpack and continue the mission.

 

I know there already are scripts for that but:

-GOS/FSF SacVentral does not work in vehicles/planes

-HALO script contains a lot of stuff I do not need

-BackpackOnChest throws TFAR errors everytime

and

-[ACE] Chestpack somehow breaks the parachute so that it is not steerable.

 

Can you help me with that script?

Share this post


Link to post
Share on other sites

I'm using two methods:

 

1. rather for AIs, but working on player, no difficulty:

     *  don't give parachute backpack,

     *  when jumping, at desired altitude, create a parachute as vehicle (that means open) and the unit as driver,

     * once on ground, the unit/player jump out of the parachute as any other vehicle in Arma so he recovers his backpack

Script:

player setpos (getpos player vectorAdd [0,0,300]);
0= player spawn {
    _plyr = _this;
    waitUntil {sleep 0.5; getposATL _plyr #2 < 150};
    _chute = createVehicle ["Steerable_Parachute_F", getpos _plyr, [], 0, "can_collide"];
   _plyr moveInDriver _chute;
};

 

2. You can drop the backpack in a weapon holder then grab it after jump. This method allows more realistic view while jumping and player can decide when he opens chute.

Script:

 player setpos (getpos player vectorAdd [0,0,300]);
0= player spawn {
  private _plyr = _this;
  private "_whs";
  _plyr setVariable ["bpk",unitBackpack _plyr];
  _bpktype = backpack _plyr;
  if (_bpktype != "") then {
    _whs = createVehicle ["WeaponHolderSimulated_Scripted",[0,0,0],[],0,"can_collide"];
    _plyr action ["DropBag", _whs, _bpktype];
    _plyr addBackpackGlobal "B_parachute";
    waitUntil {0.5; !isNull objectParent _plyr or isTouchingGround _plyr};  
    waitUntil {0.5; isNull objectParent _plyr or isTouchingGround _plyr};
    uiSleep 0.5;
    if (!isNull _whs) then {
      _plyr action ["AddBag",objectParent (_plyr getVariable "bpk"), _bpktype];
      _plyr setVariable ["bpk",nil];
      uiSleep 3;
      deleteVehicle _whs;
    };
  };
};

 

  • Like 2

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

×