Jump to content

Add more craftable items?


tigger

Recommended Posts

How difficult would it be to add more craftable items? (Basically editing CfgMagazines.hpp)

It would be nice to be able to add more stuff, either craftable or just build-able, like basic furniture and eye candy that has Arma models.

 

For instance, the park bench looks like this:

    class park_bench_kit: CA_Magazine
    {
        scope = 2;
        count = 1;
        type = 256;
        displayName = "Wood Bench";
        descriptionShort = "Wood Bench";
        model = "\z\addons\dayz_epoch\models\supply_crate.p3d";
        picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa";
        weight = 25;
        class ItemActions
        {
            class Build
            {
                text = $STR_ACTIONS_BUILD;
                script = "spawn player_build;";
                require[] = {"ItemEtool","ItemToolbox"};
                create = "ParkBench_DZ";
            };
        };
    };

 

Can I just add a custom CfgMagazines.hpp and add some arma .p3ds to mission file to make additional buildables?

Link to comment
Share on other sites

To change HPP files you need to change Config.cpp, and to change Config.cpp means you need to change Config.bin which is impossible unless you want every user who comes to your server to have your custom files installed on their computer.

 

What you can do is use Maca's extended right click to add options to the currently existing items to allow you to make crafting recipes to change them to other items. I have this on a server I help develop for allowing users with a toolbox and scrap metal to turn an M4 into say an M4A1 CCO. All the code actually does is change out the item classname.

Link to comment
Share on other sites

https://community.bistudio.com/wiki/Description.ext

The Description.ext file sets the overall mission attributes, and defines some global entities that will be available to other scripts. It is placed in mission's root folder. It uses the same syntax and structure as the Config.cpp file, but supports only a limited number of the full set of Config.cpp classes. Many, such as CfgVehicles, won't work.

Link to comment
Share on other sites

We welcome pull requests to add new crafting items as long as the item works and the recipe makes sense.

https://github.com/vbawol/DayZ-Epoch/

 

I have a small private server, I'm not sure to what extent you would want to pollute the main codebase with useless furniture. (Although, it can exist without a way to craft it, like park_bench_kit)

 

 

So I can just add it to Description.ext? I could try that...

Link to comment
Share on other sites

 

Actually, it says no CfgVehicles which is where the model description resides for Park_bench

 

        class Park_bench1;
        class ParkBench_DZ: Park_bench1
        {
                scope = 2;
                offset[] = {0,1.5,0.5};
                displayName = "Wood Bench";
                vehicleClass = "Fortifications";
                removeoutput[] = {{"park_bench_kit",1}};
        };
Link to comment
Share on other sites

No, this has to be changed in the client files, which means that either the Epoch Devs have to add it for everyone or you have to send the custom @dayz_epoch to all your players.

 

I would give the said .pbo to all my players, I already do that for a number of vehicles/etc. Suppose I make a pbo and into it's config.cpp

I add class CfgVehicles {...} and class CfgMagazines {...}. Wouldn't that work?

 

Edit:

Say if I make a something.pbo that contains just one file, a config.cpp with: (modified bench code)

class CfgPatches {
        class furniture {
                units[] = {"WoodChair_DZ"};
                weapons[] = {};
                requiredVersion = 1;
                requiredAddons[] = {};
                version = 1;
        };
};


class CfgVehicles {
    class WoodChair;
    class WoodChair_DZ: WoodChair
    {
        scope = 2;
        offset[] = {0,1.5,0.5};
        displayName = "Wood Chair";
        vehicleClass = "Fortifications";
        removeoutput[] = {{"wood_chair_kit",1}};
    };
};

class CfgMagazines {
    class park_bench_kit: CA_Magazine
    {
        scope = 2;
        count = 1;
        type = 256;
        displayName = "Wood Chair";
        descriptionShort = "Wood Chair";
        model = "\z\addons\dayz_epoch\models\supply_crate.p3d";
        picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa";
        weight = 10;
        class ItemActions
        {
            class Build
            {
                text = $STR_ACTIONS_BUILD;
                script = "spawn player_build;";
                require[] = {"ItemEtool","ItemToolbox"};
                create = "WoodChair_DZ";
            };
        };
    };
};
 
 
Link to comment
Share on other sites

Well it almost works. I can craft it, then I place it, it starts building it but once it finishes the build animation, it disappears.

 

Edit2: I need to add it to dayz_allowedObjects, then it works. Just by

dayz_allowedObjects = dayz_allowedObjects + ["WoodChair_DZ"];
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
  • Discord

×
×
  • Create New...