Jump to content

[Release] Enhanced Vehicle Deployment (with right click option)


Recommended Posts

I think you guys missed adding them to your variables.sqf

 

try adding the vehicle classes that people are building to the dze_allowedObjects and dze_safeVehicles lists to stop players getting killed and vehicles disappearing.

Link to comment
Share on other sites

I was also having the same issue, but figured out my problem.

 

Change the 'false' in your EVD_common.sqf to 'true'. So it will look like this:

 

// Do you want vehicles to be sold at traders?
EVDSellVehicles = true

 

 

Infistar deletes vehicles that do not have an ID... When you switch to true, the deployed vehicles now have an ID.

 

Hope this helps!

 

Twizz

Link to comment
Share on other sites

I was also having the same issue, but figured out my problem.

 

Change the 'false' in your EVD_common.sqf to 'true'. So it will look like this:

 

// Do you want vehicles to be sold at traders?

EVDSellVehicles = true

 

 

Infistar deletes vehicles that do not have an ID... When you switch to true, the deployed vehicles now have an ID.

 

Hope this helps!

 

Twizz

Thank you! Its worked

Link to comment
Share on other sites

This script is running fine on my server however, the "Pack vehicle" is not working correctly.  Players for the most part are unable to pack there vehicles back up and retreive there parts.  The option in the scroll on the mozzies for example doesn't even show the pack menu anymore...  It was working fine at first it seems, but now the pack vehicle option is rare to see.  I tried all last night to get my pack option to display, but had no luck.  However, one player on my server was able to pack the mozzie up.... He was the only one no1 else was getting the option to do so.  Does anyone have any idea what is going on?  I use infistar if that has anything to do with it.

Link to comment
Share on other sites

  • 2 weeks later...

This script is running fine on my server however, the "Pack vehicle" is not working correctly.  Players for the most part are unable to pack there vehicles back up and retreive there parts.  The option in the scroll on the mozzies for example doesn't even show the pack menu anymore...  It was working fine at first it seems, but now the pack vehicle option is rare to see.  I tried all last night to get my pack option to display, but had no luck.  However, one player on my server was able to pack the mozzie up.... He was the only one no1 else was getting the option to do so.  Does anyone have any idea what is going on?  I use infistar if that has anything to do with it.

I have the same issue.

Currently the workaround that seems to consistently work is disconnecting from the game and reconnecting, which is less than ideal.

 

I read the suggestion above about infiSTAR exception but we are not using infiSTAR. Are there any other fixes to receive the Pack Bike mousewheel option consistently?

Thanks

Link to comment
Share on other sites

I have the same issue.

Currently the workaround that seems to consistently work is disconnecting from the game and reconnecting, which is less than ideal.

 

I read the suggestion above about infiSTAR exception but we are not using infiSTAR. Are there any other fixes to receive the Pack Bike mousewheel option consistently?

Thanks

So no fix for this issue?

 

The other issue is: at other times when "Pack Vehicle" makes it magic appearence :) it works even from 50 meters...

Link to comment
Share on other sites

Apologies for the misunderstanding in how I worded it. Yes, people were able to pack vehicles from any distance as long as they walk up to the vehicle and scroll on it to get the 'pack vehicle' option. So, I edited the script to check to see if the vehicle is within 5m of the player before packing (see reply #73 for edited code). However, once I made that change, I started encountering a different problem: you would get the option to pack vehicle --> choose to pack vehicle --> player would go through the animation --> vehicle would not delete --> parts would not get refunded --> no longer have the option to pack vehicle if you scroll wheel on the vehicle again.

 

So, on my production server players are still able to pack vehicles from a long distance. On my test server, my changes aren't deleting the vehicle or refunding parts.

 

Sorry about the confusion.

 

EDIT: Do you think I should remove the check for the vehicle within 5m from EVD_Pack.sqf and move it into the fn_selfActions.sqf script? Maybe something like:

//Pack Vehicles
if (_typeOfCursorTarget in StaticVehicleArray and !(locked _cursorTarget) and (damage _cursorTarget < 1) and (_cursorTarget distance player <= 5)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "Scripts\static_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};
// All Traders

I will test this and see. I am still very new to Arma scripting (and coding in general as I only took 1 semester of C++ coding in high school, which was a decade ago), so I apologize for the trouble but I greatly appreciate your input and help. I understand coding logic and syntax in general, so I'm not flying completely blind when it comes to coding, but I am still very new at this.

 

EDIT 2: Issue resolve via PM from @Hardened.

 

This fix did indeed work. MUCH easier. Thank you!

I am trying to achieve the same thing (i.e.: I don't want people to be able to pack bikes from ridiculous distances). I tried adding it like this:

	// Study Body
	if (_player_studybody) then {
		if (s_player_studybody < 0) then {
		 // --------ZUPA - Check Wallet --------
				s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "gold\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
			// ---- ZUPA END ---
		};
	} else {
		player removeAction s_player_studybody;
		s_player_studybody = -1;

		// attempting fix for "players can pack bikes from ANY DISANCE" as per => http://epochmod.com/forum/index.php?/topic/10905-release-enhanced-vehicle-deployment-with-right-click-option/page-4#entry92431
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;
	};

And also like this:

	// Study Body
	if (_player_studybody) then {
		if (s_player_studybody < 0) then {
		 // --------ZUPA - Check Wallet --------
				s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "gold\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
			// ---- ZUPA END ---
		};
	} else {
		player removeAction s_player_studybody;
		s_player_studybody = -1;
	};
		// attempting fix for "players can pack bikes from ANY DISANCE" as per => http://epochmod.com/forum/index.php?/topic/10905-release-enhanced-vehicle-deployment-with-right-click-option/page-4#entry92431
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;

...but it did not help at all. Do you still have the working fix on this? Could you please share?

 

Thanks

Link to comment
Share on other sites

I am trying to achieve the same thing (i.e.: I don't want people to be able to pack bikes from ridiculous distances). I tried adding it like this:

	// Study Body
	if (_player_studybody) then {
		if (s_player_studybody < 0) then {
		 // --------ZUPA - Check Wallet --------
				s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "gold\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
			// ---- ZUPA END ---
		};
	} else {
		player removeAction s_player_studybody;
		s_player_studybody = -1;

		// attempting fix for "players can pack bikes from ANY DISANCE" as per => http://epochmod.com/forum/index.php?/topic/10905-release-enhanced-vehicle-deployment-with-right-click-option/page-4#entry92431
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;
	};

And also like this:

	// Study Body
	if (_player_studybody) then {
		if (s_player_studybody < 0) then {
		 // --------ZUPA - Check Wallet --------
				s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "gold\check_wallet.sqf",_cursorTarget, 0, false, true, "",""];
			// ---- ZUPA END ---
		};
	} else {
		player removeAction s_player_studybody;
		s_player_studybody = -1;
	};
		// attempting fix for "players can pack bikes from ANY DISANCE" as per => http://epochmod.com/forum/index.php?/topic/10905-release-enhanced-vehicle-deployment-with-right-click-option/page-4#entry92431
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;

...but it did not help at all. Do you still have the working fix on this? Could you please share?

 

Thanks

 

I no longer am active on our DayZ servers, but I still have complete access to all of the files. I'll do my best to hop on and see if these scripts are still being used with the edits I made in order to fix this for you. If not, I'll dig through the backups and find it and get it back to you asap.

 

Cheers!

Link to comment
Share on other sites

If you are having issues with players being able to pack vehicles from long distances, this is what you need to do:

 

1. In the file that handles the packing of your vehicles/bikes, you should see a line of code that checks first to see if the player is in combat, and if so, then it will exit the script. It should look something like this (may not be exact depending on your particular script):

if (dayz_combat == 1) exitwith { cutText ["\n\nYou are in combat and cannot perform that action!", "PLAIN DOWN"] };

2. Copy and paste this code in the line underneath the code from the example above: (I added comments to the end of each line explaining what that bit of code is essentially doing or asking)

_playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 10]); /****How many players are within 10 meters of the player?****/
_vehicleEmpty = (count (crew cursorTarget)) == 0; /****Does the vehicle the player is pointing at have anybody in it?****/
if ((_playersNear >= 2) || !(_vehicleEmpty)) exitWith { cutText ["\n\nYou cannot pack an object with players nearby.", "PLAIN DOWN"] }; /****If there is anybody within 10 meters of the player packing the vehicle OR if the vehicle the player is trying to pack has anybody in it, it will exit the script with an error message to the player telling him/her why.****/

3. In one of the first few lines, you should see a list of private variables used within the script. Since you pasted some code (in previous step) containing new private variables (_playersNear & _vehicleEmpty), you need to add them to your current list. As you can see below, I've added them to the end of this list.

private ["_obj","_animState","_started","_finished","_playersNear","_vehicleEmpty"];

4. In your custom fn_selfActions.sqf file, there are a few functions that need to be added to the code that handles the packing of the vehicles. (NOTE: This is likely very different than what your chunk of code may look like. It is important that you understand that if you copy and paste my example from below as a whole, it will not work unless we're long lost twins and you use the exact same file names and file paths as I do. Instead, I assume that you know enough coding to understand what my changes are doing and how you can modify yours to do the same. It's really not hard once you break it all down and understand exactly what the code is asking the game to do.)

So, that being said, I will try to explain this as best I can. Below is the section of the script that handles the packing of vehicles on my server:

	//Pack Vehicles
	if (_typeOfCursorTarget in spawnBikeVehicleArray && !(locked _cursorTarget) && (damage _cursorTarget < 1) && (_cursorTarget distance player <= 3)) then {
		if (s_player_packvehicle < 0) then {
			s_player_packvehicle = player addAction [("<t color=""#C86700"">" + ("Pack Vehicle") +"</t>"),"spawnbike\spawnBikePack.sqf",_cursorTarget,0,false,true,"",""];
		};
	} else {
		player removeAction s_player_packvehicle;
		s_player_packvehicle = -1;
	};

If it's not immediately obvious what I did here, then go back and try to figure it out for yourself before reading on. Knowing how to merge these concepts into your own code is essential to making it work properly.

So, what is the key?

The key is '

_cursorTarget distance player <= 3'.

Going in order, the script checks for the following conditions to be met:

 

1. 'if (_typeOfCursorTarget in spawnBikeVehicleArray'   ---  This is to verify that my _typeOfCursorTarget (what I've got my crosshair pointed at in game) is an object contained in the list named 'spawnBikeVehicleArray'. In another customized file named variables.sqf, I have a variable called 'spawnBikeVehicleArray' that contains which vehicles I want to allow to be packed up. (NOTE: As you can see on line 298 in the example above, the code points to the .sqf file that contains the code for the packing of vehicles. In the example, my file path is "spawnbike\spawnBikePack.sqf". However, you must change this file path to match where YOUR .sqf file is that handles the packing of vehicles.) If I've already lost you or you have no idea what I'm referring to, then I suggest doing a bit more research on how managing a DayZ server works and/or coding in general. If you're still following along with it all and understand it all, just keep in mind that your packable vehicle variable name will differ as well from what mine is. If your variable is named something like 'customDeployableVehicles', then make sure you use yours! If you haven't created a list of vehicles you want to allow being packed, then add a line at the very bottom of your variables.sqf file that names your custom variable and defines it to include the vehicles you chose. For example, mine looks like this:

spawnBikeVehicleArray = ["MMT_Civ","TT650_Civ","CSJ_GyroC"]; /**** Mountain Bike, Dirtbike, Mozzie ****/

2. '&& !(locked _cursorTarget)'  ---  This is to check that my _cursorTarget is not pointing at a locked vehicle since I do not allow players to be able to pack up locked mozzies. If you choose to allow that, then you obviously can omit this part from your code.

 

3. '&& (damage _cursorTarget < 1)'  ---  This simply checks to make sure the vehicle is not destroyed. Without this, players can blow up a mozzie and simply pack it up and re-deploy it and have a brand new mozzie. That was obviously an issue with me, which is why I added this. You can edit the max allowed damage you prefer by simply changing the '1' to the value you choose (Min: '0' = perfect condition; Max: '1' = destroyed; Decimal values will be used for anything in between 0 and 1).

 

4. '&& (_cursorTarget distance player <= 3))'  ---  Lastly, this checks to make sure that your _cursorTarget is still within 3 meters or less when you click on the 'Pack Vehicle' option. Before, players could run up to it, get the option to pack, and run any distance away from it and then click 'Pack Vehicle' to pack it up. If they were real assholes, they could do this to somebody's mozzie inside of a trade city, wait til that player starts flying off, and then pack it up while it was flying causing the player to fall helplessly to his/her death.

 

Keep in mind that ALL of these values must return true in order for the option to pack vehicle to even display to the player. If one or more of these conditions return false, the game will not supply the player with an option to pack.

 

 

 

I hope these work for you. I hope I was able to explain everything well enough. If you try again and you're still unable to get it to work, then PM me and maybe we can hash out the source of your issue. I saw that there were other questions about some other issues such as vehicles disappearing and players being killed when getting on a deployed vehicle. I'm not sure if they were able to get it fixed yet or not, but I ran into that as well after one of the infistar updates and I can show you how to fix those issues as well. I just didn't want to tack it onto this post and make it even longer than it already is.

 

Cheers.

 

EDIT - Immediately after my post, I noticed I didn't clarify some information about editing the file path in step 1. Went back and added in the additional clarification.

Link to comment
Share on other sites

  • 4 weeks later...
/*
	Enhanced Vehicle Deployment by TheFarix
*/

//////////////////////////////////////////////////////////////////////////////////////////
//                                     Configuration                                    //
//////////////////////////////////////////////////////////////////////////////////////////

// Do you want vehicles to be sold at traders?
EVDSellVehicles = false;

//////////////////////////////////////////////////////////////////////////////////////////
//                                   Common Functions                                   //
//////////////////////////////////////////////////////////////////////////////////////////
EVDGetMaterials = {
	private ["_type","_materials"];
	_type = _this select 0;

	switch (_type) do {
		case "MMT_Civ":		{ _materials = ["ItemToolbox",1]; };
		case "TT650_Civ":	{ _materials = [["PartGeneric", 2], ["PartEngine", 1], ["PartWheel", 2]]; };
	};

	_materials;
};

 Hod do i got this working. When i want to deploy a bike he says. "Need 1 more" How do i fix this ??

I want that when ppl deploy a bike they lose their toolbox. And when they pack it they got it back

Link to comment
Share on other sites

All the ideas on page 1 about the toolbox dissapearing when you deploy something and get it back when you pack it, is that in the instructions on page 1?

Also when i'm in the deployed Mozzie and press Q to lift off, it disappears???

 

Also the bike and moto disappear as soon as i drive and come to a stop.

 

My client RPT:

 

Error in expression <"",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehic>
  Error position: <s_player_packvehicle;
s_player_packvehic>
  Error Undefined variable in expression: s_player_packvehicle
File mpmissions\__CUR_MP.Tavi\custom\fn_selfActions.sqf, line 741
Error in expression <m_removed;
if(_num_removed >= 1) then {
_temp_removed_array set [count _temp_rem>
  Error position: <_temp_removed_array set [count _temp_rem>
  Error Undefined variable in expression: _temp_removed_array
File mpmissions\__CUR_MP.Tavi\custom\RightClickDeploy\EVD_deploy.sqf, line 84
Link to comment
Share on other sites

  • 2 weeks later...

I am getting the following error

13:28:06 "DayZ Epoch: PRELOAD Functions\init [[<No group>:0 (FunctionsManager)],any]"
13:28:06 "DayZ Epoch: MPframework inited"
13:28:06 Error in expression <

if(isServer) then {
DZE_safeVehicle = DZE_safeVehicle + EVDVehicleArray;
};>
13:28:06   Error position: <DZE_safeVehicle + EVDVehicleArray;
};>
13:28:06   Error Undefined variable in expression: dze_safevehicle
13:28:06 File mpmissions\DayZ_Epoch_16.Panthera2\custom\variables.sqf, line 5
13:28:06 Error in expression <iv","CSJ_GyroC"];
dayz_allowedObjects = dayz_allowedObjects + EVDVehicleArray;

>
13:28:06   Error position: <dayz_allowedObjects + EVDVehicleArray;

>
13:28:06   Error Undefined variable in expression: dayz_allowedobjects
13:28:06 File mpmissions\DayZ_Epoch_16.Panthera2\custom\variables.sqf, line 2
13:28:06 "Admin Tools: AdminList.sqf loaded"
13:28:06 Warning: z\addons\dayz_communityassets\models\compass.p3d:0 Error while trying to generate ST for points: 863, 853, 852
13:28:07 "Res3tting B!S effects..."
13:28:10 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."
Link to comment
Share on other sites

Maybe this has already been posted and I apologize if it has, but I would like the parts to go back into my gear after you pack. I saw it mentioned that this was changed from other scripts but I can't seem to find that script. So does someone have a link to a script where the unpacked parts go back into gear instead on the ground, or is there a way to change that in this script?

Link to comment
Share on other sites

  • 4 weeks later...

The deploy bike option isn't showing:

 

KvS2sa.png

 

My extra_rc.hpp:

 

class ExtraRc {
  class ItemRadio {
     class GroupManagement {
        text = "Group Management";
        script = "execVM 'custom\dzgm\loadGroupManagement.sqf'";
     };
  };
class ItemToolbox {
      class BuildBike {
         text = "Deploy Bike";
         script = "['MMT_Civ'] execVM 'custom\EVD\EVD_deploy.sqf'";
      };
class BuildMotorcycle {
         text = "Deploy Motorcycle";
         script = "['TT650_Civ'] execVM 'custom\EVD\EVD_deploy.sqf'";
      }; 
class BuildMozzie {
         text = "Deploy Mozzie";
         script = "['CSJ_GyroC'] execVM 'custom\EVD\EVD_deploy.sqf'";
      };
   };  
};

Any suggestions?

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