Jump to content

[Tutorial] Disabling R3F Tow/Lift for Locked Vehicles


MrTesla

Recommended Posts

It no longer works on 1.0.4.2, I had it working fine since it was posted on every Epoch release.

ok richie, I have found out this dose work. I had a spark of an idea one day and tried this again. AT FIRST id assume you are using infiSTAR correct? you spawned in vehicles using the hive and then tested correct? Go ahead, spawn the vehicles, and then restart your server, try it again. WHAPOW it works lol. 

 

so yeah, I guess its just a little hiccup with spawn vehicles hive. But this works fine.

Link to comment
Share on other sites

  • 2 weeks later...

Ok I did this... it seems to be almost working lol.  It wont give me the option to tow/lift locked vehicles this is good. But Actually lifting and towing vehicles is a huge problem. The menu keeps popping up and going away so fast you cant mousewheel and click it in time, and unlifting something is just impossible. Same problem. The option to lift/drop vehicle flicks on and off. What did I do wrong??

Link to comment
Share on other sites

OK I Have a custom Compiles... But the way I have it set up is that in Init.sqf I call regular compiles (from dayz_Code)  Then I call custom compiles for deploy bike, bloodbag, etc. which overrides the regular compiles as it comes after.

 

Basically what I'm asking is Can I just edit Dayz_code/init/compiles.sqf to call 

 

]local_lockUnlock = compile preprocessFileLineNumbers "Custom\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle

 

 

 

I have a feeling the filepath will be really messed up and i"ll be forced to use a custom compiles. I've been staying away from "custom" compiles, fn_selfactions and all that jazz for as much as possible. Because simply overriding will make updating to new version of epoch in the future a snap.

Link to comment
Share on other sites

One does not change the bisigned pbo's (this includes all pbo's in @DayZ_Epoch\addons).

 

You are doing it right by calling your "empty/new" compiles after the default one in init.sqf, and making all the changes there.

Example:

progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";				//Compile regular functions
call compile preprocessFileLineNumbers "custom\compiles.sqf"

The way it works, is that the default compiles.sqf will process all the necessary files and your custom compiles overrides all the changes you desire.

 

So after copying local_lockUnlock.sqf from dayz_code.pbo to the mission folder and making changes, you can just call it by adding this line in custom compiles:

local_lockUnlock		= compile preprocessFileLineNumbers "custom\local_lockUnlock.sqf";		//When vehicle is local to unit perform locking vehicle
Link to comment
Share on other sites

  • 1 month later...

Are there any easy way to notify the player when a vehicle they're trying to lift, is unlocked? Instead of just removing the option?

 

Like, could I add: 

"cutText ["Vehicle is locked and cannot be towed", "PLAIN DOWN"];

somewhere to accomplish that?

Link to comment
Share on other sites

  • 1 month later...

I just dont get it. did everything from the first post (allready had custom compiles sqf) and now i can not tow/lift any vehicle. so i had to roll back the changes.

Is there any good alternative script for tow AND lift that works fine?

Or is there anything in the first post thats just wrong ?

Link to comment
Share on other sites

  • 4 weeks later...

We have been using this since 1.0.4.2 but it no longer works and it seems out of the blue that it started. We don't have any world spawn vehicles but I tried this with purchased vehicles, spawned vehicles, both of those before and after a restart and they all still lift. Same for generating a key for a mission vehicle. It shows locked but you can jump into a heli and lift it no problem. Any one else seeing this?

Link to comment
Share on other sites

Hi Guys,

 

I have been doing some testing and on a 1.0.5.1 server with 1.63 build I cannot get this work work. It looks like the local_lockUnlock.sqf does not seem todo anything

 

I added the following to see if it getting called at all and its not as the following should output lines to the log file.. I have tried 3 different ways to call the local_lockUnlock.sqf file and everything is failing.  Looking in the dayz code more it seems allot of the files are now talking about 

 

https://github.com/vbawol/DayZ-Epoch/blob/Release_1.0.5.1/SQF/dayz_code/actions/lock_veh.sqf

and

https://github.com/vbawol/DayZ-Epoch/blob/Release_1.0.5.1/SQF/dayz_code/actions/unlock_veh.sqf

 

So I wonder if this is now irrelevant !

 

anyone have any thoughts ?

private ["_vehicle","_status"];
_vehicle = _this select 0;
_status = _this select 1;


diag_log "TESTING - LOADED Local Unlock";


if (local _vehicle) then {
if(_status) then {
_vehicle setVehicleLock "LOCKED";
_vehicle setVariable ["R3F_LOG_disabled",true,true];
diag_log "TESTING - LOCKED";
} else {
_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["R3F_LOG_disabled",false,true];
diag_log "TESTING - UNLOCKED";
};
};
Link to comment
Share on other sites

I had the same issue so I just opened up heliporter.sqf and found this line

if (count _objet > 0) then

 

and changed it up like

 

if (count _objet > 0) then
{
_objet = _objet select 0;
_is_locked = locked _objet;
if(_is_locked) then { _objet setVariable ["R3F_LOG_disabled",true,true]; };
if !(_objet getVariable "R3F_LOG_disabled") then
{
 
I only did a quick fly by to test so you guys may want to do some thorough testing before throwing it on your server.
 
entire file is below
 

/**
 * Héliporte un objet avec un héliporteur
 * 
 * @param 0 l'héliporteur
 * 
 * Copyright © 2010 madbull ~R3F~
 * 
 * This program is free software under the terms of the GNU General Public License version 3.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
if (R3F_LOG_mutex_local_verrou) then
{
player globalChat STR_R3F_LOG_mutex_action_en_cours;
}
else
{
R3F_LOG_mutex_local_verrou = true;
 
private ["_heliporteur", "_objet"];
 
_heliporteur = _this select 0;
_objet = nearestObjects [_heliporteur, R3F_LOG_CFG_objets_heliportables, 20];
// Parce que l'héliporteur peut être un objet héliportable
_objet = _objet - [_heliporteur];
 
 
if (count _objet > 0) then
{
_objet = _objet select 0;
_is_locked = locked _objet;
if(_is_locked) then { _objet setVariable ["R3F_LOG_disabled",true,true]; };
if !(_objet getVariable "R3F_LOG_disabled") then
{
if (isNull (_objet getVariable "R3F_LOG_est_transporte_par")) then
{
if (count crew _objet == 0) then
{
// Si l'objet n'est pas en train d'être déplacé par un joueur
if (isNull (_objet getVariable "R3F_LOG_est_deplace_par") || (!alive (_objet getVariable "R3F_LOG_est_deplace_par"))) then
{
private ["_ne_remorque_pas", "_remorque"];
// Ne pas héliporter quelque chose qui remorque autre chose
_ne_remorque_pas = true;
_remorque = _objet getVariable "R3F_LOG_remorque";
if !(isNil "_remorque") then
{
if !(isNull _remorque) then
{
_ne_remorque_pas = false;
};
};
 
if (_ne_remorque_pas) then
{
// On mémorise sur le réseau que l'héliporteur remorque quelque chose
_heliporteur setVariable ["R3F_LOG_heliporte", _objet, true];
// On mémorise aussi sur le réseau que l'objet est attaché à un véhicule
_objet setVariable ["R3F_LOG_est_transporte_par", _heliporteur, true];
 
// Attacher sous l'héliporteur au ras du sol
_objet attachTo [_heliporteur, [
0,
0,
(boundingBox _heliporteur select 0 select 2) - (boundingBox _objet select 0 select 2) - (getPos _heliporteur select 2) + 0.5
]];
 
player globalChat format [sTR_R3F_LOG_action_heliporter_fait, getText (configFile >> "CfgVehicles" >> (typeOf _objet) >> "displayName")];
}
else
{
player globalChat format [sTR_R3F_LOG_action_heliporter_objet_remorque, getText (configFile >> "CfgVehicles" >> (typeOf _objet) >> "displayName")];
};
}
else
{
player globalChat format [sTR_R3F_LOG_action_heliporter_deplace_par_joueur, getText (configFile >> "CfgVehicles" >> (typeOf _objet) >> "displayName")];
};
}
else
{
player globalChat format [sTR_R3F_LOG_action_heliporter_joueur_dans_objet, getText (configFile >> "CfgVehicles" >> (typeOf _objet) >> "displayName")];
};
}
else
{
player globalChat format [sTR_R3F_LOG_action_heliporter_deja_transporte, getText (configFile >> "CfgVehicles" >> (typeOf _objet) >> "displayName")];
};
};
};
 
R3F_LOG_mutex_local_verrou = false;
};

Link to comment
Share on other sites

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

Hi guys.

this script is working well for me except on vehicles that have the option to be locked/unlocked. so any car that is bought from traders cannot be towed?
Does anyone have any ideas on how to fix this and is anyone else experiencing this?
 

Link to comment
Share on other sites

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

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