Jump to content

[Release] Advanced DayZ Epoch Heli Lift


VentZer0

Recommended Posts

Yes, I did.

 

I'm not sure if it didn't work because I was trying to hook up a spawned vehicle, which isn't in the database, because it's a temporary vehicle, but I can't imagine that would prevent it from working.

any vehicle works whether its in the db or not. it just looks for the vehicle that is near the heli and if its a certain kindof vehicle.

Link to comment
Share on other sites

In order to lift you must be 5 to 15 meters (indicated altitude) over the vehicle you want to lift. Person on the ground will get the 'attach to heli' option if they look at the vehicle they want to attach to the hovering helicopter.

Link to comment
Share on other sites

Known Issues:

Sometimes the attach to option remains after you already attached a vehicle to a heli, using this option causes the attached vehicle to detach.

I dont know why this happens but I've seen this happening with the vanilla version of this HeliLift script.

 

im not sure how this script works, but im guessing your problem is that the player is inside the vehicle when you attempt to remove the action?

 

there is a known bug in arma regarding removeing actions from units inside vehicles, if this is your problem, perhaps the sollution could be to attach the action to the vehicle instead of the player?

Link to comment
Share on other sites

im not sure how this script works, but im guessing your problem is that the player is inside the vehicle when you attempt to remove the action?

 

there is a known bug in arma regarding removeing actions from units inside vehicles, if this is your problem, perhaps the sollution could be to attach the action to the vehicle instead of the player?

no. the person on the ground, who is not in any vehicle, still has the option after they already attached it to the heli.

Link to comment
Share on other sites

  • 2 weeks later...

I got this working,no problem..

But, i park a heli on top of my base, and drive my car outside. If i step out of the car, i get the "attach to heli" option, even if the heli is empty and locked. Just tested, and the car got lifted in the middle of base.

Tried looking in the files if there was a check for a pilot, but the only check i found was for heli to be above 5m, under 15m and for the car to be empty!

Am i wrong? This needs to be fixed anyways tho..

Link to comment
Share on other sites

  • 1 month later...

I have one question.

I installed it and it works perfectly

But...

is it possible, to change the need of 2 ppl to lift some vehicles to just 1ppl?

It sucks a little bit to need 2 ppl for it. Because in this case, the second guy, could also just drive the truck to the trader.

thx in advance.

Link to comment
Share on other sites

 

It is in your DAYZ_CODE.PBO in the init folder. copy "Variables.sqf and compiles.sqf" then go to the compile folder and copy fn_selfActions.sqf  to your mission folder into a folder called code then in your init.sqf change 

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; 

to

call compile preprocessFileLineNumbers "code\variables.sqf";

and 

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

to

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

lastly, in the compiles.sqf file look for 

fnc_usec_selfActions =	compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";

and change it to 

 

fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\code\fn_selfActions.sqf"; 
and then do the changes VentZer0 showed you

 

Question would it be better to leave some of these files blank and just add to them? say we go to 1.0.5.2 you would nto have to download the dayzcode and extract them again

Link to comment
Share on other sites

Question would it be better to leave some of these files blank and just add to them? say we go to 1.0.5.2 you would nto have to download the dayzcode and extract them again

I think it would be easily possible to put everything inside a single plug n play package. We'll see how it goes.

Link to comment
Share on other sites

  • 2 weeks later...

Always remember, variable which are initialized within a if clause arent supported outside of it, anyways, they are able to be changed in if clauses

 

add:

 

_lightweight = false;
_mediumweight = false;
_heavyweight = false;
_superheavyweight = false;
 
directly under:
 
_allowTow = false;
 
 
this should fix some client side issues
this defines the variables and makes them useable outside of the first if-clause
Link to comment
Share on other sites

 

Always remember, variable which are initialized within a if clause arent supported outside of it, anyways, they are able to be changed in if clauses

 

add:

 

_lightweight = false;
_mediumweight = false;
_heavyweight = false;
_superheavyweight = false;
 
directly under:
 
_allowTow = false;
 
 
this should fix some client side issues
this defines the variables and makes them useable outside of the first if-clause

 

thx for this

Link to comment
Share on other sites

Is anyone able to tell me what to do to make the light and medium weight vehicles being lifted by pilots directly?

 

So you dont need the partner at the ground for those two classes

not possible without extensive recoding

what you COULD do is make the entries for light and medium in the variables.sqf file like this :

 

//----DZE_HeliLift-----
//Carriers
DZE_HeliAllowTowFromSuperHeavy =	["CH_47F_EP1","CH_47F_BAF","CH_47F_EP1_DZ","CH_47F_EP1_DZE","CH53_DZE"];
DZE_HeliAllowTowFromHeavy =		["UH60_Base","BAF_Merlin_DZE","BAF_Merlin_HC3_D","Mi17_Base"];
DZE_HeliAllowTowFromMedium =		[];
DZE_HeliAllowTowFromLight =		[];
//Liftable Vehicles
DZE_HeliAllowToTowSuperHeavy =		["TowingTractor","GLT_M300_ST","GLT_M300_LT","LandRover_Base","UAZ_Base","ArmoredSUV_Base_PMC","SUV_Base_EP1","S1203_TK_CIV_EP1","Volha_TK_CIV_Base_EP1","VWGolf","tractor","SkodaBase","Pickup_PK_base","Offroad_DSHKM_base","Lada_base","HMMWV_Base","hilux1_civil_1_open","BTR40_base_EP1","BTR40_MG_base_EP1","M1126_ICV_M2_EP1","M1126_ICV_mk19_EP1","StrykerBase_EP1","M1126_ICV_BASE_EP1","Wheeled_APC","Truck","BAF_Jackal2_BASE_D","Ship"];
DZE_HeliAllowToTowHeavy =		["hilux1_civil_1_open","HMMWV_Base","Lada_base","Offroad_DSHKM_base","Pickup_PK_base","SkodaBase","tractor","VWGolf","Volha_TK_CIV_Base_EP1","S1203_TK_CIV_EP1","SUV_Base_EP1","ArmoredSUV_Base_PMC","UAZ_Base","LandRover_Base","GLT_M300_LT","GLT_M300_ST","ATV_US_EP1","ATV_CZ_EP1","Motorcycle","Ship","BAF_Jackal2_BASE_D"];
DZE_HeliAllowToTowMedium =		[];
DZE_HeliAllowToTowLight =		[];
//----DZE_HeliLift-----

and use a different script for those helis and vehicles

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

SUGamingNetwork,  I'm using MF-Tow and have it set so players cannot lift a vehicle that is towing or being towed.  It's a conglomeration of several of the other enhancements/additions in Matt's MF-tow thread.  Here's the tow_AttachTow.sqf.  The section in question is lines 275 - 285.  I also use =BTC=_Logistics for lifting and love it.  So you'll probably have to change "BTC_Cannot_Lift" to the appropriate variable for this lifting script.

 

/**


* mf-tow/tow_AttachTow.sqf
* The action for attaching the tow to another vehicle.
*
* Created by Matt Fairbrass (matt_d_rat)
* Version: 1.1.2
* MIT Licence
**/

private ["_vehicle","_started","_finished","_animState","_isMedic","_abort","_vehicleNameText","_towTruckNameText","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_towTruck","_towableVehicles","_towableVehiclesTotal","_vehicleOffsetY","_towTruckOffsetX","_towTruckOffsetY","_offsetZ","_hasToolbox","_searchLoc","_facing","_towTruckRelX","_towTruckRelY","_towableVehicleDir","_towTruckX","_towTruckY","_towTruckDir","_towOffset","_behind"];

if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_96") , "PLAIN DOWN"] };
DZE_ActionInProgress = true;

player removeAction s_player_towing;
s_player_towing = 1;

// Tow Truck
_towTruck = _this select 3;
_towableVehicles = [_towTruck] call MF_Tow_Towable_Array;
_towableVehiclesTotal = count (_towableVehicles);
_towTruckNameText = [_towTruck] call MF_Tow_Get_Vehicle_Name;

_towTruckX = getPosATL _towTruck select 0;
_towTruckY = getPosATL _towTruck select 1;
_towTruckDir = getDir _towTruck;

_towOffset = (boundingBox _towTruck select 1 select 1) / 2;

//_findNearestVehicles = nearestObjects [_towTruck, _towableVehicles, MF_Tow_Distance + 15];
_findNearestVehicle = [];

// select the nearest vehicle behind us
for "_i" from _towOffset to MF_Tow_Distance + _towOffset do {
_towTruckRelX = (sin (_towTruckDir + 180)) * _i;
_towTruckRelY = (cos (_towTruckDir + 180)) * _i;
_searchLoc = [_towTruckX + _towTruckRelX, _towTruckY + _towTruckRelY, 0];
_findNearestVehicles = nearestObjects [_searchLoc, _towableVehicles, 8];
{
if (alive _x && _towTruck != _x) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} foreach _findNearestVehicles;
if (count _findNearestVehicle > 0) exitWith { };
};
if(count _findNearestVehicle > 0) then {
// select the nearest one
_vehicle = _findNearestVehicle select 0;
_towableVehicleDir = getDir _vehicle;
_vehicleNameText = [_vehicle] call MF_Tow_Get_Vehicle_Name;
_hasToolbox = "ItemToolbox" in (items player);

/*
_towVector = vectorDir _towTruck;
_vehVector = vectorDir _vehicle;
_difference = (_towVector select 0) * (_vehVector select 0) + (_towVector select 1) * (_vehVector select 1);
_facing = (_difference < 1 && _difference > .93);

_towVector = vectorDir _towTruck;
_vehVector = vectorDir _vehicle;
_difference = (_towVector select 0 * _vehVector select 0) + (_towVector select 1 * _vehVector select 1);
diag_log(format ["Difference: %1", _difference]);

_facing = ((_towableVehicleDir > _towTruckDir - 25) && (_towableVehicleDir < _towTruckDir + 25));


_towableVehicleX = getPosATL _vehicle select 0;
_towableVehicleY = getPosATL _vehicle select 1;

_towableOffset = (boundingBox _vehicle select 1 select 1) / 2;
_towOffset = (boundingBox _towTruck select 1 select 1);

// TowVehicle Bounding Box
_maxTowDistance = MF_Tow_Distance + (_towableOffset * 2);

for "_i" from _towOffset to MF_Tow_Distance * 6 do {
_towTruckRelX = (sin (_towTruckDir + 180)) * _i / 8;
_towTruckRelY = (cos (_towTruckDir + 180)) * _i / 8;
_towableRelX = (sin (_towableVehicleDir)) * _i / 8;
_towableRelY = (cos (_towableVehicleDir)) * _i / 8;

_location1 = [_towTruckX + _towTruckRelX, _towTruckY + _towTruckRelY, 0];
_location2 = [_towableVehicleX + _towableRelX, _towableVehicleY + _towableRelY, 0];

//cutText [ format ["distance: %1", _location1 distance _location2], "PLAIN DOWN"];
_behind = (_location1 distance _location2 < 2);
//cutText [ format ["Distance: %1 _towableOffset: %2", (getPos _vehicle) distance _location, _towableOffset], "PLAIN DOWN"];
if (_behind) exitWith {};
};
*/

// Check the player has a toolbox
if(!_hasToolbox) exitWith {
cutText ["Cannot attach tow without a toolbox.", "PLAIN DOWN"];
};

// Check for vehicle behind tow vehicle
if(!_behind) exitWith {
cutText[ format["%1 must be behind %2 to tow.", _vehicleNameText, _towTruckNameText], "PLAIN DOWN"];
};

// Make sure towing vehicle is in front of vehicle to be towed
if(!_facing) exitWith {
cutText[ format["%1 must be facing %2 to tow.", _vehicleNameText, _towTruckNameText, _towTruckDir, _towableVehicleDir], "PLAIN DOWN"];
};

// Check if the vehicle we want to tow is locked
if((_vehicle getVariable ["MF_Tow_Cannot_Tow", false])) exitWith {
cutText [format["Cannot tow %1 because it is locked.", _vehicleNameText], "PLAIN DOWN"];
};

// Check that the vehicle we want to tow is not already being towed by something else.
if((_vehicle getVariable ["MFTowInTow", false])) exitWith {
cutText [format["Cannot tow %1 because it is already being towed by another vehicle.", _vehicleNameText], "PLAIN DOWN"];
};

// Check that the vehicle we want to tow is not already towing something else
if(!MF_Tow_Multi_Towing && (_vehicle getVariable ["MFTowIsTowing", false])) exitWith {
cutText [format["Cannot tow %1 because it is already towing another vehicle.", _vehicleNameText], "PLAIN DOWN"];
};

// Check that the vehicle we want to tow with is not already being towed
if(!MF_Tow_Multi_Towing && (_towTruck getVariable ["MFTowInTow", false])) exitWith {
cutText [format["Cannot tow %1 because %2 is already being towed.", _vehicleNameText, _towTruckNameText], "PLAIN DOWN"];
};
// Check if the vehicle has anyone in it
if ((count (crew _vehicle)) != 0) exitWith {
cutText [format["Cannot tow %1 because it has people in it.", _vehicleNameText], "PLAIN DOWN"];
};

_finished = false;

[_towTruck] call MF_Tow_Animate_Player_Tow_Action;

r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;

cutText [format["Start tow %1...", _vehicleNameText], "PLAIN DOWN"];
[player,"repair",0,false,10] call dayz_zombieSpeak;

while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};

if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};

// Check if anyone enters the vehicle while we are attaching the tow and stop the action
if ((count (crew _vehicle)) != 0) then {
cutText [format["Towing aborted because the %1 was entered by another player.", _vehicleNameText], "PLAIN DOWN"];
r_interrupt = true;
};

if (r_interrupt) then {
detach player;
r_doLoop = false;
};

sleep 0.1;
};
r_doLoop = false;

if(!_finished) then {
r_interrupt = false;

if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
_abort = true;
};

if (_finished) then {



if(((vectorUp _vehicle) select 2) > 0.5) then {
if( _towableVehiclesTotal > 0 ) then {
_towTruckOffsetX = 0;
_towTruckOffsetY = 0.8;
_vehicleOffsetY = 0.8;
_offsetZ = 0.1;

// Calculate the offset positions depending on the kind of tow truck
switch(true) do {
case (_towTruck isKindOf "ArmoredSUV_Base_PMC");
case (_towTruck isKindOf "SUV_Base_EP1") : {
_towTruckOffsetY = 0.9;
};
case (_towTruck isKindOf "UAZ_Base" && !(_vehicle isKindOf "UAZ_Base")) : {
_offsetZ = 1.8;
};
case (_towTruck isKindOf "TowingTractor") : {
_towTruckOffsetX = .3;
};
};

// Calculate the offset positions depending on the kind of vehicle
switch(true) do {
case (_vehicle isKindOf "Truck" && !(_towTruck isKindOf "Truck")) : {
_vehicleOffsetY = 0.9;
};
case (_vehicle isKindOf "C130J_US_EP1_DZ") : { // done
_vehicleOffsetY = .8;
_offsetZ = -.95;
};
case (_vehicle isKindOf "AN2_DZ") : { // done
_vehicleOffsetY = .7;
_offsetZ = -.45;
};
case (_vehicle isKindOf "CH_47F_EP1_DZE") : { // done
_vehicleOffsetY = .45;
_offsetZ = -.6;
};
case (_vehicle isKindOf "CH53_DZE") : { // done
_vehicleOffsetY = .35;
_offsetZ = -9.4;
};
case (_vehicle isKindOf "Mi17_Civilian_DZ") : {
_vehicleOffsetY = .5;
_offsetZ = -.5;
};
case (_vehicle isKindOf "UH60M_EP1_DZE") : { // done
_vehicleOffsetY = .6;
_offsetZ = -.3;
};
case (_vehicle isKindOf "UH1H_DZE") : { // done
_vehicleOffsetY = .6;
_offsetZ = -.2;
};
case (_vehicle isKindOf "UH1Y_DZE") : { // done
_vehicleOffsetY = .05;
_offsetZ = -.2;
};
case (_vehicle isKindOf "MH6J_DZ") : { // done
_vehicleOffsetY = .6;
_offsetZ = -.2;
};
case (_vehicle isKindOf "MV22_DZ") : { // done
_vehicleOffsetY = .6;
_offsetZ = -.85;
};
case (_vehicle isKindOf "UAZ_MG_CDF") : { // done
_offsetZ = -.1;
};
case (_vehicle isKindOf "UAZ_Base" && !(_towTruck isKindOf "UAZ_Base") && !(_vehicle isKindOf "UAZ_MG_CDF")) : {
_offsetZ = -1.8;
};
};

// Attach the vehicle to the tow vehicle
_vehicle attachTo [ _towTruck,
[
_towTruckOffsetX,
(boundingBox _towTruck select 0 select 1) * _towTruckOffsetY + (boundingBox _vehicle select 0 select 1) * _vehicleOffsetY,
(boundingBox _towTruck select 0 select 2) - (boundingBox _vehicle select 0 select 2) + _offsetZ
]
];

_vehicle lock true; // Disable entering the vehicle while it is in tow.
VDZE_veh_Lock = [_vehicle,true];
publicVariable "PVDZE_veh_Lock";

_vehicle setVariable ["VehicleInTow", true, true];
//Can`t sit in a car if car towing
//***only works with player who tow, help***

if !(MF_Tow_Multi_Towing_BTC) then {
_vehicle setVariable ["BTC_Cannot_Lift",true,true];
_towTruck setVariable ["BTC_Cannot_Lift",true,true];
};

_vehicle setVariable ["MFTowInTow", true, true];
_towTruck setVariable ["MFTowIsTowing", true, true];
_towTruck setVariable ["MFTowVehicleInTow", _vehicle, true];

cutText [format["%1 has been attached to %2.", _vehicleNameText, _towTruckNameText], "PLAIN DOWN"];
};
} else {
r_interrupt = false;

// if (vehicle player == player) then {
// [objNull, player, rSwitchMove,""] call RE;
// player playActionNow "stop";
// };
// _abort = true;
cutText [format["Failed to attach %1 to %2.", _vehicleNameText, _towTruckNameText], "PLAIN DOWN"];
};
};

} else {
cutText [format["No vehicles nearby to tow. Move within %1m of a vehicle.", MF_Tow_Distance], "PLAIN DOWN"];
};
DZE_ActionInProgress = false;
s_player_towing = -1;

 

 

How does this lifting script compare to =BTC=_Logisistics?  I'm always looking for a cleaner, simpler, faster way of doing things but still want some degree of realism - like a mozzie shouldn't be able to lift a Ural - LOL. Or, even worse, a bicycle shouldn't be able to tow a string of seven C130s.

Bob

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
×
×
  • Create New...