Jump to content

[Release] Deploy Bike Extendet


oOSmokyOo

Recommended Posts

Hello Community, i have built something.

 

Deploy Bike Extendet       [updated 02.04.2014]

(Tested on DayZ Epoch 1.0.4.2a with  infiStar Antihax )

 

With this Script you can deploy Bike, Moped, Mozzie and a Little Bird!

 

 

Quick Install Instructions:

 

1.Download and unpack the attacht Zip Archive.

 

 

2. Open your Mission.pbo and copy the deployables folder in it.

 

 

3. Open your "Custom" variables an find this line:

DZE_safeVehicle = ["ParachuteWest","ParachuteC"];

and replace with this:

DZE_safeVehicle = ["MH6J_EP1","CSJ_GyroC","TT650_Civ","MMT_Civ","ParachuteWest","ParachuteC"];​

repack your Custom varibles.sqf

 

 

4. Open your custom fn_selfActions.sqf and ad at the VERY BOTTOM this:

//--------------------------------------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 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 && (player distance cursorTarget < 10)) and _canDo) 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 _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----------------------------------------​

Repack your Custom fn_selfActions.sqf

 

Upload your Mission.pbo to your Server.

 

Restart your Server and have Fun  ;)

 

 

Deploy Recipes:

 

 

Bike:

  • 1x Part Generic
  • 2x Part Wheel

 

Moped:

  • 2x Part Generic
  • 2x Part Wheel
  • 1x Engine Part

 

Mozzie:

  • 2x Part Generic
  • 1x Part Engine
  • 1x Item Jerrycan (Full)
  • 1x Main Rotor

Little Bird:

  • 2x Scrap Metall
  • 2x Glass
  • 1x Engine Part
  • 1x Fuel Tank
  • 1x Main Rotor
  • 1x Fuel Barrel (Full)

​All Deployed Vehicles will be deleted after the next server restart!

 

 

Special Thanks to /index.php?/user/4305-cen/">cen for better pack.sqf 

/applications/core/interface/file/attachment.php?id=442">deployables.zip

deployables.zip

Link to comment
Share on other sites

This is a much better method for 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 == "Old_bike_TK_INS_EP1" || typeOf cursorTarget == "Old_bike_TK_CIV_EP1") 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 toolbox"], "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"];
	};
};
Link to comment
Share on other sites

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'";
		};
	};
};
Link to comment
Share on other sites

 

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'";
		};
	};
};
Link to comment
Share on other sites

hi i have a couple of questions

 

for the bike if i wanted it to just require a tool box in you gear would i change it to this

 

if ("ItemToolbox" in _weapons) then {               rather than         if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartWheel" in _mags && "PartWheel" in _mags) then {

 

and how would i get it to make the little bird stay after restart? wouldnt want people to put alot of work into finding parts just for it to vanish on restart

 

cheers

Link to comment
Share on other sites

Hi, for Deploy Bike only with Toolbox do this:

 

 

Open your fn_selfActions.sqf find this line:

if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartWheel" in _mags && "PartWheel" in _mags) then {

chhange to this:

if ("ItemToolbox" in _weapons) then {

Open your pack.sgf from Bike and change this:

player addMagazine "PartGeneric";
player addMagazine "PartWheel";
player addMagazine "PartWheel";

to this:

player addWeapon "ItemToolbox";

Open your deploy.sqf from Bike and change this:

player removeMagazine "PartGeneric";
player removeMagazine "PartWheel";
player removeMagazine "PartWheel";

to this:

player removeWeapon "ItemToolbox";
Link to comment
Share on other sites

I might be wrong since my ARMA scripting skills are non existing, but will this script work if you don't already have Self Blood Bag installed?

Won't you need

_mags = magazines player;

somewhere in there? Or is this variable in some way populated from

_weapons = [currentWeapon player] + (weapons player) + (magazines player);

 

Anyways, I've added building bike and gyro to Toolbox right-click menu, but I haven't gotten the check for needed items to work when running from the deploy script. Anyone got this working?

Link to comment
Share on other sites

Hello Community, i have built something.

 

Deploy Bike Extendet       [updated 02.03.2014]

(Tested on DayZ Epoch 1.0.4.2a and Temporary vehicles despawning/blowing up fix)

 

With this Script you can deploy Bike, Moped, Mozzie and a Little Bird!

 

 

Quick Install Instructions:

 

1.Download and unpack the attacht Zip Archive.

 

 

2. Open your Mission.pbo and copy the deployables folder in it.

 

 

3. Open your "Custom" variables an find this line:

DZE_safeVehicle = ["ParachuteWest","ParachuteC"];

and replace with this:

DZE_safeVehicle = ["MH6J_EP1","CSJ_GyroC","TT650_Civ","MMT_Civ","ParachuteWest","ParachuteC"];​

repack your Custom varibles.sqf

 

 

4. Open your custom fn_selfActions.sqf and ad at the VERY BOTTOM this:

//--------------------------------------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) 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 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) and _canDo) 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 _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) 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) 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----------------------------------------​

Repack your Custom fn_selfActions.sqf

 

Upload your Mission.pbo to your Server.

 

Restart your Server and have Fun  ;)

 

 

Deploy Recipes:

 

 

Bike:

  • 1x Part Generic
  • 2x Part Wheel

 

Moped:

  • 2x Part Generic
  • 2x Part Wheel
  • 1x Engine Part

 

Mozzie:

  • 2x Part Generic
  • 1x Part Engine
  • 1x Item Jerrycan (Full)
  • 1x Main Rotor

Little Bird:

  • 2x Scrap Metall
  • 2x Glass
  • 1x Engine Part
  • 1x Fuel Tank
  • 1x Main Rotor
  • 1x Fuel Barrel (Full)

​All Deployed Vehicles will be deleted after the next server restart!

 

 

Special Thanks to cen for better pack.sqf 

 

i have another mod that says i need to post something at the VERY BOTTOM as well. any way around this?

Link to comment
Share on other sites

i have another mod that says i need to post something at the VERY BOTTOM as well. any way around this?

 

At the "VERY BOTTOM" just means at the end of the file, this is so you don't accidently put it in a loop or that it gets called before anything else. You can have multiple scripts with calls at the bottom of a file.

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