Jump to content

Possibility to overwrite Base items/recipes ?


r0land

Recommended Posts

Hi

I want add properties to some base-items. For example: If eating food from an open can or something like popcorn, cereals.. or whatever has a packaging or can.. this package should be added to the inventory for later usage.

But I have two problems here:

1) The items are Base items and I don't know how to overwrite those items or how to add there new properties.

2) I don't know which keyword I am searching for.. maybe ReplaceOnUse, Result (from recipes).. or whatever else?

Any ideas?

Greetings

Link to comment
Share on other sites

This is where the base recipes are stored (items.txt is in the same folder);

 

Steam\steamapps\common\ProjectZomboid\media\scriptsrecipes.txt

 

You will then see a recipe like this;

recipe Open Canned Soup    {       TinnedSoup,       keep TinOpener,       Result:TinnedSoupOpen,       Time:10.0,    }

However, if you wish to create the same recipe but with the packaging as an extra result, you will need to revert to the answer here

Further note, to get this to work with base items/recipes including the lua file I recommend searching for the post by the user psykikk

He/she has a 'boxing' mod created that is similar to what you mentioned, I can't find the specific post he wrote it in but you should be able to find it on his profile.

I hope this is of some help, and best of luck!
 

Link to comment
Share on other sites

Thank you!

 

I didn't find psykikk's box mod but I found another topic about changing recipes: http://theindiestone.com/forums/index.php/topic/7045-recipes-with-more-results/

 

The lua idea is nice:
 

function AnotherResult(_crafttool,_resultItem,_recipe)  if _recipe =="Wring Wet Bath Towel into Bowl" then      getPlayer():getInventory():AddItem("Base.BathTowel")  endendEvents.OnMakeItem.Add(AnotherResult)

OnMakeItem is triggered by using recipes? I need this for using food/items. Could be that OnMakeItem will trigger eating PotOfSoup too because this item comes with ReplaceOnUse=Pot.

 

The food/items I would like to change don't have ReplaceOnUse. So I would need something like OnUsingItem, OnEat, OnDestroy or OnRemove..

 

But I cannot find that here: http://pz-mods.net/guide/event-reference/

 

Is there any chance to trigger OnUse or OnEat by lua events which gives me the item-name? Or is it possible to trigger the HungerChange of the char?

 

If not.. I could implement a new recipe "Eat & Recycle" (if this is possible) which gives me the package back. But this looks somehow silly/double from my point of view ("Eat" + "Eat & Recycle").

 

Do you have any other ideas?

 

 

Greetings

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
×
×
  • Create New...