Inkko
Valued Member!
Client Sided Crafting
v.01a
v.01a
This moves over the built in crafting system in DayZ 1.8.1 (works with 1.8.0.3 as well) and allows you to modify, add, or remove recipes from the built in crafting system.
Requirements (PBO Manager and Notepad ++ recommended)
- Moderate = Orange >10 < 30 (may take longer if you decide to create your own recipes)
Installation Steps:
If you have a custom compiles you can skip to 6.
1. In your mission folder open init.sqf and find this:
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
And change it to:
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf";
2. Create a new folder in your mission pbo called custom.
3. Unpack your local dazy_code.pbo and find the compiles.sqf (located in the init folder).
4. Copy and paste the compiles.sqf to your mission pbo into the new custom folder you created.
**5. If you do not have your dayz_code.pbo unpacked do so. Find these 3 files and copy them player_craftitemGUI.sqf (located in actions folder), player_checkRecipe.sqf (located in actions folder), fn_updateCraftUI.sqf (compiles folder),and CfgCrafting folder (located in Configs folder).
**Step was updated, I forgot a portion.
6. Paste all the files into your mission pbo in the custom folder.
**7. Open up your custom compiles.sqf and find this:
Code:
fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf";
player_craftItemGUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemGUI.sqf";
player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
Change it to:
Code:
fn_updateCraftUI = compile preprocessFileLineNumbers "custom\fn_updateCraftUI.sqf";
player_craftItemGUI = compile preprocessFileLineNumbers “custom\player_craftItemGUI.sqf";
player_checkRecipe = compile preprocessFileLineNumbers “custom\player_checkRecipe.sqf";
** Step was updated, I forgot a portion.
^8. Open up fn_updateCraftUI.sqf and find this chunk of code:
Code:
_config = configFile >> "CfgCrafting";
Change it to this:
Code:
_config = missionconfigFile >> "CfgCrafting";
9. Open your description.ext and at the top add this:
Code:
#include "custom\CfgCrafting\CfgCrafting.hpp"
10. Open up player_checkRecipe.sqf and look for this:
Code:
_config = configFile >> "CfgCrafting";
And change it to this:
Code:
_config = missionconfigFile >> "CfgCrafting";
Once this step is completed you now have the crafting system mission sided.
Additional Instructions:
If you wish to modify current recipes, locate the recipe and change it how you desire.
If you wish to remove recipes, open up CfgCrafting.hpp and comment out the lines (//) or delete the line entirely.
If you wish to create a new recipe, open up CfgCrafting.hpp and add a new #include. The order it will show up in the crafting menu is determined on where it is included in the CfgCrafting.hpp.
**If you want to create vehicles that can be crafted you need to change something in player_craftitemGUI.sqf**
For Vehicle craftables look at this spoiler:
For vehicle crafting in player_craftitemGUI.sqf find this:
and change it to this:
Code:
{
switch (_selection) do {
case "CfgWeapons":
{
player addWeapon _item;
};
case "CfgMagazines":
{
player addMagazine _item;
};
case "CfgVehicles":
{
player addBackpack _item;
};
};
Code:
switch (_selection) do {
case "CfgWeapons":
{
player addWeapon _item;
};
case "CfgMagazines":
{
player addMagazine _item;
};
case "CfgVehicles":
{
_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_veh = createVehicle [_item, _mypos,[],0,"CAN_COLLIDE"];
_veh setposATL _mypos;
_veh setDir _dir;
_veh setVariable ["Mission",1,true];
_veh setfuel 0.2;
cutText [format["Warning: '%1' will not save after server restart!",_itemName,3], "PLAIN DOWN"];
};
};
EX:
If you wish to create a craftable bike, in CfgCrafting.hpp near the end you could add #include "Recipes\Other\Bike.hpp"
Then in the folder Other (custom\CfgCrafting\Recipes\Other) create a new file named Bike.hpp.
The file should be setup as so:
Code:
class Bike : Recipe {
displayName = Bike;
descriptionShort = Bike;
input[] =
{
{"PartGeneric","CfgMagazines",1}
};
output[] =
{
{"Old_bike_TK_INS_EP1","CfgVehicles",1}
};
required[] =
{
{"ItemToolbox","CfgWeapons",1}
};
};
Other examples of custom craftables:
This recipe has 2 variations in it:
This recipe has 2 different variations in it:
Code:
class M9_to : Recipe {
displayName = "M9 to M9SD ammo";
input[] =
{
{"15Rnd_9x19_M9","CfgMagazines",1}
};
output[] =
{
{"15Rnd_9x19_M9SD","CfgMagazines",1}
};
required[] =
{
};
};
class M9SD_to : Recipe {
displayName = "M9SD to M9 ammo";
input[] =
{
{"15Rnd_9x19_M9SD","CfgMagazines",1}
};
output[] =
{
{"15Rnd_9x19_M9","CfgMagazines",1}
};
required[] =
{
};
};
Code:
class Stanag_to : Recipe {
displayName = "Stanag to StanagSD";
input[] =
{
{"30Rnd_556x45_Stanag","CfgMagazines",1}
};
output[] =
{
{"30Rnd_556x45_StanagSD","CfgMagazines",1}
};
required[] =
{
};
};
class StanagSD_to : Recipe {
displayName = "StanagSD to Stanag";
input[] =
{
{"30Rnd_556x45_StanagSD","CfgMagazines",1}
};
output[] =
{
{"30Rnd_556x45_Stanag","CfgMagazines",1}
};
required[] =
{
};
};
Code:
class NVG_Craft : Recipe {
displayName = "NVGS";
input[] =
{
{"Binocular","CfgWeapons",1},
{"equip_rail_screws","CfgMagazines",1} //Don't think this item is available ingame unless your force it in via custom loot tables. Change this is you want to use this recipe.
};
output[] =
{
{"NVGoggles","CfgWeapons",1}
};
required[] =
{
{"ItemToolbox","CfgWeapons",1}
};
};
Credit goes where it should, all files came from dayz_code. Any recipes I guess would go to the creator?
If you have any additions or improvements on this script please post them, if you have any recipes you'd like to share please share them.

Discussion: http://opendayz.net/threads/mission-sided-crafting-menu-1-8-1.20773/
Here is what my files look like, please note I have my files setup differently then the tutorial:
https://www.dropbox.com/sh/95y5pafiz6kz42x/AACYRDk7PdVohWHjM07KgFbra?dl=0
Last edited: