Jump to content
Sign in to follow this  
Von Quest

Backpacks - Parachute and Scuba Qs?

Recommended Posts

sorry to bring up this old thread but I'm trying to make a script (2 scripts currently) to attach the backpacks to the front of the player and switch animiations just like cobra4v320 has, the script that covra4v320 has made doesn't seem to want the player to attach the backpack to him and instead makes a lot of fps lag. So this is what the script should do, you walk up to something "this has an action on it" and you select Get Parachute. The script will execute and make your backpack drop and then give you a Parachute. Then the backpack on the ground will get the action to add to your hip. This seems not to work and as said before just makes a whole lot of FPS lag.

scripts\halopack.sqf

_pack = unitBackpack player;

// replace the backpack by a parachute
player addBackpack "B_Parachute";

sleep 2;
hint format["%1 %2", position _pack, position player];
sleep 1;
addeded = _pack addAction ["Attach Backpack to hip","scripts\halopack2.sqf"];

scripts\halopack2.sqf

private ["_unit","_class","_packHolder"];
_unit     = _this select 1;
_class     = _this select 0;

removeAction addeded;
player addAction ["Remove Backpack","deleteVehicle _packHolder"];

_packHolder = createVehicle ["groundWeaponHolder", [0,0,0], [], 0, "can_collide"]; //create an empty holder 
_packHolder addBackpackCargo [_class, 1]; //place your old backpack into the empty holder
_packHolder attachTo [player,[-0.1,0.72,-0.03],"pelvis"]; //attach empty holder to unit
_packHolder setVectorDirAndUp [[0,0,-1],[0,1,0]]; //set the vector and direction of the empty holder

waitUntil {animationState _unit == "HaloFreeFall_non"}; //wait for the unit to go into the HaloFreeFall_non animation
_packHolder attachTo [player,[-0.12,-0.02,-.74],"pelvis"]; //attach empty holder to unit
_packHolder setVectorDirAndUp [[0,-1,-0.05],[0,0,-1]]; //set the vector and direction of the empty holder

waitUntil {animationState _unit == "para_pilot"}; //wait for the unit to go into the para_pilot animation
_packHolder attachTo [vehicle player,[-0.07,0.67,-0.13],"pelvis"]; //attach the empty holder to the new position
_packHolder setVectorDirAndUp [[0,-0.2,-1],[0,1,0]]; //set the new vector direction

waitUntil {isTouchingGround _unit || getPos _unit select 2 < 1}; //wait until the unit is on the ground
deleteVehicle _packHolder; //delete the temp backpack and empty holder  

I know that since the backpack has the action that the _class should be instead _this select 0 and the _unit should be _this select 1 but that doesn't fix anything :/

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
Sign in to follow this  

×