Jump to content

[Release] Deploy Bike Extendet


oOSmokyOo

Recommended Posts

Had to make some fixes and changes to this as posted to get it working but it's working fine on 1.0.5.1

(On my server 81.19.216.140:2310 if you want to test)

 

Hope you don't mind but I've amalgamated some changes by AxeCop into this so that players can only repack deployed vehicles (as opposed to spawn or purchased ones) and only after they have deployed one themselves.

I've also made it take longer for the higher end vehicles as well, looping the medic animation.

Also fixed the moped not needing fuel to craft and fixed a typo in the original scripts that called for checking items in _mags which was not defined (so I changed this to check _weapons and it works now)

 

FN_Selfactions

// ---------------------------------------Deployable Bike Start------------------------------------
_itemsPlayer = items player;
_hasToolbox = "ItemToolbox" in _itemsPlayer;
if (_canDo && (speed player <= 1) && _hasToolbox) then {
    if (s_player_deploybike < 0) then {
        s_player_deploybike = player addaction[("<t color="#007ab7"">" + ("Deploy Bike (will use Toolbox)") +"</t>"),"deployables\mtbike\deploy.sqf","",5,false,true,"", "];
    };
} else {
    player removeAction s_player_deploybike;
    s_player_deploybike = -1;
};

if (_canDo && (speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && (cursorTarget getVariable ["SpawnedBike",0] == 1)) then {
    if (s_player_deploybike2 < 0) then {
        s_player_deploybike2 = player addaction[("<t color="#007ab7"">" + ("Re-Pack Bike") +"</t>"),"deployables\mtbike\pack.sqf","",5,false,true,"", "];
    };
} else {
    player removeAction s_player_deploybike2;
    s_player_deploybike2 = -1;
};
// ---------------------------------------Deployable Bike End------------------------------------

//--------------------------------------Deploy Moped----------------------------------
//------------------------------------------Start-------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isMoped = typeOf cursorTarget in ["TT650_Civ"];

//MOPED DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _weapons && "PartGeneric" in _weapons && "PartEngine" in _weapons && "PartWheel" in _weapons && "PartWheel" in _weapons && "ItemJerrycan" in _weapons) then {
hasMopedItem = true;
} else { hasMopedItem = false;};
if((speed player <= 1) && hasMopedItem && _canDo) then {
if (s_player_deploymoped < 0) then {
s_player_deploymoped = player addaction[("<t color="#4eff00"">" + ("Deploy Moped") +"</t>"),"deployables\moped\deploy.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploymoped;
s_player_deploymoped = -1;
};

//PACK MOPED
if (_isMoped && "ItemToolbox" in _weapons && (speed player <= 1) && (player distance cursorTarget < 10) && (cursorTarget getVariable ["SpawnedMoped",0] == 1)) then {
if (s_player_deploymoped2 < 0) then {
s_player_deploymoped2 = player addaction[("<t color="#4eff00"">" + ("Re-Pack Moped") +"</t>"),"deployables\moped\pack.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploymoped2;
s_player_deploymoped2 = -1;
};
//--------------------------------------Deploy Moped-----------------------------------
//-------------------------------------------End---------------------------------------

//--------------------------------------Deploy Mozzie----------------------------------
//------------------------------------------Start--------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isMozzie = typeOf cursorTarget in ["CSJ_GyroC"];

//MOZZIE DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _weapons && "PartGeneric" in _weapons && "PartEngine" in _weapons && "ItemFuelBarrel" in _weapons && "PartVRotor" in _weapons) then {
hasMozzieItem = true;
} else { hasMozzieItem = false;};
if((speed player <= 1) && hasMozzieItem && _canDo) then {
if (s_player_deploymozzie < 0) then {
s_player_deploymozzie = player addaction[("<t color="#4eff00"">" + ("Deploy Mozzie") +"</t>"),"deployables\mozzie\deploy.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploymozzie;
s_player_deploymozzie = -1;
};

//PACK MOZZIE
if (_isMozzie && "ItemToolbox" in _weapons && (speed player <= 1) && (player distance cursorTarget < 10) && (cursorTarget getVariable ["SpawnedMozzie",0] == 1)) then {
if (s_player_deploymozzie2 < 0) then {
s_player_deploymozzie2 = player addaction[("<t color="#4eff00"">" + ("Re-Pack Mozzie") +"</t>"),"deployables\mozzie\pack.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploymozzie2;
s_player_deploymozzie2 = -1;
};
//--------------------------------------Deploy Mozzie-----------------------------------
//--------------------------------------------End---------------------------------------

//--------------------------------------Deploy Little Bird-----------------------------
//---------------------------------------------Start-----------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isBird = typeOf cursorTarget in ["MH6J_EP1"];

//BIRD DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _weapons && "PartGeneric" in _weapons && "PartEngine" in _weapons && "PartFueltank" in _weapons && "PartVRotor" in _weapons && "ItemFuelBarrel" in _weapons && "PartGlass" in _weapons && "PartGlass" in _weapons) then {
hasBirdItem = true;
} else { hasBirdItem = false;};
if((speed player <= 1) && hasBirdItem && _canDo) then {
if (s_player_deploybird < 0) then {
s_player_deploybird = player addaction[("<t color="#4eff00"">" + ("Deploy Little Bird") +"</t>"),"deployables\bird\deploy.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploybird;
s_player_deploybird = -1;
};

//PACK BIRD
if (_isBird && "ItemToolbox" in _weapons && (speed player <= 1) && (player distance cursorTarget < 10) && (cursorTarget getVariable ["SpawnedBird",0] == 1)) then {
if (s_player_deploybird2 < 0) then {
s_player_deploybird2 = player addaction[("<t color="#4eff00"">" + ("Re-Pack Little Bird") +"</t>"),"deployables\bird\pack.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deploybird2;
s_player_deploybird2 = -1;
};
//--------------------------------------Deploy Little Bird----------------------------------
//-----------------------------------------------End-----------------------------------------

 

The deployables folder

https://drive.google.com/file/d/0BwzPK4QLepxubDZKZFJiOUhpbnc/edit?usp=sharing

Link to comment
Share on other sites

had some problems with it becouse when you get on bike you die but i changed the DZE_Vehicles scf now it working even better

 

To fix this change original lines inside 19 and 20;

 

                                                            deployables/ bird/ deploy.sqf

                                                            deployables/ moped/ deploy.sqf           

                                                            deployables/ mozzie/ deploy.sqf         

                                                            deployables/ mtbike/ deploy.sqf 

_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];


Replace with

_object setVariable ["malsar",1,true];
_uniqueid = str(round(random 999999));
_object setVariable ["ObjectID", _uniqueid, true];
_object setVariable ["ObjectUID", _uniqueid, true];
clearMagazineCargo _object;
clearWeaponCargo _object; 

open your compile/server_updateObject.sqf and place this:

if (_object getVariable "MalSar" == 1) exitWith {}; 

...immediately above this:

if (!_parachuteWest and !(locked _object)) then { 

      b_560_95_1.png

Link to comment
Share on other sites

Hi,
 
I have installed this and I can deploy a bike but when I scroll over the bike I can not pack it. How could I fix this?
 
Thanks.
 
EDIT1; 
 
Nevermind about my problem, I decided to take my time and read through the script. All I had to do was go to my fn_selActions.sqf and find the 

if((_isBike && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {

and replace it with 

if((_isBike  && (player distance cursorTarget < 10)) and _canDo) then {

so I took out this code

&& "ItemToolbox" in _weapons

as it was saying that a toolbox is needed to pack a bike. Now I can pack a bike without a toolbox. After modifying I edited the deploy.sqf inside the mtbike and changed it to this:

if (false) then {
cutText [format["You are in combat and cannot build a bike."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploybike;
player playActionNow "Medic";
r_interrupt = false;
player removeWeapon "ItemToolbox";

_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;

sleep 6;

_object = "MMT_Civ" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];

player reveal _object;

cutText [format["You've built a bike! How magical!"], "PLAIN DOWN"];

r_interrupt = false;
player switchMove "";
player playActionNow "stop";

sleep 10;

cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];

};

What I changed was, The bike can be built without then need of any other parts but just the toolbox. When it is built the toolbox disapears.

 

Then I put this into the pack.sqf

if (false) then { 
// player is in combat and cant pack his bike
    cutText [format["You are in combat and cannot re-pack your bike."], "PLAIN DOWN"];
} else {
	if (typeOf cursorTarget == "MMT_Civ") then {
	// player is looking at a bike and the target has a bike classname
	// delete it first to avoid player changing to another target
		deletevehicle cursorTarget; 
		player removeAction s_player_deploybike2;
		player playActionNow "Medic";
		r_interrupt = false;		
		player addWeapon "ItemToolbox";
		_dis=10;
		_sfx = "repair";
		[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
		[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
		sleep 6;
		cutText [format["You have packed your bike and been given back your materials"], "PLAIN DOWN"];
		r_interrupt = false;
		player switchMove "";
		player playActionNow "stop";
	} else {
		// player is not looking at a bike, or target does not have a bike classname
		cutText [format["You have to be facing your bike to re-pack it!"], "PLAIN DOWN"];
	};
};

Which tells the script to give back the toolbox to the player so they can deploy it when ever they wish once again.

 
Hopes this helps who ever is looking at this in the future.

Link to comment
Share on other sites

Hello

I found this script some time back and dont know who made it. Can someone tell me where this comes from. No name on it at all.

Been using it and now that 1.0.5.1 125548 is out i reinstalled it and the bike that i deploy goes away after 14 seconds, every time.

the following is the instructions i used to install

Step 1: Custom variables.sqf
 If you do not have a custom variables.sqf, create an empty file in the custom scripts directory of your mission folder. Edit it to include the following:
EVDVehicleArray = ["MMT_Civ","TT650_Civ","CSJ_GyroC"];
dayz_allowedObjects = dayz_allowedObjects + EVDVehicleArray;
 
if(isServer) then {
DZE_safeVehicle = DZE_safeVehicle + EVDVehicleArray;
};
If you already have a custom variables.sqf, then add the above code to the bottom.
 
Step 2: Custom compiles.sqf
 
 If you do not have a custom compiles.sqf, create an empty file the custom scripts directory of your mission folder. Edit it to include the following:
if (!isDedicated) then {
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
player_selectSlot = compile preprocessFileLineNumbers "custom\ui_selectSlot.sqf";
};
 
Where "SCRIPT_PATH" is the path of you custom scripts folder from your mission folder. If you already have a custom compiles.sql, then add/modify fnc_usec_selfActions and player_selectSlot depending on the style of custom compiles.sql you are using.
  
 
Step 3: Modify init.sqf
 
 
 Next open the mission's init.sqf and search for the following:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
 
Below it, add:
call compile preprocessFileLineNumbers "custom\variables.sqf";
 
Next, find the following:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
 
Below it, add:
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom functions
 
You now have a custom variable.sqf and compiles.sqf, which will be used by other scripts and modifications.
  
 
Step 4:  Custom ui_selectSlot.sqf
 
 
 Unpack dayz_code.pbo and copy dayz_code\compile\ui_selectSlot.sqf to your custom scripts folder. Open your copied ui_selectSlot.sqf and search for the following around line 57:
_pos set [3,_height];
 
Above it add the following:
// Add extra context menus
_erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
_erc_numActions = (count _erc_cfgActions);
if (isClass _erc_cfgActions) then {
for "_j" from 0 to (_erc_numActions - 1) do {
_menu =  _parent displayCtrl (1600 + _j + _numActions);
_menu ctrlShow true;
_config =  (_erc_cfgActions select _j);
_text =  getText (_config >> "text");
_script =  getText (_config >> "script");
_height = _height + (0.025 * safezoneH);
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText _text;
_menu ctrlSetEventHandler ["ButtonClick",_script];
};
};
 
Step 5: Modify description.ext
 
 
 Open description.ext in your mission folder. At the very bottom of description.ext, add:
#include "custom\extra_rc.hpp"
 
Step 6: Create extra_rc.hpp
 
 
 Next, create an empty file named extra_rc.hpp in your custom scripts folder. Inside the file, add the following:
class ExtraRc {
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_PATH\EVD\EVD_deploy.sqf'";
};
class BuildMozzie {
text = "Deploy Mozzie";
script = "['CSJ_GyroC'] execVM 'custom_PATH\EVD\EVD_deploy.sqf'";
};
};
};
 
If you already have Right Click Options To Items installed and have other scripts that use it, your extra_rc.hpp will look similar to this:
class ExtraRc {
class ItemBloodbag {
class Use {
text = "Use Bloodbag";
script = "execVM 'SCRIPT_PATH\SelfBB\SelfBB.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'";
};
};
};
 
Step 7: Custom fn_selfActions.sqf
 
 
 Copy dayz_code\compile\fn_selfActions.sqf to your custom scripts folder. Open your copied fn_selfActions.sqf and search for the following:
// All Traders
if (_isMan and !_isPZombie and _traderType in serverTraders) then {
 
Above it, add the following:
//Pack Vehicles
if (_typeOfCursorTarget in EVDVehicleArray and _hasToolbox and !(locked _cursorTarget) and (damage _cursorTarget < 1)) then {
if (s_player_packvehicle < 0) then {
s_player_packvehicle = player addAction ["Pack Vehicle", "custom\EVD\EVD_pack.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packvehicle;
s_player_packvehicle = -1;
};
 
Step 8: The finishing touches
 
 
 Download the attached file and unzip it into your custom scripts directory. Edit EVD\EVD_deploy.sqf and EVD\EVD_pack.sqf and change SCRIPT_PATH to the path of your custom scripts directory. Finally, edit EVD\EVD_common.sqf to configure the script to suit your tastes. If you add more vehicles as deplorable, you will need to add the class names to EVDVehicleArray in your custom variables.sqf, modify extra_rc.hpp to add an additional option, and add the required materials to the EVDGetMaterials function in EVD\EVD_common.sqf.
Link to comment
Share on other sites

  • 2 weeks later...

Not sure what happened, everything was working fine and now everytime anyone gets on any of the spawned vehicles they get insta killed.  Running the script on an Overpoch server with Epoch 1.0.5.1 and Overwatch 0.2.5 and latest Arma version.  I know the custom variables file is being called as my JAEM evac chopper mod works, but it is obviously something to do with the DZE_safeVehicle lines.  Any help would be great.  Here is a breakdown of my code:

 

init.sqf:

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)
//Custom Variables
call compile preprocessFileLineNumbers "custom\variables.sqf";
progressLoadingScreen 0.1;

custom\variables.sqf:

//Deployable Vehicles Mod
DZE_safeVehicle = ["MH6J_EP1","CSJ_GyroC","TT650_Civ","MMT_Civ","ParachuteWest","ParachuteC"];​

//JAEM Chopper Evac Mod
dayz_allowedObjects = dayz_allowedObjects + ["HeliHRescue"];

custom\fn_selfActions.sqf: (code added at very bottom of file)

//--------------------------------------Deploy Bike----------------------------------
//-----------------------------------------Start--------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isBike = typeOf cursorTarget in ["MMT_Civ"];

//BIKE DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartWheel" in _mags && "PartWheel" in _mags) then {
hasBikeItem = true;
} else { hasBikeItem = false;};
if((speed player <= 1) && hasBikeItem && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[("<t color=""#4eff00"">" + ("Deploy Bike") +"</t>"),"deployables\mtbike\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};

//PACK BIKE
if((_isBike && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {
if (s_player_deploybike2 < 0) then {
s_player_deploybike2 = player addaction[("<t color=""#4eff00"">" + ("Re-Pack Bike") +"</t>"),"deployables\mtbike\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike2;
s_player_deploybike2 = -1;
};
//--------------------------------------Deploy Bike----------------------------------
//------------------------------------------End--------------------------------------

//--------------------------------------Deploy Moped----------------------------------
//------------------------------------------Start-------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isMoped = typeOf cursorTarget in ["TT650_Civ"];

//MOPED DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartGeneric" in _mags && "PartEngine" in _mags && "PartWheel" in _mags && "PartWheel" in _mags) then {
hasMopedItem = true;
} else { hasMopedItem = false;};
if((speed player <= 1) && hasMopedItem && _canDo) then {
if (s_player_deploymoped < 0) then {
s_player_deploymoped = player addaction[("<t color=""#4eff00"">" + ("Deploy Motorcycle") +"</t>"),"deployables\moped\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymoped;
s_player_deploymoped = -1;
};

//PACK MOPED
if((_isMoped && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {
if (s_player_deploymoped2 < 0) then {
s_player_deploymoped2 = player addaction[("<t color=""#4eff00"">" + ("Re-Pack Motorcycle") +"</t>"),"deployables\moped\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymoped2;
s_player_deploymoped2 = -1;
};
//--------------------------------------Deploy Moped-----------------------------------
//-------------------------------------------End---------------------------------------

//--------------------------------------Deploy Mozzie----------------------------------
//------------------------------------------Start--------------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isMozzie = typeOf cursorTarget in ["CSJ_GyroC"];

//MOZZIE DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartGeneric" in _mags && "PartEngine" in _mags && "ItemJerrycan" in _mags && "PartVRotor" in _mags) then {
hasMozzieItem = true;
} else { hasMozzieItem = false;};
if((speed player <= 1) && hasMozzieItem && _canDo) then {
if (s_player_deploymozzie < 0) then {
s_player_deploymozzie = player addaction[("<t color=""#4eff00"">" + ("Deploy Mozzie") +"</t>"),"deployables\mozzie\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymozzie;
s_player_deploymozzie = -1;
};

//PACK MOZZIE
if((_isMozzie && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {
if (s_player_deploymozzie2 < 0) then {
s_player_deploymozzie2 = player addaction[("<t color=""#4eff00"">" + ("Re-Pack Mozzie") +"</t>"),"deployables\mozzie\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymozzie2;
s_player_deploymozzie2 = -1;
};
//--------------------------------------Deploy Mozzie-----------------------------------
//--------------------------------------------End---------------------------------------

//--------------------------------------Deploy Little Bird-----------------------------
//---------------------------------------------Start-----------------------------------
_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isBird = typeOf cursorTarget in ["MH6J_EP1"];

//BIRD DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartGeneric" in _mags && "PartEngine" in _mags && "PartFueltank" in _mags && "PartVRotor" in _mags && "ItemFuelBarrel" in _mags && "PartGlass" in _mags && "PartGlass" in _mags) then {
hasBirdItem = true;
} else { hasBirdItem = false;};
if((speed player <= 1) && hasBirdItem && _canDo) then {
if (s_player_deploybird < 0) then {
s_player_deploybird = player addaction[("<t color=""#4eff00"">" + ("Deploy Little Bird") +"</t>"),"deployables\bird\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybird;
s_player_deploybird = -1;
};

//PACK BIRD
if((_isBird && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {
if (s_player_deploybird2 < 0) then {
s_player_deploybird2 = player addaction[("<t color=""#4eff00"">" + ("Re-Pack Little Bird") +"</t>"),"deployables\bird\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybird2;
s_player_deploybird2 = -1;
};
//--------------------------------------Deploy Little Bird----------------------------------
//-----------------------------------------------End----------------------------------------​

Link to comment
Share on other sites

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

Can anyone tell me how one would need to change the snippets

...  && "ItemToolbox" in _weapons ...
... player addWeapon "ItemToolbox";

so instead of a toolbox a backpack, e.g. DZ_CompactPack_EP1 is used to build the bike?

 

That would make using it come with a price as you'd be restricted to carry an empty (re-spawning would give you an empty one, I guess) small backpack in lieu of a folding bike.

 

I'd certainly love a folding bike that you'd drop&pick up like a backpack :-)

Link to comment
Share on other sites

  • 3 weeks later...

 

You can do anything with right-click menus :)

class ExtraRc {
	class ItemToolbox {
		class DeployBike {
			text = "Deploy Bike";
			script = "execVM 'scripts\deploys\bike\deploy.sqf'";
		};
	};
	class ItemBloodbag {
		class Use {
            text = "Use Bloodbag";
            script = "execVM 'scripts\selfbloodbag\player_selfbloodbag.sqf'";
		};
	};
	class Binocular_Vector {
		class Use {
            text = "Set View Distance";
            script = "execVM 'scripts\viewdistance\viewdistance.sqf'";
		};
	};
	class Binocular {
		class Use {
            text = "Set View Distance";
            script = "execVM 'scripts\viewdistance\viewdistance.sqf'";
		};
	};
};

where do i put this option?

Link to comment
Share on other sites

  • 4 weeks later...

Can anyone tell me how one would need to change the snippets

...  && "ItemToolbox" in _weapons ...
... player addWeapon "ItemToolbox";

so instead of a toolbox a backpack, e.g. DZ_CompactPack_EP1 is used to build the bike?

 

That would make using it come with a price as you'd be restricted to carry an empty (re-spawning would give you an empty one, I guess) small backpack in lieu of a folding bike.

 

I'd certainly love a folding bike that you'd drop&pick up like a backpack :-)

 

 I too would like to change this, as it is overwriting the ability to use Origons Construction box.

Link to comment
Share on other sites

  • 2 weeks later...

I only used the deploy bike option on this in the past. Now I am trying to add the mozzie. I have all the parts required (I modified the list of required items) but the option isn't coming up on the scroll wheel. Here's the section of my fn_selfactions.sqf for the mozzie:

_weapons = [currentWeapon player] + (weapons player) + (magazines player);
_isMozzie = typeOf cursorTarget in ["CSJ_GyroC"];


//MOZZIE DEPLOY
if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "ItemPole" in _mags && "ItemPole" in _mags && "ItemPole" in _mags && "PartEngine" in _mags && "ItemCanvas" in _mags && "ItemCanvas" in _mags && "ItemJerrycan" in _mags && "PartVRotor" in _mags) then {
hasMozzieItem = true;
} else { hasMozzieItem = false;};
if((speed player <= 1) && hasMozzieItem && _canDo) then {
if (s_player_deploymozzie < 0) then {
s_player_deploymozzie = player addaction[("<t color=""#4eff00"">" + ("Deploy Mozzie") +"</t>"),"custom\deployables\mozzie\deploy.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymozzie;
s_player_deploymozzie = -1;
};


//PACK MOZZIE
if((_isMozzie && "ItemToolbox" in _weapons && (player distance cursorTarget < 10)) and _canDo) then {
if (s_player_deploymozzie2 < 0) then {
s_player_deploymozzie2 = player addaction[("<t color=""#4eff00"">" + ("Re-Pack Mozzie") +"</t>"),"custom\deployables\mozzie\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploymozzie2;
s_player_deploymozzie2 = -1;
};

*edit* If I only require the toolbox to build the mozzie, it works fine.

Link to comment
Share on other sites

While I don't see what's causing the option to not appear, your syntax of sequential && does not look for 3 poles and 2 canvas but will return true even if you only have 1 pole and 1 canvas.

I believe the question of multiples of the same classname has been raised and answered in this thread, before.

 

I don't see the definition of _mags. And the definition of _weapons has (magazines player) in it which strikes me as odd.

Link to comment
Share on other sites

While I don't see what's causing the option to not appear, your syntax of sequential && does not look for 3 poles and 2 canvas but will return true even if you only have 1 pole and 1 canvas.

I believe the question of multiples of the same classname has been raised and answered in this thread, before.

 

I don't see the definition of _mags. And the definition of _weapons has (magazines player) in it which strikes me as odd.

 

I just used the code in the original post, so I guess that is flawed. I'm looking at the right click deploy script instead of this one anyway.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 1 month later...

from player_build.sqf:

        _limit = 3;

        if (DZE_StaticConstructionCount > 0) then {
            _limit = DZE_StaticConstructionCount;
        }
        else {
            if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
                _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
            };
        };

        _isOk = true;
        _proceed = false;
        _counter = 0;

        while {_isOk} do {

            [10,10] call dayz_HungerThirst;
            player playActionNow "Medic";

            _dis=20;
            _sfx = "repair";
            [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
            [player,_dis,true,(getPosATL player)] spawn player_alertZombies;

            r_interrupt = false;
            r_doLoop = true;
            _started = false;
            _finished = false;

            while {r_doLoop} do {
                _animState = animationState player;
                _isMedic = ["medic",_animState] call fnc_inString;
                if (_isMedic) then {
                    _started = true;
                };
                if (_started && !_isMedic) then {
                    r_doLoop = false;
                    _finished = true;
                };
                if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
                    r_doLoop = false;
                };
                if (DZE_cancelBuilding) exitWith {
                    r_doLoop = false;
                };
                sleep 0.1;
            };
            r_doLoop = false;


            if(!_finished) exitWith {
                _isOk = false;
                _proceed = false;
            };

            if(_finished) then {
                _counter = _counter + 1;
            };

            cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"];

            if(_counter == _limit) exitWith {
                _isOk = false;
                _proceed = true;
            };

        };

if (_proceed) then {
//Deploy bike Code in here 
} else {

 r_interrupt = false;
            if (vehicle player == player) then {
                [objNull, player, rSwitchMove,""] call RE;
                player playActionNow "stop";
            };
 
            _tmpbuilt setPos[0,0,0];
            hideObject _tmpbuilt;
            deleteVehicle _tmpbuilt;
 
            cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
        };
Link to comment
Share on other sites

from player_build.sqf:

        _limit = 3;

        if (DZE_StaticConstructionCount > 0) then {
            _limit = DZE_StaticConstructionCount;
        }
        else {
            if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
                _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
            };
        };

        _isOk = true;
        _proceed = false;
        _counter = 0;

        while {_isOk} do {

            [10,10] call dayz_HungerThirst;
            player playActionNow "Medic";

            _dis=20;
            _sfx = "repair";
            [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
            [player,_dis,true,(getPosATL player)] spawn player_alertZombies;

            r_interrupt = false;
            r_doLoop = true;
            _started = false;
            _finished = false;

            while {r_doLoop} do {
                _animState = animationState player;
                _isMedic = ["medic",_animState] call fnc_inString;
                if (_isMedic) then {
                    _started = true;
                };
                if (_started && !_isMedic) then {
                    r_doLoop = false;
                    _finished = true;
                };
                if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
                    r_doLoop = false;
                };
                if (DZE_cancelBuilding) exitWith {
                    r_doLoop = false;
                };
                sleep 0.1;
            };
            r_doLoop = false;


            if(!_finished) exitWith {
                _isOk = false;
                _proceed = false;
            };

            if(_finished) then {
                _counter = _counter + 1;
            };

            cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"];

            if(_counter == _limit) exitWith {
                _isOk = false;
                _proceed = true;
            };

        };

if (_proceed) then {
//Deploy bike Code in here 
} else {

 r_interrupt = false;
            if (vehicle player == player) then {
                [objNull, player, rSwitchMove,""] call RE;
                player playActionNow "stop";
            };
 
            _tmpbuilt setPos[0,0,0];
            hideObject _tmpbuilt;
            deleteVehicle _tmpbuilt;
 
            cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
        };
I just take the test but no change ... I did something wrong? I added the lines as described starting from the same point that describes:
 
// Deploy Code bike in here
} Else {
 
  r_interrupt = false;
             if (player == vehicle player) then {
                 [objNull, player, rSwitchMove, ""] call RE;
                 player playActionNow "stop";
             };
 
             _tmpbuilt SetPos [0,0,0];
             hideObject _tmpbuilt;
             deleteVehicle _tmpbuilt;
 
             cutText [(locate "str_epoch_player_46"), "PLAIN DOWN"];
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
  • Advertisement
×
×
  • Create New...