Jump to content
Rodjah

Creating new Food Recipes

Recommended Posts

I've tried to figure out this last weeks on how the food system works in the game. I started with a simple food item, but when I wanted to make a step to step recipe, I noticed that is not as simple as it looks. I'm still complicated to change the display food icon, after testing many times the MinutesToBurn and DaysTotallyRotten parameter, when the item gets root or burned.

 

I'm trying for example to make a cookie recipe

Module MoreFood
{ 
  
Recipe Make Cookie Batter  
    {
	    Bowl,
	    Flour=2,
	    Butter;15,
	    Sugar=1,
	    Chocolate,
	    Egg,
	    Yeast,
	    Milk,
 
	    Result:CookieBatter,
	    Time:50.0,
	    Category:Cooking,
        OnGiveXP:Give10CookingXP,
    }  
  
  Imports { Base, }

Item CookieBatter
    {
        Weight	=	0.3,
	    Type	=	Normal,
	    DisplayName	=	Cookie Batter,
	    Icon	=	MF_CookieBatter,
    }

So after get the ingredients I have this new item  Item_CF_FruitCakeBatter.png ( Cookie Batter) , the next thing is making a Cookie dough Item_CF_XmassCookieDough.png

Recipe Make Cookie Dough  
    {
	    CookieBatter,
        Keep RollingPin,
 
	    Result:CookieDough,
	    Time:50.0,
	    Category:Cooking,
        OnGiveXP:Give5CookingXP,
    }  

item CookieDough
    {
	    Weight	=	0.3,
	    Type	=	Normal,
	    DisplayName	=	Cookie Dough,
	    Icon	=	MF_CookieDough,
    }

The problem here is that I can't get the bowl back when I write "Result: CookieDough;Bowl" , next thing is placing the dough in a baking pan Item_CF_XmassCookieTray.png

    recipe Make Baking Tray With Cookie Dough  
	{
	    BakingTray,
        CookieDough,
 
	    Result:BakingTrayCookieDough,
	    Time:50.0,
	    Category:Cooking,
            OnGiveXP:Give2CookingXP,
    }

    item BakingTrayCookieDough
    {
	    Type	=	Food,
	    DisplayName	=	Baking Tray With Cookie Dough,
	    Icon	=	MF_BakingTrayCookieDough,
	    ReplaceOnCooked   = MF.BakingTrayCookieDone,
	    IsCookable	=	TRUE,
	    MinutesToCook	=	20,
	    MinutesToBurn	=	40,
    }	

Here is where happen the most of the problem, when I put this on an oven after reach the cooking time the item disapears and it says "ItemContainer.Additem: can't find MF.BakingTrayCookie" but the " BakingTrayCookie" is in the item script. My head is almost to blow up hahaha

 

Now what happens when you decide to use a metal cookie mold  Item_CF_CookieMetalMold.png  to place the dough in the baking tray? Item_CF_XmassCookieTray.png without burning them Item_CF_XmassCookieTrayOverdone.png

 

    recipe Make Baking Tray With Cookie Dough  
	{
	    Keep CookieMetalMold,
        Keep RollingPin,
        BakingTray,
        CookieDough,
 
	    Result:BakingTrayCookieDough,
	    Time:50.0,
	    Category:Cooking,
        OnGiveXP:Give10CookingXP,
    }

    item BakingTrayCookieDough
    {
	    Type	=	Food,
	    DisplayName	=	Baking Tray With Cookie Dough,
	    Icon	=	MF_BakingTrayCookieDough,
	    ReplaceOnCooked   = MF.BakingTrayCookieDone,
	    IsCookable	=	TRUE,
	    MinutesToCook	=	20,
	    MinutesToBurn	=	40,
    }	

Once it's done our cookies are ready Item_CF_XmassCookieTrayDone.png,but we need to take them back from the baking tray. I've try many ways to make a functional script without any success, it seems that the "Result: Base.BakingTray; MF.Cookies" can't be an action.  

 

    recipe Take Cookies from Baking Tray  
	{
	    BakingTrayCookieDone,
 
	    Result:BakingTray; MF.Cookies,
	    Time:10.0,
	    Category:Cooking,
        OnGiveXP:Give15CookingXP,
    }

Would someone please give me a hand? Item_CF_XmassCookies.png I want release this mod before Christmass...

Edited by Rodjah

Share this post


Link to post
Share on other sites

search for "oncreate" on recipes to return more than 1 item result from a recipe (i dunno if this is what you are looking for) i been away from modding for a while Lol, hope this helps

Share this post


Link to post
Share on other sites
8 hours ago, ShuiYin said:

search for "oncreate" on recipes to return more than 1 item result from a recipe (i dunno if this is what you are looking for) i been away from modding for a while Lol, hope this helps

Yeah I know that OnCreate could help, but It seems to be attached with lua... and I don't understand that well.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...