SaintZ

Custom Crafting - Tutorial

38 posts in this topic

In this tutorial I'm going to show how to set up the Custom Crafting System already in place on Exile. This will make it so that you can craft whatever you want. With a few exceptions.

In your MpMissionsfile (Exile.YourMap) find your config.cpp.

In that file, right near the top, you'll find:

class CFGCraftingRecipes

This is where you can add your new Recipes. Just scroll down past:

Spoiler

class UpgradeToWoodWindow: Exile_AbstractCraftingRecipe
{
 name = "Upgrade to Wood Window";
 pictureItem = "Exile_Item_WoodWindowKit";
 requiredInteractionModelGroup = "WorkBench";
 returnedItems[] =
 {
  {1, "Exile_Item_WoodWindowKit"}
 };
 components[] =
 {
  {1, "Exile_Item_WoodWallKit"},
  {2, "Exile_Item_WoodPlank"}
 };
};

and add your Recipe. Now lets break down how to do this. It already gives you a decent breakdown within the CPP but we'll break it down further.

Spoiler

class Exile_AbstractCraftingRecipe // Name your Item class AxeCrafting
{
 name = ""; // Name that will appear in Recipe List
 pictureItem = ""; //Picture of the item (just the item name of whatever your making E.g. Exile_melee_Axe
 returnedItems[] = {}; // What item you get when all conditions are met(in our example....an axe)
 components[] = {}; // Required components needed to build the item (a metal pole and junk metal?)
 tools[] = {}; // Required tools (handsaw,screwdriver,matches, gas cooker etc.)
 requiredInteractionModelGroup = ""; // See CfgInteractionModels (control F in your config.cpp and type CfgInteractionModels)
 requiresOcean = 0; // Does the player have to be near a pond or ocean? Set to 1 if True 0 if False (I just remove it if false do what ya want)
 requiresFire = 0; // Does the player need to be near a fire source? Set to 1 if True 0 if False (I just remove it if false do what ya want)
};

Now lets look at an Example of how to make something, We'll make 4 Items, an Axe, bandage, Vishpirin, and an InstaDoc.

Spoiler

class Exile_melee_Axe: Exile_AbstractCraftingRecipe //Here we Changed the class name to Exile_melee_Axe
{
    name = "Craft Axe";                                                           //Names in the Recipe
    pictureItem = "Exile_melee_Axe";                                 //What Picture the item will use
    requiredInteractionModelGroup = "WorkBench";  //Must have a work bench in order to build it (I don't think u should have one but for tutorial sake)
    returnedItems[] =
    {
        {1, "Exile_melee_Axe"}                //What item is returned
    };
    components[] =
    {
        {2, "Exile_Item_JunkMetal"},    //the 2 is how many and the Exile_Item_JunkMetal is what item
        {1, "Exile_Item_WoodLog"}     //Same as above (no coma though, its the end of the item list. Lose coma's sink servers.
    };
};

 

class CraftBandage: Exile_AbstractCraftingRecipe
{
    name = "Craft Bandage";
    pictureItem = "Exile_Item_Bandage";
    returnedItems[] =
    {
        {1, "Exile_Item_Bandage"}
    };
    components[] =
    {

        {2, "Exile_Item_ToiletPaper"}
       
    };
};
 
class CraftVishpirin: Exile_AbstractCraftingRecipe //New class name (Craft Vishpirin)
{
    name = "Craft Vishpirin"; //Name Shown
    pictureItem = "Exile_Item_Vishpirin"; //Picture Shown

    requiresFire = 1 // Lets make this one need a fire (just for tutorial sake, you can set to 0 or delete this line)
    returnedItems[] =
    {
        {1, "Exile_Item_Vishpirin"}
    };
    components[] =
    {

        {5, "Exile_Item_Bandage"}
       
    };
};
 
class CraftInstaDoc: Exile_AbstractCraftingRecipe
{
    name = "Craft InstaDoc";
    pictureItem = "Exile_Item_InstaDoc";
    returnedItems[] =

    requiresFire = 1;
    requiredInteractionModelGroup = "WorkBench";  // This one requires a fire and a work bench
    {
        {1, "Exile_Item_InstaDoc"}
    };
    components[] =
    {

        {4, "Exile_Item_Vishpirin"}
       
    };
};
};

Something to keep in mind when going crazy with your new found crafting powers. Don't make something that wont fit on your person. By on your person I mean within your backpack clothes or whatever. So basically don't try to have your player craft a car or a gun that cant fit in a backpack. Also I haven't been able to get tents to work...

Other than that have fun and BE CREATIVE. I've got loads of craftables on my server.Why am I not listing how to craft them here? BECAUSE I WANT YOU TO BE CREATIVE!!!

Things to craft on my server

IEDS (all Shapes and Sizes)

Able to dump your water out of your bottle

Able to make grenades (all shapes and sizes lol)

make different ammo

build a safe

make a can opener

a cooking pot

nvg's

binoculars

and that's just a few. The more fun you have with your server the more fun your players will have.

If you want to check these out on my server (its a new server so its low pop, my other servers don't have the custom crafting on them because they are more of a straight up war and pew pew pow pow kill than a survival server.

DoWG Exile Chernarus|Custom Crafting|5k Start|CupWeps|CupVehicles|CupUnits|HLC ModSet|

199.168.142.169:2312

7 people like this

Share this post


Link to post
Share on other sites

What do you think about using this mechanism to "split" ammo into mags. Like in Dayz Mod where you could split DMR mags into M24 mags?

Say maybe Breaking a 150 round belt of 7.62 for the zafir into some 20rnd EBR/Mk14 mags, Requiring Scrap metal for the new mags. Or maybe SMG mags into 9mm/.45 pistol magazines (or the reverse)

Maybe suppressors from duct tape, tin can/water bottle. Come to think of it theres quite a lot of useful items that could be made very rare in loot spawns that may be crafted instead. Might help to increase the players need to travel and loot various areas to build up kit they want instead of just hitting up Pygros mil base after spawning.

Share this post


Link to post
Share on other sites
Advertisement

Hi i found your Thread and i like it but if i wanna add a cooking pot or some other recipe i  cant craft any of my stuff ! no bandage, no Beer, backpack ect. I can only add your stuff and it works without problems.

 

I will show you my cooking pot stuff so hopefully someone can help me with this problem !

 

 

class Exile_Item_CookingPot: Exile_AbstractCraftingRecipe
{
    name = "Craft Cooking Pot";
    pictureItem = "Exile_Item_CookingPot";
    returnedItems[] =
    {
        {1, "Exile_Item_CookingPot"}
    };
	tools[] = 
	{
		{1, "Exile_Item_Pliers"}
	};
    components[] =
    {

        {4, "Exile_Item_Can_Empty"}
       
    };

};

 

Bandage , Visphirin and InstaDoc works perfect but my recipes  wont work.

if someone find the problem it will nice to know. Thx for your help guys and sorry for my bad english. -.-

 

 

This is a short line out of my Code !

class CraftBandage: Exile_AbstractCraftingRecipe
{
    name = "Craft Bandage";
    pictureItem = "Exile_Item_Bandage";
    returnedItems[] =
    {
        {1, "Exile_Item_Bandage"}
    };
    components[] =
    {
        {2, "Exile_Item_ToiletPaper"}  
    };
};

class CraftVishpirin: Exile_AbstractCraftingRecipe 
{
    name = "Craft Vishpirin"; 
    pictureItem = "Exile_Item_Vishpirin"; 

    returnedItems[] =
    {
        {1, "Exile_Item_Vishpirin"}
    };
    components[] =
    {

        {3, "Exile_Item_Bandage"}
       
    };
};

class CraftInstaDoc: Exile_AbstractCraftingRecipe
{
    name = "Craft InstaDoc";
    pictureItem = "Exile_Item_InstaDoc";
    requiresFire = 1;
    requiredInteractionModelGroup = "WorkBench";
    returnedItems[] =	
    {
        {1, "Exile_Item_InstaDoc"}
    };
    components[] =
    {

        {4, "Exile_Item_Vishpirin"}
       
    };
};

/*
class Exile_Item_CookingPot: Exile_AbstractCraftingRecipe
{
    name = "Craft Cooking Pot";
    pictureItem = "Exile_Item_CookingPot";
    returnedItems[] =
    {
        {1, "Exile_Item_CookingPot"}
    };
	tools[] = 
	{
		{1, "Exile_Item_Pliers"}
	};
    components[] =
    {

        {4, "Exile_Item_Can_Empty"}
       
    };

};
*/

the /* and */ just to mark my problem :)

Bandage , Visphirin and InstaDoc works perfect but my recipes  wont work.

if someone find the problem it will nice to know. Thx for your help guys and sorry for my bad english. -.-

Share this post


Link to post
Share on other sites

class CraftBushKitGreen: Exile_AbstractCraftingRecipe
{
    name = "Craft a Bush Kit (Green)";
    pictureItem = "Exile_Item_BushKit_Green";
    requiredInteractionModelGroup = "WorkBench";
    returnedItems[] = 
    {
        {1, "Exile_Item_BushKit_Green"}
    };
    components[] = 
    {
        {10, "Exile_Item_Leaves"},
        {5, "Exile_Item_WoodSticks"},
        {1, "Exile_Item_Rope"}
    };
};

where i can config  Exile_Item_Leaves and Exile_Item_WoodSticks  can  drop when I hit tree

Share this post


Link to post
Share on other sites

I do not know if this is helpful but this is a short little tool i put together to create crafting 

http://pastebin.com/PbRG6Dgd

 

I figured this may be helpful for some people that are going to make there own crafts

1 person likes this

Share this post


Link to post
Share on other sites
On 1/18/2016 at 8:35 PM, Ronduth said:

I do not know if this is helpful but this is a short little tool i put together to create crafting 

http://pastebin.com/PbRG6Dgd

 

I figured this may be helpful for some people that are going to make there own crafts

Crafting has me stymied at the moment. It should not, because it looks simple enough. Either the server will not run when I add custom recipes or it runs and no recipes will work, Including the standard Exile recipes. I added your example recipe for NV Goggles and the server will run, but all recipes are broken. I added it to the end of the standard Exile recipes. BTW, thanks for the tool. It is very helpful.

Spoiler

class NightVision: Exile_AbstractCraftingRecipe
{
    name = "Nightvision";  //What i the name of your crafting? use the name ingame that you want
    pictureItem = "NVGoggles"; //must be an item already in game
    requiresFire = 1;  //does it require a fire to build? yes or no
    returnedItems[] =
    {
        {1, "NVGoggles"} // This is what will be crafted (must be ingame item)
    };
    tools[] =  // This is a tool you need to perform the craft
    {
        {1, "Exile_Item_MetalWire"}, // 1 is the quantity, item is an ingame item
        {1, "Exile_Item_Pliers"},  // 1 is the quantity, Item is an ingame item
        {1, "Exile_Item_Grinder"} //This is the last item so you need the commma (,)
    };
    components[] =//Items below are needed to do the crafting
    {
        {1, "Exile_Item_MetalWire"},// 1 is the quantity, Item is an ingame item
        {1, "Exile_Item_MetalBoard"},// 1 is the quantity, Item is an ingame item
        {1, "Exile_Item_JunkMetal"}//This is the last item so you need the commma (,)
    };
};

 

Share this post


Link to post
Share on other sites
16 minutes ago, CEN said:

MetalWire is not a tool

Yes, I copied the code directly from the authors example. I noticed the error when I added the recipe to my config file and changed it so that MetalWire was only listed as a component and not a tool. The server started okay, but then all the recipes would not work at all.

Share this post


Link to post
Share on other sites

Okay, I have the custom recipes working now. Mistakes in a couple of examples were throwing me off. When I compared them to the standard Exile recipes I noticed the errors/omissions.

1 person likes this

Share this post


Link to post
Share on other sites

Anyone know what the correct picture item name is for the axe? I can craft it, but there is no picture in the recipe dialog. I'm using the class name for the axe like this:

pictureItem = "Exile_Melee_Axe";

When I click on one of the components in my inventory to craft the axe, the recipe is simply "Craft Axe" without the picture of the axe.

o.O.

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.