Jump to content

=BTC=_Logistic (DayZ Epoch Version)


Torndeco

Recommended Posts

I'm trying to add the M113_UN_EP1 to the liftable script becuase no one can lift a m113 right now, the lifting hud doesn't come up and the lift option doesn't happen.  However, I can't find the right classname it is in.  Is it "Tracked"?  Where could I find that to add it or why doesn't it work?

Link to comment
Share on other sites

I'm trying to add the M113_UN_EP1 to the liftable script becuase no one can lift a m113 right now, the lifting hud doesn't come up and the lift option doesn't happen.  However, I can't find the right classname it is in.  Is it "Tracked"?  Where could I find that to add it or why doesn't it work?

 

I tried doing with adding the M113_UN_EP1 to the restriction arrays like this:

 

 

//Lift

 
BTC_lift_pilot   = [];
BTC_lift         = 1;
BTC_lifted       = 0;
BTC_lift_min_h   = 0;
BTC_lift_max_h   = 40;
BTC_lift_radius  = 5;
BTC_Liftable     = ["M113_UN_EP1","Tracked","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC","Air"];
BTC_Hud_Cond     = false;
BTC_HUD_x        = (SafeZoneW+2*SafeZoneX) + 0.045;
BTC_HUD_y        = (SafeZoneH+2*SafeZoneY) + 0.045;
[] execVM "=BTC=_Logistic\=BTC=_Lift\=BTC=_LiftInit.sqf";
 
 
//Functions
BTC_get_liftable_array =
{
    private ["_array","_chopper"];
    _chopper = _this select 0;
_array   = [];
switch (typeOf _chopper) do
{
case "AH6X_DZ"        : {_array = ["Motorcycle"];};
case "MH6J_DZ"         : {_array = ["Motorcycle"];};
case "UH1H_DZE"        : {_array = ["M113_UN_EP1","Motorcycle","Car"];};
case "UH1H_DZ"        : {_array = ["M113_UN_EP1","Motorcycle","Car"];};
case "UH1Y_DZE"        : {_array = ["M113_UN_EP1","Motorcycle","Car"];};
case "UH1Y_DZ"        : {_array = ["M113_UN_EP1","Motorcycle","Car"];};
case "UH60M_EP1_DZE"   : {_array = ["M113_UN_EP1","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC"];};
case "UH60M_EP1_DZ"   : {_array = ["M113_UN_EP1","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC"];};
case "BAF_Merlin_HC3_D": {_array = ["M113_UN_EP1","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC"];};
case "MH60S"           : {_array = ["M113_UN_EP1","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC"];};
case "BAF_Merlin_DZE": {_array = ["M113_UN_EP1","Motorcycle","Car","Truck","Wheeled_APC","Tracked_APC"];};
case "CH_47F_EP1_DZ"  :  {_array = ["M113_UN_EP1","LandVehicle"];};
case "CH_47F_EP1_DZE"  : {_array = ["M113_UN_EP1","LandVehicle"];};
case "Mi17_Civilian_DZ": {_array = ["M113_UN_EP1","LandVehicle"];};
case "Mi17_DZ"         : {_array = ["M113_UN_EP1","LandVehicle"];};
case "Mi17_DZE"        : {_array = ["M113_UN_EP1","LandVehicle"];};

 

But that isn't working either, no lift HUD shows and no option to lift when hovering the Mi17_DZE over the M113_UN_EP1.  Other vehicles lift fine.

 

Any ideas?

Link to comment
Share on other sites

Can I set this up with my own classes of vehicles?

 

 ie:

 

light choppers can lift light vehicles.. bikes atv motorcycles

 

med choppers can lift med trucks (anything up to HMMWV)

 

heavy heli can lift heavy trucks up to urals?

 

 

I really want a weight based system for realism.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hey, great script modification of the original BTC_Logistic script, exactly what I need. I have found a small issue though that I was wondering whether someone would be able to help me with?

 

On my server we use a lot of custom models, including JDog's USS Nimitz carrier (jdg_carrier). Through testing I found that I could successfully lift a vehicle on land and safely drop it onto the carrier's flight deck. However, when it came to lifting the object from the flight deck there was no option provided for me to do so.

 

Looking through the =BTC=_LiftInit.sqf file, around line 98 I saw this:

if (!isNull _cargo && _can_lift) then {
    _cargo_pos = getPosATL _cargo;
    _rel_pos   = _chopper worldToModel _cargo_pos;
    _cargo_x   = _rel_pos select 0;
    _cargo_y   = _rel_pos select 1;
    _cargo_z   = _rel_pos select 2;
};

As you can see, it's using getPosATL (above terrain level) to calculate the _cargo's relative position to the _chopper. I believe this is what is presenting the problem I am experiencing when trying to air lift objects which are above water and not land.

 

I attempted to change this to use getPosASL (see below), which did give me the lift option and displayed the green tick on the hud correctly, but when I engaged the lift, the object appeared the chopper (quite significantly). So there is something more needed which I cannot figure out.

if (!isNull _cargo && _can_lift) then {
    _cargo_pos = getPosASL _cargo;
    _rel_pos   = _chopper worldToModel _cargo_pos;
    _cargo_x   = _rel_pos select 0;
    _cargo_y   = _rel_pos select 1;
    _cargo_z   = _rel_pos select 2;
};

Is there some way to calculate the difference between getPosATL and getPosASL (assuming this is the problem)? I noticed Arma3 introduced the getPosASLW  which returns the object position height above sea surface (waves included), which sounds to me is what I need I guess. Is there something similar for Arma2?

 

Would be most grateful if anyone can assist me with this. :-)

 

 

Edit 15:36

Ok, so I managed to figure it out. I needed to make the change I had above to =BTC=_LiftInit.sqf but also in addition I missed another reference to getPosATL, this time in =BTC=_attachCargo.sqf (silly me!). So while the init script was detecting the pickup, when it came to attaching the attach script was taking the z-axis from the terrain (ie, the ocean floor), which is why the object was attached way above my chopper.

 

Edit 17:57:

Ok, so turns out there was a good reason for using getPosATL, my previous solution caused objects in some parts on land to attach themselves inside or slightly above the chopper, depending on how high you are above sea level. I have changed the script to detect whether the cargo in question is above water, and use either getPosASL or getPosATL accordingly.

 

So the full fix is the following:

 

=BTC=_attachCargo.sqf:

if ((count (crew _cargo)) == 0) then {
	BTC_lifted = 1;

	_chopper = vehicle player;
	_chopper removeAction BTC_liftActionId;

	_name_cargo  = (_this select 3) select 1;

	if(surfaceIsWater position _cargo) then {
		_cargo_pos = getPosASL _cargo;
	} else {
		_cargo_pos = getPosATL _cargo;
	};
	_rel_pos      = _chopper worldToModel _cargo_pos;
	_height       = (_rel_pos select 2) + 2.5;

	_cargo attachTo [_chopper, [0, 0, _height]];
	_chopper  setVariable ["BTC Lift Object", _cargo, true];
	vehicle player vehicleChat format ["%1 lifted", _name_cargo];
	_text_action = ("<t color=""#ED2744"">" + "Drop " + (_name_cargo) + "</t>");
	BTC_SganciaActionId = _chopper addAction [_text_action, "addons\=BTC=_Logistic\=BTC=_Lift\=BTC=_detachCargo.sqf", "", 7, false, false]; 
};

=BTC=_LiftInit.sqf:

if (!isNull _cargo && _can_lift) then {
    if(surfaceIsWater position _cargo) then {
        _cargo_pos = getPosASL _cargo;
    } else {
        _cargo_pos = getPosATL _cargo;
    };
    _rel_pos   = _chopper worldToModel _cargo_pos;
    _cargo_x   = _rel_pos select 0;
    _cargo_y   = _rel_pos select 1;
    _cargo_z   = _rel_pos select 2;
};
Edited by matt_d_rat
Link to comment
Share on other sites

  • 3 weeks later...

whenever I log in I get an error saying BTC_Hud is not found. Any ideas?

 

Is the =BTC=_Logistic folder in the root of your mission file?

 

Just asking because if it's in, for example custom\=BTC=_Logistic\, you will have to go through the files in the script changing all the file calls within them to wherever you have the script installed.

Link to comment
Share on other sites

This is instead of R3F Tow + Lift.

 

like this?

respawn = "BASE";
respawndelay = 5;
onLoadMission= "DayZ Epoch Chernarus";
OnLoadIntro = "Welcome to DayZ Epoch Chernarus";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
disabledAI = true;
disableChannels[]={0,2,6};
enableItemsDropping = 0;

briefing = 0;
debriefing = 0;

#include "=BTC=_Logistic\=BTC=_Lift\=BTC=_Hud.h"

class RscTitles {
	class BTC_Hud
	{
		idd = 1000;
		movingEnable=0;
		duration=1e+011;
		name = "BTC_Hud_Name";
		onLoad = "uiNamespace setVariable ['HUD', _this select 0];";
		controlsBackground[] = {};
		objects[] = {};
		class controls 
		{
			class Radar
			{
				type = 0;
				idc = 1001;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) - 0.1;//safezonex + 0.1;//0.9
				y = (SafeZoneH+2*SafeZoneY) - 0.15;//safezoney + 0.1;//0.85
				w = 0.3;
				h = 0.4;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "\ca\ui\data\igui_radar_air_ca.paa";
			};
			class Img_Obj
			{
				type = 0;
				idc = 1002;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) + 0.045;
				y = (SafeZoneH+2*SafeZoneY) + 0.045;
				w = 0.01;
				h = 0.01;
				font = "Zeppelin32";
				sizeEx = 0.04;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "=BTC=_Logistic\data\=BTC=_Obj.paa";
			};
			class Pic_Obj
			{
				type = 0;
				idc = 1003;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) - 0.125;
				y = (SafeZoneH+2*SafeZoneY) - 0.23;
				w = 0.1;
				h = 0.1;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
			class Arrow
			{
				type = 0;
				idc = 1004;
				style = 48;
				x = (SafeZoneW+2*SafeZoneX) + 0.15;
				y = (SafeZoneH+2*SafeZoneY) - 0.15;
				w = 0.05;
				h = 0.05;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
			class Type_Obj
			{
				type = 0;
				idc = 1005;
				style = 0x00;
				x = (SafeZoneW+2*SafeZoneX) - 0.03;
				y = (SafeZoneH+2*SafeZoneY) - 0.335;
				w = 0.3;
				h = 0.3;
				font = "Zeppelin32";
				sizeEx = 0.03;
				colorBackground[] = {0, 0, 0, 0};
				colorText[] = {1, 1, 1, 1};
				text = "";
			};
		};   
	};
	class ExampleTitle {     
		idd = -1; 
		duration = 10; //show for 10 seconds 
		class controls 
		{ 
			class ExampleControl 
			{
				idc = -1; 
				type = 0; 
				style = 2; //centre text 
				x = safeZoneX + safeZoneW - 0.6 * 3 / 4;  
				y = safeZoneY + safeZoneH - 0.6; 
				h = 0.6; 
				w = 0.6 * 3 / 4; //w == h 
				font = "EtelkaNarrowMediumPro"; 
				sizeEx = 0.03; 
				colorBackground[] = {1,1,0,1}; //yellow background 
				colorText[] = {0,0,1,1}; //blue text 
				text = "Bottom Right Corner Square Box"; 
			};
		};
	};
};

onPauseScript = "";
loadScreen = "\z\addons\dayz_code\gui\dayz_logo_ca.paa";

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