Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

jun_ran_cn

ask for help : How to disable recipes

Recommended Posts

You will need a mod in order to disable recipes. I don't know how much you know about modding, but in order to make a mod that disables recipes you will need two files:

1. Create a folder called DisableRecipes
2. In this folder you create a file called "Config.cpp". This file is basically just a description of your mod and what it requires.
3. Put this into that file:

class CfgPatches
{
	class DisableRecipies
	{
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = 
		{
		};
	};
};

class CfgMods
{
	class DisableRecipies
	{
		dir = "DisableRecipies";
		name = "DisableRecipies";
		type = "mod";
		dependencies[] = {"World"};
		
		class defs
		{
			class worldScriptModule
			{
				value = "";
				files[] = {"DisableRecipies/4_World"};
			};
		};
	};
};

4. In the same folder as the Config.cpp file is located in you create a new folder called "4_World"
5. Go into that folder and create a file called "DisableRecipies.c" (this file can be called whatever though, just an example). This is the file that does the actual disabling of recipes.
6. Put this into that file:

modded class PluginRecipesManager 
{
    override void RegisterRecipies()
    {
        super.RegisterRecipies();
        
        UnregisterRecipe("CraftWoodenCrate");
    }
}

7. Then you use DayZ Tools "DS Utils" to create a key for the mod and then "Addon Builder" to build the mod and finally "Publisher" to upload it to your Steam Workshop.

If you want to disable more recipes you can find all the vanilla recipes in the file "E:\DayZPDrive\scripts\4_world\classes\recipes\recipes\pluginrecipesmanagerbase.c" or wherever you extracted your game files in DayZ Tools, and then just add a new line for each recipe you want to disable below the line "UnregisterRecipe("CraftWoodenCrate"); like: 

UnregisterRecipe("CraftTorch");
UnregisterRecipe("CraftFireplace");
Etc

You can disable recipes from other peoples mods as well this way, you just need to make sure they are loaded first by adding their names to the "requiredAddons" section in the Config.cpp file above. You need to find that out from their own Config.cpp files which can be extracted using PBO Manager (https://github.com/winseros/pboman3). That file most likely also need to be unbinarized to be more easely read using the tool  "CfgConvert.exe" that comes with DayZ Tools like "CfgConvert.exe -txt -dst C:\Temp\config.cpp C:\Temp\config.bin" but thats a whole other can of worms that can be opened depending on how much work you want to put into it.
Then you need to find the name of their recipes as well, so you are going to need to dig into the code of the other files in the mod.

I know this requires some knowledge in mod making, but there are tutorials on youtube that covers this.

Edited by NoBeansForMe
  • Thanks 2

Share this post


Link to post
Share on other sites

×