How to change / tweak existing recipes
0

7 posts in this topic

Recommended Posts

Hi all

Quite new at programming for Zomboid but I have to start somewhere so sorry for the stupid questions. My firts hopefully small goal is that I want to be able to write a small mod that changes recipes already in the game. That beeing either adding items keept after crafting or new items gotten after dismantling something. I've figured out how to alter the standard game files to achieve my goals but for the sake of learning i would love to gain the knowledge how to make this into a mod so it can be shared with everbody. 

So my question is how do i write a script that tweaks / changes already excisting recipes in the game ??

Share this post


Link to post
Share on other sites

Build 36 Update notes
 

  • [MODDERS] You can now override recipes, just make a new recipe with the same name than the one you want to override and add a Override:true

 

 

To be honest I haven't tried it myself but it would probably look more/less like this in a recipe script (use 15 nails instead of 5)

 

recipe Build Spiked Baseball Bat
    {
       BaseballBat,
       Nails=15,
       keep Hammer/HammerStone,

 

       Result:BaseballBatNails,
       Sound:PZ_Hammer,
       Time:150.0,
       Category:Carpentry,
       OnCreate:SpikedBat_OnCreate,
       Override:true,
    }

Bolded text is what's different from original recipe in Recipes.txt

Edited by Svarog

Share this post


Link to post
Share on other sites
On 29/7/2017 at 2:37 PM, DenBaron said:

Thanks! i'll have to look through update notes more thoroughly. I've probobly missed more very important modder updates like this.

 

This feature only worked if you play the game on english language!! ;)

Share this post


Link to post
Share on other sites

There is something very weird going on with this Override thing. I was really happy to find out there's way to override recipes but seems like some of them are hard coded or something!?

 

I was succesfully able to override 9mm and shotgun shells to be my mod versions, but 308 and 223 recipes are duplicated no matter what i do, i've changed names of bullets and bulletboxes and done now all tricks and still circling around the same problem. This is about to drive me crazy, added code from my script file (made fully own for it) and screenshots to show there's still double recipes even there's override.

 

module Base
{
	imports 
	{
	PZExpanded
	}

	
	recipe Open Box of .308 Ammo
    {
	AmmoBox308Win,

	Result:Win308Bullets=32,
	Sound:PZ_PutInBag,
	Time:5.0,
	Override:true,
    }
	
	recipe Place .308 Ammo in Box
    {
	Win308Bullets=32,

	Result:AmmoBox308Win,
	Sound:PZ_PutInBag,
	Time:20.0,
	Override:true,
    }
	
	recipe Open Box of .223 Ammo
    {
	AmmoBox223Rem,

	Result:223RemBullets=40,
	Sound:PZ_PutInBag,
	Time:5.0,
	Override:true,
    }
	
	recipe Place .223 Ammo in Box
    {
	223RemBullets=40,

	Result:AmmoBox223Rem,
	Sound:PZ_PutInBag,
	Time:20.0,
	Override:true,
    }
	
	recipe Open Box of 9mm Bullets
    {
	AmmoBox9x19mm,

	Result:9x19mmBullets=60,
	Sound:PZ_PutInBag,
	Time:5.0,
	Override:true,
    }
	
	recipe Place 9mm Bullets in Box
    {
	9x19mmBullets=60,

	Result:AmmoBox9x19mm,
	Sound:PZ_PutInBag,
	Time:20.0,
	Override:true,
    }

    recipe Open Box of Shotgun Shells
    {
	AmmoBox12GBuckshot,

	Result:12GBuckshots=28,
	Sound:PZ_PutInBag,
	Time:5.0,
	Override:true,
    }
	
    recipe Place Shotgun Shells in Box
    {
	12GBuckshots=28,

	Result:AmmoBox12GBuckshot,
	Sound:PZ_PutInBag,
	Time:20.0,
	Override:true,
    }
	
	recipe Saw Off Shotgun
	{
	DoubleBarrelShotgun,
	keep Saw,

	Result:SawnOffDoubleBarrel,
	Sound:PZ_Saw,
	Time:200.0,
	Override:true,
	}

    recipe Gather Gunpowder
    {
	9x19mmBullets/12GBuckshots/223RemBullets/Win308Bullets/338Bullets/556Bullets/762Bullets,

	Result:GunPowder,
	Time:30.0,
	Override:true,
    }
	
}

 

 

 

308.jpg

 

Edited by BudeRoy

Share this post


Link to post
Share on other sites

I've noticed that Override:true, can be used also to override base items. There's also Obsolete:true, to remove whole recipe.

But the problem i'am issued with is 99% surely caused by the name of recipe. I can override all other recipes without any issues except these two which are inclued with . [dot] in it's name. That . must somehow break the override process.

Share this post


Link to post
Share on other sites

I am trying to override the Wash Clothes recipie but it is not working. :/ What did i do wrong?

 

recipe Wash Clothing
    {
       	keep Vest/Shirt/Trousers/Skirt/Blouse/Underwear1/Underwear2/HCScavangeshroud/HCRaincoat/HCRainponcho/HCMexicanponcho/HCDownjacket/HCButtondownshirt/HCPoloshirt/HCTshirt/HCTiedyeshirt/HCHawaiianshirt/HCLifevest/HCLinenshirt/HCLinenpants/HCSilkshirt/HCSilkpants/HCWoolshirt/HCWoolpants,
       	Soap2/HCSoap/HCCleanerall/HCCleanerfabric/HCFabricsoftener/HCHandsoap/HCShampoo,
       	Water=3,
       	Result:Vest,
       	OnTest:WashClothing_TestIsValid,
       	Time:1000.0,
       	OnCreate:WashClothing_OnCreate,
       	RemoveResultItem:true,
    	Category:Weaving,
       	Override:true,
    }

 

Share this post


Link to post
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
0