[Release] - BTC Fast Roping

Kind-Sir

OpenDayZ Rockstar!
All credit goes to =BTC= for their Fast Roping script.
Credit goes to Sabbath for his changes to make the script work on DayZ.

fastrope.png


READ THIS FIRST
========================
A pilot MUST deploy the rope BEFORE any passengers will be able to fast rope.
Gunners can NOT fast rope. I will make this an addition in the future.
Works below 20 meters, with up to 2m/s velocity in each direction. Higher values may result in player dying.
Works with the following vehicles:
MH60S, UH60M, UH1H, Mi17, AH6X, MH6J​

Installation
========================
  1. Obtain a copy of your DayZ mission file (.pbo), located in \Arma 2\MPMissions(Chernarus is dayz_1.chernarus.pbo)
  2. Unpack your .pbo file using a program such as PBOView or cPBO
  3. Create a folder called "addons" (mind the lower case)
  4. Make three new files inside "addons"
    BTC_addAction.sqf BTC_fast_roping_init.sqfBTC_functions.sqf
  5. Copy and paste the code relative to each file (located at the end of this post)
  6. Go back into the folder with the Mission.sqm, Description.ext, init.sqf
  7. Open init.sqf in a folder
  8. Add the following to the end of the file:
    Code:
     sleep 1; _fast_rope = [] execVM "addons\BTC_fast_roping_init.sqf";
  9. Pack the .pbo and upload it to your server
    !Make sure your server is off when uploading an edited .pbo file, and KEEP BACKUPS
  10. Test with a helicopter (go in as pilot, scroll)
Scripts
========================
BTC_addAction.sqf
Code:
_array = _this select 3;
_param = _array select 0;
_code  = _array select 1;
_spawn = _param spawn _code;

BTC_fast_roping_init.sqf
Code:
#include "BTC_functions.sqf"
BTC_fast_rope_h = 21; //set the allowed height limit for fast roping in meters
BTC_AI_fast_rope_on_deploy = 1; //tells ai to fast rope when deployed or told to exit
BTC_roping_chopper = ["MH60S","UH60M_EP1","UH1H_DZ","Mi17_DZ","AH6X_DZ","MH6J_DZ"]; //vehicle classnames that can use the fast rope
{
    _rope = _x addaction ["Deploy rope","addons\BTC_addAction.sqf",[[],BTC_deploy_rope],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""BTC_rope""] != ""1"" && ((getPos _target) select 2) < BTC_fast_rope_h && speed _target < 2"]; //add action to deploy the rope
    _rope = _x addaction ["Cut rope","addons\BTC_addAction.sqf",[[],BTC_cut_rope],7,true,false,"","player == driver _target && format [""%1"",_target getVariable ""BTC_rope""] == ""1"""]; //add action to cut the rope
    _out = _x addaction ["Fast rope","addons\BTC_addAction.sqf",[[player],BTC_fast_rope],7,true,false,"","player != driver _target && format [""%1"",_target getVariable ""BTC_rope""] == ""1"""]; //add action to fast rope
} foreach (nearestObjects [[3000,3000,0], BTC_roping_chopper, 50000]); //get all of the vehicles with the class names specified

BTC_functions.sqf
Code:
BTC_deploy_rope = //function to deploy the rope
{
    titleText ["Rope Deployed!","PLAIN DOWN"]; titleFadeOut 4; //tell the pilot that the rope is deployed
    _veh = vehicle player; //assign pilot's vehicle to _veh
    _veh setVariable ["BTC_rope",1,true]; //set rope as deployed
    if (BTC_AI_fast_rope_on_deploy == 1) then {_fast_rope = [_veh] spawn BTC_AI_fast_rope}; //give ai the ability to fast rope
    WaitUntil {!Alive _veh || !Alive player || (((getPos player) select 2) > BTC_fast_rope_h) || format ["%1",_veh getVariable "BTC_rope"] != "1"}; //wait until something happens to the pilot, the variable, or the helicopter
    _veh setVariable ["BTC_rope",0,true]; //rope is cut
};
BTC_cut_rope = //function to cut the rope
{
    titleText ["Rope Cut!","PLAIN DOWN"]; titleFadeOut 4; //tell the pilot that the rope is cut
    _veh = vehicle player; //assign pilot's vehicle to _veh
    _veh setVariable ["BTC_rope",0,true]; //set rope as cut
};
BTC_fast_rope = // function to fast rope
{
    _unit = player; //_this select 0; select the player
    _veh = vehicle _unit; //assign the vehicle to _veh
    _unit action ["EJECT",_veh]; //eject the unit out of the vehicle
    _unit setPos (_veh modelToWorld [2,1,-2]); //set unit's position beside the vehicle
    _unit setDir (getDir _veh - 90); //set unit facing to the heli
    if(typeOf _veh == "MH60S") then {
        _unit setPos (_veh modelToWorld[-2, 2,-2]);
        _unit setDir (getDir _veh + 90); //set unit facing to the heli
    };
    if(typeOf _veh == "MV22") then {
        _unit setPos (_veh modelToWorld[3, -1, -2]);
        _unit setDir (getDir _veh-90); //set unit facing to the heli
    };
    unassignVehicle _unit; //detach the unit from the vehicle
    _unit switchMove "LadderRifleStatic"; //switch to animation
    WaitUntil {!Alive _unit || (((getPos _unit) select 2) < 2.4)};
    if ((((getPos _veh) select 2) < BTC_fast_rope_h) && speed _veh < 20) then
    {
        _unit setVelocity [0,0,0];//make sure the unit doesn't fly or get shot into another direction
        _unit playMove "LadderRifleDownOff"; //animate the player
        if !(isPlayer _unit) then {_unit move [((getPos _unit) select 0) + 3,((getPos _unit) select 1) + 3,0];}; //lower the unit
    };
    if (((getPos _veh) select 2) > BTC_fast_rope_h) then {titleText["The chopper flew away! The rope has been cut!","PLAIN DOWN"]; titleFadeOut 4;}; //cut the rope if the heli is too high
};
BTC_AI_fast_rope =
{
    _veh = _this select 0;
    _veh flyInHeight (BTC_fast_rope_h - 2);
    _time = time + 60;
    WaitUntil {!Alive _veh || !Alive driver _veh || (((getPos _veh) select 2) <= BTC_fast_rope_h) || _time < time};
    doStop _veh;
    if (Alive _veh && Alive driver _veh && (((getPos _veh) select 2) <= (BTC_fast_rope_h + 1))) then
    {
        {
            if !(isPlayer _x) then {_fast_rope = [_x] spawn BTC_fast_rope;sleep 3;};
        } foreach assignedCargo _veh;
    };
    sleep 3;
    _veh move position _veh;
};

Planned Additions
========================
  • Set the correct position (door/exit) for the rope-exit, staying clear of aircraft (problem with MV22)
  • Prevent units from dying when fast roping from 20 or less meters
 

Attachments

  • dayz_fast_rope.zip
    15.2 KB · Views: 574
Back
Top