Jump to content

MF-Tow (a towing script for DayZ Epoch mod)


Recommended Posts

Make a fresh install and follow the install instruction to the letter! You didn't even bother to understand what I wrote at first, to check if the paths to files are set correctly.

If you do it, you'll get it working. 

So far you have had problems installing 3 different addons, because you failed to understand instructions. I'm not sure how you'll do with harder addons, as these 3 were pretty easy.

I'll give you 3 pro-tips from a noob like me:
1) Read the bloody manual and follow it to the letter. If it still doesn't work, check 3 times if you have done as the manual says.
2) If the above fails, use this forum (or opendayz.net) and read every god damn post there is about the addon you have a problem with.
3) If the above fails ask for help.

This way you'll avoid making people frustrated and amused at the same time, proving your inability to read and search (and make your own research).

I'm not writing this to pick on you or be rude. I'm trying to make you realise you can do it yourself IF you read&understand basic instructions.

Peace     

Link to comment
Share on other sites

iskindof uses boolean, it checks if an object is part of a class

for instance

_cursortarget iskindof "air" : returns true if _cursortarget is an airvehicle ... all of them
_cursortarget iskindof "mv22" : returns true if _cursortarget is a MV22 or MV22_DZ because MV22 is the Superclass for MV22_DZ
_cursortarget iskindof "mv22_dz" : returns ONLY if _cursortaget is the MV22_DZ

http://browser.six-projects.net/cfg_vehicles

https://community.bistudio.com/wiki/ArmA_2:_CfgVehicles

might help with determining the classes of certain vehicles ^^

by the way :

http://pastebin.com/L2n1mi38

all vehicles, except Tanks are in this file and they are able to tow vehicles which are reasonable/realistic instead of a one size fits all approach.

123kb have fun

 

can you please help me put this in, it is confusing me as my INIT looks completely differnt lol.

 

Thanks :)

Link to comment
Share on other sites

What do you want to add from this post?
Vehicle list?

If you have the latest version of MF-TOW (I assume you have), then it's the simplest copy and paste ever. Open the init.sqf and paste the list. Save and you're done. Or have a look at the init.sqf I pasted below

/**
 * mf-tow/init.sqf
 * The main script for initalising towing functionality. 
 *
 * Created by Matt Fairbrass (matt_d_rat)
 * Version: 1.1.2
 * MIT Licence
 **/
 
private ["_cursorTarget", "_towableVehicles", "_towableVehiclesTotal"];
 
// Public variables
MF_Tow_Base_Path = "mf-tow"; // The base path to the MF-Tow Folder.
MF_Tow_Distance = 10; // Minimum distance (in meters) away from vehicle the tow truck must be to tow.
MF_Tow_Multi_Towing = false; // Allow a vehicle which is towing another vehicle already to be towed by another tow. Disabled by default.
 
// Functions
 
/**
 * Returns an array of towable objects which can be pulled by the tow truck.
 * Configure this as required to set which vehicles can pull which types of other vehicles.
 **/
MF_Tow_Towable_Array =
{
    private ["_array","_towTruck"];
    _towTruck = _this select 0;
_array = [];
 
switch (typeOf _towTruck) do
{
//------------------------------------
//PASTE THE LIST IN HERE
//------------------------------------
};
_array
};
 
/**
 * Animate the player in a towing action, whilst attaching them to the tow vehicle to ensure safety.
 **/
MF_Tow_Animate_Player_Tow_Action =
{
private ["_towTruck","_offsetZ"];
_towTruck = _this select 0;
_offsetZ = 0.1;
 
// Bounding box on UAZ is screwed, offset z-axis correctly
if(_towTruck isKindOf "UAZ_Base") then {
_offsetZ = 1.8;
};
 
[player,20,true,(getPosATL player)] spawn player_alertZombies; // Alert nearby zombies
[1,1] call dayz_HungerThirst; // Use some hunger and thirst to perform the action
 
// Attach the player to the tow truck temporarily for safety so that they aren't accidentally hit by the vehicle when it gets attached
player attachTo [_towTruck, 
[
(boundingBox _towTruck select 1 select 0),
(boundingBox _towTruck select 0 select 1) + 1,
(boundingBox _towTruck select 0 select 2) - (boundingBox player select 0 select 2) + _offsetZ
]
];
 
player setDir 270;
player setPos (getPos player);
player playActionNow "Medic"; // Force the animation
};
 
MF_Tow_Get_Vehicle_Name =
{
private ["_vehicle", "_configVeh", "_vehicleName"];
_vehicle = _this select 0;
 
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_vehicleName = getText(_configVeh >> "displayName");
 
_vehicleName
};
 
// Initialise script
_cursorTarget = cursorTarget;
_towableVehicles = [_cursorTarget] call MF_Tow_Towable_Array;
_towableVehiclesTotal = count (_towableVehicles);
 
// Add the action to the players scroll wheel menu if the cursor target is a vehicle which can tow.
if(_towableVehiclesTotal > 0) then {
if (s_player_towing < 0) then {
if(!(_cursorTarget getVariable ["MFTowIsTowing", false])) then {
s_player_towing = player addAction [("<t color="#33ff00"">" + ("Attach Tow") + "</t>"), format["%1\tow_AttachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "","];
} else {
s_player_towing = player addAction [("<t color="#ff3333"">" + ("Detach Tow") + "</t>"), format["%1\tow_DetachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "","];
};
};
else {
player removeAction s_player_towing;
s_player_towing = -1;
};


 

Link to comment
Share on other sites

May a little problem.

 

I've installed the mod - working great so far. My problem is that I still have the "Tow..." Option  of the built in script of Epoch.

May I must comment out some more line in fn_selfaction?

 

thanks in advance

Link to comment
Share on other sites

This is weird... What kind of server host do you have? Some hosts provide preconfigured server packs with R3F logistics. Which means this "Tow..." option that you mentioned above looks like it's from R3F.
And it is definitely from R3F if after pressing "Tow..." you get option on other cars like "...tow to this vehicle" (or something like that).
Look inside your mission.pbo if you have R3F folder in it.

Link to comment
Share on other sites

Paste your init.sqf here :)

You gotta delete/comment it out from your init.sqf, however I don't remember where it's placed, so I'd need your init file.
And later on you have to delete R3F folder, for it is taking space and making the mission.pbo heavier.

 

Oh, I see now. You need a "load in" functionality in R3F without it's towing function. That needs to be disabled from R3F's init.sqf as well, but I'm not sure where exactly. 
I might have a look at it tommorow. It's 1am where I live :D so it's a sleepy time

Link to comment
Share on other sites

Ok, I scanned through R3F files, and I can't help you that much as I don't know french :D

There actually is an init.sqf inside here:
R3F_ARTY_AND_LOG\R3F_LOG\init.sqf

And inside it look for:

R3F_LOG_FNCT_objet_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\objet_init.sqf";
R3F_LOG_FNCT_heliporteur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\heliporteur\heliporteur_init.sqf";
R3F_LOG_FNCT_remorqueur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\remorqueur\remorqueur_init.sqf";
R3F_LOG_FNCT_transporteur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\transporteur\transporteur_init.sqf";

These lines call for others init.files within the R3F addon. My best bet is that 'remorqueur_init.sqf' is responsible for towing in R3F. So you should comment it out. Comment out everything that has 'remorqueur' in it :D

Then see if it gives you any RPT errors.

Link to comment
Share on other sites

Ok, I scanned through R3F files, and I can't help you that much as I don't know french :D

There actually is an init.sqf inside here:

R3F_ARTY_AND_LOG\R3F_LOG\init.sqf

And inside it look for:

R3F_LOG_FNCT_objet_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\objet_init.sqf";
R3F_LOG_FNCT_heliporteur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\heliporteur\heliporteur_init.sqf";
R3F_LOG_FNCT_remorqueur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\remorqueur\remorqueur_init.sqf";
R3F_LOG_FNCT_transporteur_init = compile preprocessFile "addons\R3F_ARTY_AND_LOG\R3F_LOG\transporteur\transporteur_init.sqf";

These lines call for others init.files within the R3F addon. My best bet is that 'remorqueur_init.sqf' is responsible for towing in R3F. So you should comment it out. Comment out everything that has 'remorqueur' in it :D

Then see if it gives you any RPT errors.

works very well  thank you :)

but no I decided to completely delete the R3F scripts. :lol:

towing and deployable vehicle is more than enough :-) anyway - thank you for your effort Bambit

Link to comment
Share on other sites

FIX BY F507DMT:

 

In init.sqf new if(!(_cursorTarget getVariable ["MFTowInTow", false])) then {

	if(_towableVehiclesTotal > 0) then {
	if (s_player_towing < 0) then {
		if(!(_cursorTarget getVariable ["MFTowIsTowing", false])) then {
					if(!(_cursorTarget getVariable ["MFTowInTow", false])) then {
			s_player_towing = player addAction [("<t color=""#dddd00"">" + ("Буксировать ближайшую технику...") +"</t>"), format["%1\tow_AttachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];
					};			
		} else {
			s_player_towing = player addAction [("<t color=""#dddd00"">" + ("Убрать сцепку...") +"</t>"), format["%1\tow_DetachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];	
				
		};
	};
} 
else {
	player removeAction s_player_towing;
	s_player_towing = -1;
};

In tow_AttachTow.sqf fix !(MF_Tow_Multi_Towing)

 

// Check that the vehicle we want to tow is not already towing something else
if(!(MF_Tow_Multi_Towing) && (_vehicle getVariable ["MFTowIsTowing", false])) exitWith {

new cutText [format["Start tow %1...", _vehicleNameText], "PLAIN DOWN"];

	r_doLoop = true;
	_started = false;
	
	cutText [format["Start tow %1...", _vehicleNameText], "PLAIN DOWN"];
		
	while {r_doLoop} do {
		_animState = animationState player;
		_isMedic = ["medic",_animState] call fnc_inString;

in tow_DetachTow.sqf

new:

//force save
PVDZE_veh_Update = [_vehicle, "all"];
publicVariableServer "PVDZE_veh_Update";
//force save

 
if (_finished) then {


//force save
PVDZE_veh_Update = [_vehicle, "all"];
publicVariableServer "PVDZE_veh_Update";
//force save


detach _vehicle;

and u have HUGE f BAG!!!

video later

Link to comment
Share on other sites

Is there a way that I can have this mod and also Krixes Self Bloodbag?

 

 

I did everything in the instructions. But in my scroll menu at a vehicle. It just says (Save Ural [or whatever vehicle i choose]). Any ideas?

I got both and they work 100% fine together. Just double and triple check you got absolutely everything done right for both mods and you should be fine.

Link to comment
Share on other sites

Nice fix, I added some of the stuff you mentioned. But in my version you cant jump in to a vehicle that is being towed. I don't know why you can in yourse, sounds weird.

 

Also, I fixed so that you don't get teleported to the other side of the car when towing because it can be used for bugging in to buildings.

Find these in Init.sqf and remove or comment them out.

player setDir 270;
player setPos (getPos player);
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...