Jump to content
  • 0

Change crafting recipes


Domian

Question

Hi. I am runing a small server and i want to change the default epoch crafting recipies on it. I'm using some custom mods (vehicles, weapons) so it's not a problem for clients to install a custom mod.

Is there a way to override a @DayZ_Epoch\addons\dayz_code\CfgMagazines.hpp with a custom one (for example in @Server_Custom_Mods\Addons\Custom_items) without changing any of @DayZ_Epoch files?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

actually you can change the recipes. this needs a missionconfigfile cfgmagazines.hpp and a right click script. also you need a custom player craftitem .sqf. in it you have to change the path to the cfgmagazines with the missionside version of it.

so lets say you want to change a recipe. you simply change the recipe in the cfgmagazines.hpp.

if you want to add a new recipe, you need to add it to the appropiate item in the cfgmagazines.hpp and call it via your custom rightclick file.  I have done this on my server and it works. also made a custom weapon upgrade script based on the epoch crafting system with this. You need to be sure, you added all items in the custom cfgmagazines.hpp, as they are spread around in various configfiles. so you dont get any errors while crafting. obviously you only need the ones, which are needed for crafting.

 

Edited by seelenapparat
Link to comment
Share on other sites

  • 0
Just now, seelenapparat said:

actually you can change the recipes. this needs a missionconfigfile cfgmagazines.hpp and a right click script. also you need a custom player craftitem .sqf. in it you have to change the path to the cfgmagazines with the missionside version of it.

so lets say you want to change a recipe. you simply change the recipe in the cfgmagazines.hpp.

if you want to add a new recipe, you need to add it to the appropiate item in the cfgmagazines.hpp and call it via your custom rightclick file.  I have done this on my server and it works. also made a custom weapon upgrade script based on the epoch crafting system with this. You need to be sure, you added all items in the custom cfgmagazines.hpp, as they are spread around in various configfiles. so you dont get any errors while crafting. obviously you only need the ones, which are needed for crafting.

 

Good to know, can be usefull. But i think in my case override the whole CfgMagazines.hpp file is faster and simplier way, because i alredy have custom mod folder on my server, and a new one is not a big deal.

Link to comment
Share on other sites

  • 0

Ok, I'm almost there, but need some help.  I have the @Server_Custom_Mods mod in server folder and in client folder. Server startup parametrs also got it:

-mod=@smd_sahrani_a2;@dayz_overwatch;@DayZ_Epoch;@DayZ_Epoch_Server;@Server_Custom_Mods;

Thers a Custom_items.pbo in @Server_Custom_Mods\addons folder that contain followinf files:

 

config.cpp

#include "CfgPatches.hpp"

#include "CfgVehicles.hpp"

 

CfgPatches.hpp

class CfgPatches {
    class Custom_items {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"dayz_code"};
    };
};

 

CfgMagazines.hpp 

class CfgMagazines {
    class CA_Magazine;    // External class reference

    class ItemWoodFloorHalf : CA_Magazine {
        scope = public;
        count = 1;
        type = 256;
        displayName = "Floor/Ceiling 1/2";
        model = "\z\addons\dayz_epoch\models\supply_crate.p3d";
        picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa";
        descriptionShort = "Wood Floor can also be used as a ceiling.";
        weight = 15;
        
        class ItemActions {
            class Build {
                text = $STR_ACTIONS_BUILD_EPOCH;
                script = "spawn player_build;";
                require[] = {"ItemToolbox"};
                create = "WoodFloorHalf_DZ";
            };
            
            class Crafting {
                text = $STR_EPOCH_PLAYER_232;
                script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
                neednearby[] = {"workshop"};
                requiretools[] = {"ItemToolbox"};
                output[] = {{"ItemWoodFloor", 1}};
                input[] = {{"ItemWoodFloorHalf", 2}, {"sc_nails", 1}};
            };
        };
    };

  (There's much more but 1 block is enough for example)

};

 

sc_nails is a new part of a recipe. the separate mod.pbo contain it and it's working fine.

Ok, now the problem part - when i connect to the server i've got error "Error: creating magazine ItemWoodFloorHalf with scope=private", and when the game started i cant see the items with edited code in my gear, but i can see them in my backpack and other containers.

 

So what am i doing wrong? Any ideas?

 PS. Spoilers not working(

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
  • Discord

×
×
  • Create New...