Jump to content

A Mug of Water and ReplaceOnUse


kerbholz

Recommended Posts

I'm currently working on "Hot Drinks", a mod where you can make cups of coffee/tea. I've copied code from the "Make Hot Drink" recipe to my "Make a Cup of Tea" recipe and changed mine to use "A Mug of Water" instead of "Mugl" and "Water".

 

Recipe "Make Hot Drink":

recipe Make Hot Drink{	  Mugl,	  Water,	  Coffee/Teabag,	  Sugar,	  Result:Mugfulll,	  Time:70.0,}

 

My recipe "Make a Cup of Tea":

recipe Make Cup of Tea {        WaterMug,        Teabag,                Result:CuppaTea,        Time:70.0, }

 

 

The problem I'm facing is, when I actually "Make a Cup of Tea" in game, one "A Mug of Water" gets removed, but an "Empty Mug" gets added to my inventory. I'm just beginning modding, so I think this has to do with "ReplaceOnUseOn" or "ReplaceOnDeplete" from item "WaterMug" - but what do I know?

 

Is there any way to override this behaviour? So no empty mug gets added when making a cup of tea but still the Mug of Water can be used as desired?

 

Mod source can be found @GitHub

Link to comment
Share on other sites

Is it possible to change the mod to not require sugar to make a 'Hot Drink'. I regularly make coffee without sugar. Perhaps adding sugar could have an additional energy boost since sugar contains calories?

 

EDIT: I saw your post here http://theindiestone.com/forums/index.php/topic/10047-hot-drinks/ and I love the idea! I read this post before the above mentioned one. So disregard this comment :???:

Link to comment
Share on other sites

  • 3 weeks later...

The only thing I found was in [sTEAMFOLDER]\ProjectZomboid\media\scripts\items.txt:

item WaterMug{        IsWaterSource    =    TRUE,        Weight    =    0.2,        CanStoreWater    =    TRUE,        Type    =    Drainable,        UseWhileEquipped    =    FALSE,        UseDelta    =    1,        DisplayName    =    A Mug of Water,        ReplaceOnDeplete    =    Mugl,        ReplaceOnUseOn    =    WaterSource-WaterMug,        Icon    =    Mugl,}

Which I think won't help with your MIB :(

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...