Jump to content

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


Recommended Posts

Ive been trying to find addons to install, and everytime i run into another problem..

 

For this MF TOW i cannot find INIT.SQF in my DayZ_epoch_24.napf folder..

 

There is NO init.sqf in that file.. can anyone explain why?

 

Looking at the DayZ_Epoch_24.Napf folder in the DayZ Epoch repo you should have the files located in that folder.

 

https://github.com/vbawol/DayZ-Epoch/tree/master/Server%20Files/MPMissions/DayZ_Epoch_24.Napf

 

If you don't then you either:

  • are running an older version of the server
  • you're server host does something weird and funky and hides the init.sqf files away in a different location or hasn't granted you permission to edit.
  • or you simply haven't included them, in which case I am surprised it is even working at all.

I would recommend getting in contact with your host.

Link to comment
Share on other sites

While trying to get a heli lift script to work, I found that if you are in a heli, hovering over a vehicle, and a player on the ground selects the "Tow" option on the vehicle, the vehicle can tow a heli. I'm guessing this is not intentional?

 

*edit* Nevermind. I copied DimitriPokki's array, which included towing of helicopters. :)

Link to comment
Share on other sites

Ok i've double checked my stuff.

I cannot tow anything...nothing. I've checked the RPT and it doesn't show any log of towing load....

 

Is it?

I'm use to the other tow syste where you had to put the vehicles near one another, scroll to attach, and then drive.

 

Is this one different?

Link to comment
Share on other sites

You just look at the vehicle that you want to tow and there's a scroll menu option for towing.

 

I just want to confirm, VentZer0, you're going to be updating this so we can just put "vehicle type X" can tow "vehicle type Y" so we don't need a list of all the vehicles and what types of vehicles they can tow, right?

Link to comment
Share on other sites

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

 

Yes! This is what I did:

 

Leave this line in your init.sqf like it says:

call compile preprocessFileLineNumbers "compiles.sqf";			//Compile regular functions

in the fn_selfActions.sqf you will find this line near the top (around line 7)

private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];

add:

"_hasBlood"

after "_attached",

 

 then at line 26

 

Add:

// ------------------------------------------------------------------------Krixes Self Bloodbag Start------------------------------------------------------------------------
_mags = magazines player;


// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"custom\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};
// -------------------------------------------------------------------------Krixes Self Bloodbag End--------------------------------------------------------------------------

 

That's what got my Self Blood bag working with the towing.

Link to comment
Share on other sites

Yes! This is what I did:

 

Leave this line in your init.sqf like it says:

call compile preprocessFileLineNumbers "compiles.sqf";			//Compile regular functions

in the fn_selfActions.sqf you will find this line near the top (around line 7)

private ["_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];

add:

"_hasBlood"

after "_attached",

 

 then at line 26

 

Add:

// ------------------------------------------------------------------------Krixes Self Bloodbag Start------------------------------------------------------------------------
_mags = magazines player;


// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"custom\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};
// -------------------------------------------------------------------------Krixes Self Bloodbag End--------------------------------------------------------------------------

 

That's what got my Self Blood bag working with the towing.

 

I got blood bag to work, but my tow is still not working. When i scroll at a vehicle. It has a new choice for me. It says Save Ural (or any vehicle i try on). Does not give me the tow choice. Any ideas? Thanks for the help man. 

Link to comment
Share on other sites

 

//Towing with tow truck

/*
if(_typeOfCursorTarget == "TOW_DZE") then {
if (s_player_towing < 0) then {
if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];
} else {
s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];
};
};
} else {
player removeAction s_player_towing;
s_player_towing = -1;
};
*/
 
// MF-Tow Script by Matt Fairbrass (matt_d_rat)
call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf';

 

 

Did I add this correctly?

Link to comment
Share on other sites

meister, this is mine:
 

//Towing with tow truck
///*
//if(_typeOfCursorTarget == "TOW_DZE") then {
// if (s_player_towing < 0) then {
// if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
// s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""]; 
// } else {
// s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""]; 
// };
// };
//} else {
// player removeAction s_player_towing;
// s_player_towing = -1;
//};
//*/
// MF-Tow Script by Matt Fairbrass (matt_d_rat)
call compile preprocessFileLineNumbers 'addons\mf-tow\init.sqf';
Link to comment
Share on other sites

I wonder if it's because I have Krixes self-blood bag....

 

I use Krixes self-blood bag and MF-Tow works with it no problem. If you are using an old version of fn_selfActions.sqf then that could be the problem.

 

You just look at the vehicle that you want to tow and there's a scroll menu option for towing.

 

I just want to confirm, VentZer0, you're going to be updating this so we can just put "vehicle type X" can tow "vehicle type Y" so we don't need a list of all the vehicles and what types of vehicles they can tow, right?

 

I will be researching at the weekend a means to support specifying specific classes, or generic base classes by abstracting away the checks for typeOf and isKindOf to a generic method. I believe this should be quite simple, as all i would need to do is ensure the isKindOf method returns a string for the match rather than true so the switch statement can still work.

 

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?

 

There is a variable in MF-Tow/init.sqf which you can change which determines how far away from the target vehicle the tow truck needs to be. By default it is 10m. This may seem like a rather large number, but the nearestObjects call calculates object positions from one another based on the bounding box of the object - which on some vehicles is very inaccurate (UAZ being one of them and some aircraft). 

 

You could try updating this, but I suspect the problem is the vehicles you have or have not defined in the MF_Tow_Towable_Array function. Check for syntax errors, all it takes is a missing comma (or a comma at the end of the very last entry) to completely break the script.

 

I always use this tool: http://forums.bistudio.com/showthread.php?115352-Tool-Standalone-script-compiler-syntax-checker-for-ArmA2 for checking the syntax when changing any SQF files.

 

I got blood bag to work, but my tow is still not working. When i scroll at a vehicle. It has a new choice for me. It says Save Ural (or any vehicle i try on). Does not give me the tow choice. Any ideas? Thanks for the help man. 

 

See comment above regarding syntax errors.

 

Is it a problem if I am also running SARGE AI?

 

And is it possible to paste my files here so you can take a look?

 

I wouldn't have thought so, I run DZAI on my server and while it is not SargeAI, I haven't experienced any issues, not can foresee anything in the code that would cause incompatibility issues.

Link to comment
Share on other sites

Nice towing script - although, as mentioned a few pages ago, people can get inside towed vehicles.

 

We jumped a few players into a towed vehicle and then backed it through the walls of a test player base.  The passengers got out and were inside.  You need to change this to kick people out of a towed vehicle.

Link to comment
Share on other sites

This is exactly what i was looking for! Thanks!

 

Is there any chance we can change the color of the Attach Option to something easier to see? 

 

Like Red or Blue, if so how?

 

Thanks in advance

in the mf-tow init.sqf change this :

if(!(_cursorTarget getVariable ["MFTowInTow", false])) then {
    s_player_towing = player addAction ["Attach Tow", format["%1\tow_AttachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];				
} else {
    s_player_towing = player addAction ["Detach Tow", format["%1\tow_DetachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];			
};

into something like this :

if(!(_cursorTarget getVariable ["MFTowInTow", false])) then {
	s_player_towing = player addAction [("<t color=""#ff8500"">" + ("Attach Tow") + "</t>"), format["%1\tow_AttachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];				
} else {
	s_player_towing = player addAction [("<t color=""#0045FF"">" + ("Detach Tow") + "</t>"), format["%1\tow_DetachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];			
};

the <t color=""#hexvalue""> determines your color, check some hexadecimal webcolor library for the color you want in there.

Link to comment
Share on other sites

Nice towing script - although, as mentioned a few pages ago, people can get inside towed vehicles.

We jumped a few players into a towed vehicle and then backed it through the walls of a test player base. The passengers got out and were inside. You need to change this to kick people out of a towed vehicle.

Ahhhh.... Yep that is a problem Lol. OK will patch that exploit in the next release. Thanks for testing. That is quite a creative way of getting into someone's base :-).

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?

 

Yeah. Use the latest fn_selfactions.sqf from Epoch. Whenever there's an update, you need to start with a fresh fn_selfactions.sqf. 

Link to comment
Share on other sites

I will be researching at the weekend a means to support specifying specific classes, or generic base classes by abstracting away the checks for typeOf and isKindOf to a generic method. I believe this should be quite simple, as all i would need to do is ensure the isKindOf method returns a string for the match rather than true so the switch statement can still work.

 

Ok, sounds awesome. I took one person's array and edited it so the vehicles could tow the appropriate vehicles, but apparently I screwed something up by the time I was done, because towing stopped working, and I didn't feel like going through each line looking for the error, so I left it at the default that the user posted, which allows every vehicle to to every vehicle. I hope you can get it working so you can specify which classes can tow which classes. That would be perfect.

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...