Jump to content
  • 0
Darth_Rogue

[SOLVED]R3F disable lift and tow for locked vehicles

Question

Title says it all.  Anyone wanna help me take a crack at it?  We would be releasing the edits once we get it working.

 

Update 5/21 - This is now working on locked vehicles.  Replace your surveiller_conditions_actions_menu.sqf file contents with this:

 


 /*
* Evalue régulièrement les conditions à vérifier pour autoriser les actions logistiques
 * Permet de diminuer la fréquence des vérifications des conditions normalement faites
 * dans les addAction (~60Hz) et donc de limiter la consommation CPU.
 * 
 * Copyright (C) 2014 Team ~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/>.
 */

private ["_joueur", "_vehicule_joueur", "_cursorTarget_distance", "_objet_pointe", "_objet_pas_en_cours_de_deplacement", "_fonctionnalites", "_pas_de_hook"];
private ["_objet_deverrouille", "_objet_pointe_autre_que_deplace", "_objet_pointe_autre_que_deplace_deverrouille", "_isUav", "_usine_autorisee_client"];

// Indices du tableau des fonctionnalités retourné par R3F_LOG_FNCT_determiner_fonctionnalites_logistique
#define __can_be_depl_heli_remorq_transp 0
#define __can_be_moved_by_player 1
#define __can_lift 2
#define __can_be_lifted 3
#define __can_tow 4
#define __can_be_towed 5
#define __can_transport_cargo 6
#define __can_transport_cargo_cout 7
#define __can_be_transported_cargo 8
#define __can_be_transported_cargo_cout 9

sleep 2;

while {true} do
{
_joueur = player;
_vehicule_joueur = vehicle _joueur;

_cursorTarget_distance = call R3F_LOG_FNCT_3D_cursorTarget_distance_bbox;
_objet_pointe = _cursorTarget_distance select 0;


_isNOTlocked = locked _objet_pointe < 2;


if (call compile R3F_LOG_CFG_string_condition_allow_logistics_on_this_client &&
!R3F_LOG_mutex_local_verrou && _vehicule_joueur == _joueur && !isNull _objet_pointe && _cursorTarget_distance select 1 < 3.75
) then
{
R3F_LOG_objet_addAction = _objet_pointe;

_fonctionnalites = _objet_pointe getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log];

_objet_pas_en_cours_de_deplacement = (isNull (_objet_pointe getVariable ["R3F_LOG_est_deplace_par", objNull]) ||
{(!alive (_objet_pointe getVariable "R3F_LOG_est_deplace_par")) || (!isPlayer (_objet_pointe getVariable "R3F_LOG_est_deplace_par"))});

_isUav =  (getNumber (configFile >> "CfgVehicles" >> (typeOf _objet_pointe) >> "isUav") == 1);

_usine_autorisee_client = call compile R3F_LOG_CFG_string_condition_allow_creation_factory_on_this_client;

// L'objet est-il déverrouillé
_objet_deverrouille = !([_objet_pointe, _joueur] call R3F_LOG_FNCT_objet_est_verrouille);

// Trouver l'objet pointé qui se trouve derrière l'objet en cours de déplacement
_objet_pointe_autre_que_deplace = [R3F_LOG_joueur_deplace_objet, 3.75] call R3F_LOG_FNCT_3D_cursorTarget_virtuel;

if (!isNull _objet_pointe_autre_que_deplace) then
{
// L'objet (pointé qui se trouve derrière l'objet en cours de déplacement) est-il déverrouillé
_objet_pointe_autre_que_deplace_deverrouille = !([_objet_pointe_autre_que_deplace, _joueur] call R3F_LOG_FNCT_objet_est_verrouille);
};

// Si l'objet est un objet déplaçable
if (_fonctionnalites select __can_be_moved_by_player) then
{
// Condition action deplacer_objet
R3F_LOG_action_deplacer_objet_valide = (count crew _objet_pointe == 0 || _isUav) && (isNull R3F_LOG_joueur_deplace_objet) &&
_objet_pas_en_cours_de_deplacement && isNull (_objet_pointe getVariable "R3F_LOG_est_transporte_par") && _isNOTlocked &&
_objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");

// Condition action revendre_usine_deplace
R3F_LOG_action_revendre_usine_deplace_valide = _usine_autorisee_client && R3F_LOG_CFG_CF_sell_back_bargain_rate != -1 && _isNOTlocked &&
_objet_pointe getVariable ["R3F_LOG_CF_depuis_usine", false] && (count crew _objet_pointe == 0 || _isUav) &&
(R3F_LOG_joueur_deplace_objet == _objet_pointe) && !(_objet_pointe getVariable "R3F_LOG_disabled") && !isNull _objet_pointe_autre_que_deplace &&
{
!(_objet_pointe_autre_que_deplace getVariable ["R3F_LOG_CF_disabled", true]) &&
_objet_pointe_autre_que_deplace getVariable ["R3F_LOG_CF_side_addAction", side group _joueur] == side group _joueur && 
(abs ((getPosASL _objet_pointe_autre_que_deplace select 2) - (getPosASL player select 2)) < 2.5) && _isNOTlocked &&
alive _objet_pointe_autre_que_deplace && (vectorMagnitude velocity _objet_pointe_autre_que_deplace < 6)
};
};



// Si l'objet est un objet remorquable
if (_fonctionnalites select __can_be_towed) then
{
// Et qu'il est déplaçable
if (_fonctionnalites select __can_be_moved_by_player) then
{
// Condition action remorquer_deplace
R3F_LOG_action_remorquer_deplace_valide = !(_objet_pointe getVariable "R3F_LOG_disabled") && (count crew _objet_pointe == 0 || _isUav) && _isNOTlocked &&
(R3F_LOG_joueur_deplace_objet == _objet_pointe) && !isNull _objet_pointe_autre_que_deplace && 
{
(_objet_pointe_autre_que_deplace getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_tow) && alive _objet_pointe_autre_que_deplace && _isNOTlocked &&
isNull (_objet_pointe_autre_que_deplace getVariable "R3F_LOG_est_transporte_par") && isNull (_objet_pointe_autre_que_deplace getVariable "R3F_LOG_remorque") &&
(vectorMagnitude velocity _objet_pointe_autre_que_deplace < 6) &&
_objet_pointe_autre_que_deplace_deverrouille && !(_objet_pointe_autre_que_deplace getVariable "R3F_LOG_disabled")
};
};

// Condition action selectionner_objet_remorque
R3F_LOG_action_remorquer_direct_valide = (count crew _objet_pointe == 0 || _isUav) && isNull R3F_LOG_joueur_deplace_objet && _isNOTlocked &&
isNull (_objet_pointe getVariable "R3F_LOG_est_transporte_par") && isNull (_objet_pointe getVariable ["R3F_LOG_remorque", objNull]) &&
_objet_pas_en_cours_de_deplacement && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled") &&
{
{
_x != _objet_pointe && (_x getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_tow) &&
alive _x && isNull (_x getVariable "R3F_LOG_est_transporte_par") &&
isNull (_x getVariable "R3F_LOG_remorque") && (vectorMagnitude velocity _x < 6) && locked _x < 2 &&
!([_x, _joueur] call R3F_LOG_FNCT_objet_est_verrouille) && !(_x getVariable "R3F_LOG_disabled") &&
{
private ["_delta_pos"];

_delta_pos =
(
_objet_pointe modelToWorld
[
boundingCenter _objet_pointe select 0,
boundingBoxReal _objet_pointe select 1 select 1,
boundingBoxReal _objet_pointe select 0 select 2
]
) vectorDiff (
_x modelToWorld
[
boundingCenter _x select 0,
boundingBoxReal _x select 0 select 1,
boundingBoxReal _x select 0 select 2
]
);

// L'arrière du remorqueur est proche de l'avant de l'objet pointé
abs (_delta_pos select 0) < 3 && abs (_delta_pos select 1) < 5
}
} count (nearestObjects [_objet_pointe, ["All"], 30]) != 0
};

// Condition action detacher
R3F_LOG_action_detacher_valide = (isNull R3F_LOG_joueur_deplace_objet) && _isNOTlocked &&
!isNull (_objet_pointe getVariable "R3F_LOG_est_transporte_par") && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");
};

// Si l'objet est un objet transportable
if (_fonctionnalites select __can_be_transported_cargo) then
{
// Et qu'il est déplaçable
if (_fonctionnalites select __can_be_moved_by_player) then
{
// Condition action charger_deplace
R3F_LOG_action_charger_deplace_valide = (count crew _objet_pointe == 0 || _isUav) && (R3F_LOG_joueur_deplace_objet == _objet_pointe) &&
!(_objet_pointe getVariable "R3F_LOG_disabled") && !isNull _objet_pointe_autre_que_deplace && _isNOTlocked &&
{
(_objet_pointe_autre_que_deplace getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_transport_cargo) &&
(abs ((getPosASL _objet_pointe_autre_que_deplace select 2) - (getPosASL player select 2)) < 2.5) && _isNOTlocked &&
alive _objet_pointe_autre_que_deplace && (vectorMagnitude velocity _objet_pointe_autre_que_deplace < 6) &&
_objet_pointe_autre_que_deplace_deverrouille && !(_objet_pointe_autre_que_deplace getVariable "R3F_LOG_disabled")
};
};

// Condition action selectionner_objet_charge
R3F_LOG_action_selectionner_objet_charge_valide = (count crew _objet_pointe == 0 || _isUav) && isNull R3F_LOG_joueur_deplace_objet &&
isNull (_objet_pointe getVariable "R3F_LOG_est_transporte_par") && _isNOTlocked &&
_objet_pas_en_cours_de_deplacement && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");
};

// Si l'objet est un véhicule remorqueur
if (_fonctionnalites select __can_tow) then
{
// Condition action remorquer_deplace
R3F_LOG_action_remorquer_deplace_valide = (alive _objet_pointe) && (!isNull R3F_LOG_joueur_deplace_objet) &&
!(R3F_LOG_joueur_deplace_objet getVariable "R3F_LOG_disabled") && (R3F_LOG_joueur_deplace_objet != _objet_pointe) &&
(R3F_LOG_joueur_deplace_objet getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_be_towed) &&
isNull (_objet_pointe getVariable "R3F_LOG_est_transporte_par") && _isNOTlocked &&
isNull (_objet_pointe getVariable "R3F_LOG_remorque") && (vectorMagnitude velocity _objet_pointe < 6) &&  
_objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");
};

// Si l'objet est un véhicule transporteur
if (_fonctionnalites select __can_transport_cargo) then
{
// Condition action charger_deplace
R3F_LOG_action_charger_deplace_valide = alive _objet_pointe && (!isNull R3F_LOG_joueur_deplace_objet) &&
!(R3F_LOG_joueur_deplace_objet getVariable "R3F_LOG_disabled") && (R3F_LOG_joueur_deplace_objet != _objet_pointe) && _isNOTlocked &&
(R3F_LOG_joueur_deplace_objet getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_be_transported_cargo) && 
(vectorMagnitude velocity _objet_pointe < 6) && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");

// Condition action charger_selection
R3F_LOG_action_charger_selection_valide = alive _objet_pointe && (isNull R3F_LOG_joueur_deplace_objet) &&
(!isNull R3F_LOG_objet_selectionne) && (R3F_LOG_objet_selectionne != _objet_pointe) &&
!(R3F_LOG_objet_selectionne getVariable "R3F_LOG_disabled") && _isNOTlocked &&
(R3F_LOG_objet_selectionne getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_be_transported_cargo) &&
(vectorMagnitude velocity _objet_pointe < 6) && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");

// Condition action contenu_vehicule
R3F_LOG_action_contenu_vehicule_valide = alive _objet_pointe && (isNull R3F_LOG_joueur_deplace_objet) && _isNOTlocked &&
(vectorMagnitude velocity _objet_pointe < 6) && _objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");
};

// Condition action ouvrir_usine
R3F_LOG_action_ouvrir_usine_valide = _usine_autorisee_client && isNull R3F_LOG_joueur_deplace_objet &&
!(_objet_pointe getVariable "R3F_LOG_CF_disabled") && alive _objet_pointe && 
_objet_pointe getVariable ["R3F_LOG_CF_side_addAction", side group _joueur] == side group _joueur;

// Condition action revendre_usine_deplace
R3F_LOG_action_revendre_usine_deplace_valide = _usine_autorisee_client && R3F_LOG_CFG_CF_sell_back_bargain_rate != -1 && alive _objet_pointe &&
(!isNull R3F_LOG_joueur_deplace_objet) && R3F_LOG_joueur_deplace_objet getVariable ["R3F_LOG_CF_depuis_usine", false] &&
!(R3F_LOG_joueur_deplace_objet getVariable "R3F_LOG_disabled") && (R3F_LOG_joueur_deplace_objet != _objet_pointe) &&
(vectorMagnitude velocity _objet_pointe < 6) && !(_objet_pointe getVariable "R3F_LOG_CF_disabled") && 
_objet_pointe getVariable ["R3F_LOG_CF_side_addAction", side group _joueur] == side group _joueur;

// Condition action revendre_usine_selection
R3F_LOG_action_revendre_usine_selection_valide = _usine_autorisee_client && R3F_LOG_CFG_CF_sell_back_bargain_rate != -1 && alive _objet_pointe &&
(isNull R3F_LOG_joueur_deplace_objet) && R3F_LOG_objet_selectionne getVariable ["R3F_LOG_CF_depuis_usine", false] && 
(!isNull R3F_LOG_objet_selectionne) && (R3F_LOG_objet_selectionne != _objet_pointe) && !(R3F_LOG_objet_selectionne getVariable "R3F_LOG_disabled") &&
(vectorMagnitude velocity _objet_pointe < 6) && !(_objet_pointe getVariable "R3F_LOG_CF_disabled") &&
_objet_pointe getVariable ["R3F_LOG_CF_side_addAction", side group _joueur] == side group _joueur;

// Condition action revendre_usine_direct
R3F_LOG_action_revendre_usine_direct_valide = _usine_autorisee_client && R3F_LOG_CFG_CF_sell_back_bargain_rate != -1 &&
_objet_pointe getVariable ["R3F_LOG_CF_depuis_usine", false] && (count crew _objet_pointe == 0 || _isUav) && _isNOTlocked &&
isNull R3F_LOG_joueur_deplace_objet && isNull (_objet_pointe getVariable ["R3F_LOG_est_transporte_par", objNull]) &&
_objet_pas_en_cours_de_deplacement &&
{
_objet_pointe distance _x < 20 && !(_x getVariable "R3F_LOG_CF_disabled") && _isNOTlocked &&
_x getVariable ["R3F_LOG_CF_side_addAction", side group _joueur] == side group _joueur
} count R3F_LOG_CF_liste_usines != 0;

// Condition déverrouiller objet
R3F_LOG_action_deverrouiller_valide = _objet_pas_en_cours_de_deplacement && !_objet_deverrouille && !(_objet_pointe getVariable "R3F_LOG_disabled");
}
else
{
R3F_LOG_action_deplacer_objet_valide = false;
R3F_LOG_action_remorquer_direct_valide = false;
R3F_LOG_action_detacher_valide = false;
R3F_LOG_action_selectionner_objet_charge_valide = false;
R3F_LOG_action_remorquer_deplace_valide = false;
R3F_LOG_action_charger_deplace_valide = false;
R3F_LOG_action_charger_selection_valide = false;
R3F_LOG_action_contenu_vehicule_valide = false;
R3F_LOG_action_ouvrir_usine_valide = false;
R3F_LOG_action_selectionner_objet_revendre_usine_valide = false;
R3F_LOG_action_revendre_usine_direct_valide = false;
R3F_LOG_action_revendre_usine_deplace_valide = false;
R3F_LOG_action_revendre_usine_selection_valide = false;
R3F_LOG_action_deverrouiller_valide = false;
};

// Si le joueur est pilote dans un héliporteur
if (call compile R3F_LOG_CFG_string_condition_allow_logistics_on_this_client &&  _isNOTlocked &&
!R3F_LOG_mutex_local_verrou && _vehicule_joueur != _joueur && driver _vehicule_joueur == _joueur && {_vehicule_joueur getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_lift}
) then
{
R3F_LOG_objet_addAction = _vehicule_joueur;

// Note : pas de restriction liée à R3F_LOG_proprietaire_verrou pour l'héliportage

// A partir des versions > 1.32, on interdit le lift si le hook de BIS est utilisé
if (productVersion select 2 > 132) then
{
// Call compile car la commande getSlingLoad n'existe pas en 1.32
_pas_de_hook = _vehicule_joueur call compile format ["isNull getSlingLoad _this"];
}
else
{
_pas_de_hook = true;
};

// Condition action heliporter
R3F_LOG_action_heliporter_valide = !(_vehicule_joueur getVariable "R3F_LOG_disabled") && _pas_de_hook && _isNOTlocked &&
isNull (_vehicule_joueur getVariable "R3F_LOG_heliporte") && (vectorMagnitude velocity _vehicule_joueur < 6) &&
{
{
(_x getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select __can_be_lifted) &&  
_x != _vehicule_joueur && !(_x getVariable "R3F_LOG_disabled") && locked _x < 2 &&
((getPosASL _vehicule_joueur select 2) - (getPosASL _x select 2) > 2 && (getPosASL _vehicule_joueur select 2) - (getPosASL _x select 2) < 15)
} count (nearestObjects [_vehicule_joueur, ["All"], 15]) != 0
};

// Condition action heliport_larguer
R3F_LOG_action_heliport_larguer_valide = !isNull (_vehicule_joueur getVariable "R3F_LOG_heliporte") && !(_vehicule_joueur getVariable "R3F_LOG_disabled") && _isNOTlocked &&
(vectorMagnitude velocity _vehicule_joueur < 25) && ((getPosASL _vehicule_joueur select 2) - (0 max getTerrainHeightASL getPos _vehicule_joueur) < 40);
}
else
{
R3F_LOG_action_heliporter_valide = false;
R3F_LOG_action_heliport_larguer_valide = false;
};

sleep 0.4;
};

 

 

Thanks, Halv!

Share this post


Link to post
Share on other sites

29 answers to this question

Recommended Posts

  • 0

This should not be hard to accomplish, I believe I had read the answer from some A2 posts.
 
I personally would look for the file that is called when you initiate the LIFT.
Then try at the beginning of the script do a check for (don't knock me)

https://community.bistudio.com/wiki/locked
 
so _locked = locked _veh

if _locked = 2 && _locked = 3 exit with {};

else continue on with script.

 

It shouldn't be too hard to get it working from there.

 

Might not even be of use to me since I don't use the R3F lift features since SLING came out

Share this post


Link to post
Share on other sites
  • 0

Follow up with more info:

 

this is the post with more info, I believe the _locked check is better tho

It seems most of the edits use this

_object setVariable ["R3F_LOG_disabled",true,true];
So from there we need to find the Variable in r3f and go from there.

Should be around tomorrow

Share this post


Link to post
Share on other sites
  • 0

Yeah that's worth a look.  I was going to try a hive check to see if the vehicle is locked and if it returns yes just do an exitWith{}

 

Does the A3 SLING feature not have the glitch where you can lift vehicles through buildings?  That's one of our biggest issues with R3F right now.

Share this post


Link to post
Share on other sites
  • 0

Hi,

 

IgiLoad does the same but looking todo that as well, Its on my to-do list about line 20 :-). Will let you know what I find for that if it helps

Share this post


Link to post
Share on other sites
  • 0

Thanks, fellas!  My players love how easy it is to tow and lift  and the large range of vehicle compatibility with R3F versus some other solutions that are out there, but the glitching it allows causes its own set of issues.  If we can lock this down it will make R3F nearly perfect.  Supposedly the R3F team are trying to get A3 phsyics to apply to towed and lifted vehicles, which would be really sweet.

Share this post


Link to post
Share on other sites
  • 0

Thanks, Dwarfer.  But doesn't this rely on the server files being edited to tell it that R3F is disabled for locked vehicles?  I'm trying to do this without having to edit server files, although we probably could now that they're unlocked.  

Share this post


Link to post
Share on other sites
  • 0

My plan was to basically find and replace of R3F_LOG_disabled with something else more applicable. Just working out how todo that at some point in time. Maybe even a small server side PBO would work.

Share this post


Link to post
Share on other sites
  • 0

Gonna add this to a server side PBO and test it

//Disable R3F tow and lift on locked Epoch vehicles


_veh = ["Air","Ship","LandVehicle"];
_locked = locked _veh;


for _locked from 2 to 3 do
	{
		_locked setVariable ["R3F_LOG_disabled",true,true];
	};

Share this post


Link to post
Share on other sites
  • 0

Ok this is as close as I've gotten.

_veh = nearestObjects [player,["Air","Ship","LandVehicle"],20];
_locked = locked _veh in [2,3];

if _locked then
	{
		_veh setVariable ["R3F_LOG_disabled",true,true];
	};

Getting an error though.

13:49:12 Bad conversion: array
13:49:12 Error in expression <mapcontent\disableR3F.sqf"






_veh = nearestObjects [player,["Air","Ship","La>
13:49:12   Error position: <nearestObjects [player,["Air","Ship","La>
13:49:12   Error locked: 0 elements provided, 3 expected
13:49:12 File x\addons\a3_custom\mapcontent\disableR3F.sqf, line 7

Gotta take a pause though to update my server for Arma.

Share this post


Link to post
Share on other sites
  • 0

Still can't get it.

 

Tried this server side

veh = [];
_locked = [];
_player = (vehicle player);
_veh = nearestObjects [_player,["All"],20];
_locked = locked _veh;


if (_locked > 1) then
	{
		_veh setVariable ["R3F_LOG_disabled",true,true];
	};

Then tried this in R3F heliporter.sqf, lines 26-40

	// Recherche de l'objet à héliporter
	_objet = objNull;
	_veh = nearestObjects [_heliporteur,["All"],20];
	_locked = locked _veh;
	if (_locked > 1) exit with {};
	else
	{
	 {
		if (
			(_x getVariable ["R3F_LOG_fonctionnalites", R3F_LOG_CST_zero_log] select R3F_LOG_IDX_can_be_lifted) &&
			_x != _heliporteur && !(_x getVariable "R3F_LOG_disabled") &&
			((getPosASL _heliporteur select 2) - (getPosASL _x select 2) > 2 && (getPosASL _heliporteur select 2) - (getPosASL _x select 2) < 15)
		) exitWith {_objet = _x;};
	} forEach (nearestObjects [_heliporteur, ["All"], 20]);
	};

Can't get past this error

14:36:18 Error in expression <_locked = locked _veh;
if (_locked > 1) exit with {};
else
{
{
if (
(_x getVaria>
14:36:18   Error position: <exit with {};
else
{
{
if (
(_x getVaria>
14:36:18   Error Missing ;

Anyone got an idea?

Share this post


Link to post
Share on other sites
  • 0

I'll get back to this project once I figure out where we stand with Bornholm.  We are going to be doing some testing today and tomorrow to see what's causing the client side performance issue with it.  Once we can either fix it or come to the conclusion that we can no longer run it until it's updated, then I'll get back to this project.  Anyone is free to take the ball and run with it though.  :) 

Share this post


Link to post
Share on other sites
  • 0

Still haven't made any progress on this.  I took Halv's suggestion and tried editing the surveiller_conditions_actions_menu file.  I added to line 38

_locked = locked _objet_pointe in [2,3];

Then I went through the lower part of the file and added !_locked to a couple places below where it checks conditions for towing and lifting.  Not working still.

 

 

EDIT:  After thinking about it some more I think we are going about this the wrong way.  In Epoch the vehicle locks aren't as simple as the Arma lock/unlock command status.  There's a value that's saved to the database that determines whether a vehicle is locked or not.  So we are going to have to add code that gets the server to query the DB to see if a given vehicle is locked or not.  Based on that condition, then we can block tow and lift for vehicles that are locked.

Share this post


Link to post
Share on other sites
  • 0

Hello,

 

when adding "_vehicle setVariable ["R3F_LOG_disabled",FALSE/TRUE,true];" in the server "EPOCH_server_lockVehicle.sqf" log/unlock event handler, one can disable R3F for vehicles that get locked while the server is running, by setting the R3F deny variable.

The problem is, after map restart the server does not load all the lock states from the database. One could query all the lock states and set teh R3F deny variable in "EPOCH_load_vehicles.sqf" at the time all vehicles get loaded from the database.

 

However, this has 2 disadvantages. The DEVs doesn't like when we mod the server files more than needed, which I can understand and second, we have to re-patch the server files at each release.

 

The better way would be to write a server-addon which iterates over all vehicles after start end then sets the R3F deny variable. However, this addon also must also realize, when a player locks/unlocks a vehicle. So it must also react to the ""EPOCH_lockVehicle_PVS"  addPublicVariableEventHandler{(_this select 1)call EPOCH_server_lockVehicle};" event.

 

Is it possible to register a second eventhandler without overwriting the first/main eventhandler? I don't know...

 

BR

Rob

Share this post


Link to post
Share on other sites
  • 0

Yeah that seems really complicated, calling PV after PV.  That would result in a lot of network traffic on server startup, since the server would have to send the variables to all players for 150+ vehicles.  Plus, what about JIP players?  The server would have to resend those variables for each player that connects after the server is already running, which could result in some serious lag.  

Share this post


Link to post
Share on other sites
  • 0

i have this working perfectly fine on my server now, with no database calls (not sure why that would be needed in the first place).

 

anyway, if you did what i suggested and did not succed, then you didnt try hard enough ... i just fixed this on my server after about 10min time used on changes in surveiller_conditions_actions_menu.sqf ... on my server you now cannot lift or tow locked vehicles or vehicles near plotpoles you do not own or is in group with, anymore ... ;)

Share this post


Link to post
Share on other sites
  • 0

I admit I haven't given this a ton of time.  Been staying pretty busy making changes and additions to Altis.  I'm hoping within the next couple weeks I can concentrate on it more after I get moved to my new apartment.  Halv, did you just add code toward the top of the surveiller file or did you have to add a variable to several places below also?  That's what I was struggling with, since the whole script is written in French, I was having to guess which sections needed to have the locked check variable applied.  My thoughts on needing to connect to the db were due to the fact that it seems as though Epoch uses its own lock system and doesn't rely on the traditional Arma sense of locking.  With Epoch, the locked status of vehicles is stored in a timer in the database, as I'm sure you know.  I suppose I was over-complicating it, as I often do in my logical brain.  :)  

Share this post


Link to post
Share on other sites
  • 0

I admit I haven't given this a ton of time.  Been staying pretty busy making changes and additions to Altis.  I'm hoping within the next couple weeks I can concentrate on it more after I get moved to my new apartment.  Halv, did you just add code toward the top of the surveiller file or did you have to add a variable to several places below also?  That's what I was struggling with, since the whole script is written in French, I was having to guess which sections needed to have the locked check variable applied.  My thoughts on needing to connect to the db were due to the fact that it seems as though Epoch uses its own lock system and doesn't rely on the traditional Arma sense of locking.  With Epoch, the locked status of vehicles is stored in a timer in the database, as I'm sure you know.  I suppose I was over-complicating it, as I often do in my logical brain.   :)

 

these are action conditions (wich is actually checked on each frame, but thats another story) you have to add a check for each condition or the action will show up, also below the part about cursortarget you have the lift part for conditions when in air vehicles, you have to make a check there aswell and make sure you check the vehicle you are about to lift and not the heli you are flying or you will for obvius reasons still be able to lift any vehicle.

Share this post


Link to post
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
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×