Jump to content

Code Dump#001(aka Gift to Eu3)


Recommended Posts

Inspired by Rykos awesome gifts to us, i spent a couple of hours making this:

FLaEs6O.png

 

The thing on the right is what you need to look at ;)

 

Vid of it, tho ropes and arma are janky as fuck and i managed to fuck up the codec to stuff is not as "smooth" as ingame.

 

Code:

/*
 * Author: Pfc.Christiansen
 * Fastrope for MELB littlebird
 *
 * Arguments:
 * 0: Unit
 *
 * Return Value:
 * NONE
 *
 * Example:
 * [this] execVM "fast_rope_MELB.sqf"
 *
 * Public: 
 */
_veh = _this select 0;
_veh setvariable ["AW_Rope_Left",[],true];
_veh setvariable ["AW_Rope_Right",[],true];
//Action Funcs
AW_fnc_Deploy_Left_Action = {
(vehicle player) call AW_fnc_Deploy_Rope_Left;
};
AW_fnc_Deploy_Right_Action = {
(vehicle player) call AW_fnc_Deploy_Rope_Right;
};
AW_fnc_Cut_Ropes_Action = {
(vehicle player) call AW_fnc_Cut_Ropes;
};
AW_fnc_Reload_Ropes_Action = {
(vehicle player) call AW_fnc_Reload_Ropes;
};
//Rope Stuff
AW_fnc_Cut_Ropes = {
private ["_veh"];
_veh = _this;
{
ropeCut [_x,0]
}forEach ropes vehicle _veh;
};
AW_fnc_Reload_Ropes = {
private ["_veh"];
_veh = _this;
{
deleteVehicle _x;
}forEach ropes vehicle _veh;
_veh setvariable ["AW_Rope_Left",[],true];
_veh setvariable ["AW_Rope_Right",[],true];
};
AW_fnc_Deploy_Rope_Left = {
private ["_veh","_fastRopePointL","_ropeLength","_RopeLeft","_RopeUnwindLeft","_ropes"];
_veh = _this;
_fastRopePointL = [-1.17,0.8,-0.04];
_ropeLength = 20;//TO BE TWEAKED
_RopeLeft = ropeCreate [_veh,_fastropePointL,0];
_RopeUnwindLeft = ropeUnwind [_RopeLeft, 2,_ropeLength];
_veh setvariable ["AW_Rope_Left","1",true];
};
AW_fnc_Deploy_Rope_Right = {
private ["_veh","_fastRopePointR","_ropeLength","_RopeRight","_RopeUnwindRight","_ropes"];
_veh = _this;
_fastRopePointR = [1.17,0.8,-0.04];
_ropeLength = 20;//TO BE TWEAKED
_RopeRight = ropeCreate [_veh,_fastRopePointR,0];
_RopeUnwindRight = ropeUnwind [_RopeRight, 2,_ropeLength];
_veh setvariable ["AW_Rope_Right","1",true];
};

//Unit Stuff

AW_fnc_Fast_Rope = {
_unit = player;
_veh = (vehicle _unit);
if (_unit == _veh) exitWith {};
_ropes = ropes vehicle _unit;
if (count _ropes == 0) exitWith {};
_rope = _ropes call BIS_fnc_selectRandom;
_zmax = 0;
_zdelta = 0.7;
_zc = _zmax;
_unit action ["eject",_veh];
sleep 0.01;
_unit switchmove "commander_apctracked3_out";
_unit setpos [(getpos _unit select 0), (getpos _unit select 1), 0 max ((getpos _unit select 2) - 3)];
while {alive _unit and (getpos _unit select 2) > 1 and (abs (speed _veh)) < 15  and _zc > -19} do {
  _unit attachTo [_rope, [0,0,_zc]];
  _zc = _zc - _zdelta;
  sleep 0.1;
};
_unit switchmove "";
detach _unit;
};
//Addaction(s)
//_veh addAction ["Deploy Rope Left", AW_fnc_Deploy_Left_Action, [], 0, false, true, "", 'driver _target == _this && count (_target getvariable ["AW_Rope_Left", []]) == 0'];
//_veh addAction ["Deploy Rope Right", AW_fnc_Deploy_Right_Action, [], 0, false, true, "", 'driver _target == _this && count (_target getvariable ["AW_Rope_Right", []]) == 0'];
//_veh addAction ["Cut Rope(s)", AW_fnc_Cut_Ropes_Action, [], 0, false, false, "", 'driver _target == _this && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 || count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0'];
//_veh addAction ["Reload Ropes", AW_fnc_Reload_Ropes_Action, [], 0, false, false, "", 'driver _target == _this && {speed _target < 1} && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 && count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0'];
//_veh addAction ["Fast Rope", AW_fnc_Fast_Rope, [], 0, false, false, "", '_this != driver vehicle _this && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 || count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0 '];
[_veh, ["Deploy Rope Left", AW_fnc_Deploy_Left_Action, [], 6, false, true, "", 'driver _target == _this && count (_target getvariable ["AW_Rope_Left", []]) == 0'] ] remoteExec ["addAction",0,TRUE];
[_veh, ["Deploy Rope Right", AW_fnc_Deploy_Right_Action, [], 5, false, true, "", 'driver _target == _this && count (_target getvariable ["AW_Rope_Right", []]) == 0'] ] remoteExec ["addAction",0,TRUE];
[_veh, ["Cut Rope(s)", AW_fnc_Cut_Ropes_Action, [], 4, false, false, "", 'driver _target == _this && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 || count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0'] ] remoteExec ["addAction",0,TRUE];
[_veh, ["Reload Ropes", AW_fnc_Reload_Ropes_Action, [], 3, false, false, "", 'driver _target == _this && {speed _target < 1} && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 && count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0'] ] remoteExec ["addAction",0,TRUE];
[_veh, ["Fast Rope", AW_fnc_Fast_Rope, [], 6, false, false, "", '_this != driver vehicle _this && count ((vehicle player) getvariable ["AW_Rope_Left", []]) != 0 || count ((vehicle player) getvariable ["AW_Rope_Right", []]) != 0 '] ] remoteExec ["addAction",0,TRUE];
Link to comment
Share on other sites

I love the idea of this. However I do have to wonder if it's better than actually landing the chopper and letting all six guys dismount at once, rather than two at a time from either side (assuming there was a fast rope on either side)?  I think it would definitely be useful if you're looking at a situation where you physically can't land the chopper on the LZ, but I'd hate to be that pilot sitting there still and level while the troops take their time dismounting.

 

Kenny, I have found an animation which might be useful for the final drop off from the rope... I'll dig it up for you.

 

-R

Link to comment
Share on other sites

Script was made cause:

 

a) I wanted to play around with ropes and just try to make this =P 

B) Intended use is to put soldiers on stuff thats not landable i.e small houses with non-flat roofs, hill sides where you cant safely balance with skids on etc... tho landing th e littlebird will always be faster, this script is for adding more insertion options.

Link to comment
Share on other sites

I love the idea of this. However I do have to wonder if it's better than actually landing the chopper and letting all six guys dismount at once, rather than two at a time from either side (assuming there was a fast rope on either side)?  I think it would definitely be useful if you're looking at a situation where you physically can't land the chopper on the LZ, but I'd hate to be that pilot sitting there still and level while the troops take their time dismounting.

 

You answered your own wonder :)

 

It's good for some roof insertions, and for dropping people into wooded areas.

 

Next up, SPIE.

 

https://upload.wikimedia.org/wikipedia/commons/5/5c/Special_Purpose_Insertion_Extraction_SPIE.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Forum Statistics

    11.1k
    Total Topics
    66.4k
    Total Posts
×
×
  • Create New...