zUsername Posted February 29, 2016 Share Posted February 29, 2016 (edited) I have this code: local specialtyfoods = { sweetpotatosouffle = { test = function(cooker, names, tags) return (names.carrot and names.carrot == 2) and tags.egg and tags.egg >= 2 end, priority = 30, foodtype = FOODTYPE.VEGGIE, health = TUNING.HEALING_MED, hunger = TUNING.CALORIES_LARGE, perishtime = TUNING.PERISH_MED, sanity = TUNING.SANITY_MED, cooktime = 2, }, } Then I use this code to add recipe: for k,v in pairs(specialtyfoods) do v.name = k v.weight = v.weight or 1 v.priority = v.priority or 0 AddCookerRecipe("portablecookpot", v) end But the code above not work, if I want it to work I must change "portablecookpot" to "cookpot". But this code below works: local foods = require("preparedfoods") for k,recipe in pairs (foods) do AddCookerRecipe("portablecookpot", recipe) end So any ideas? Thanks you. Edited March 1, 2016 by zUsername Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/ Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 Bump. Anyone ? Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728730 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 On 29. 2. 2016 at 6:21 AM, zUsername said: But the code above not work, if I want it to work I must change "portablecookpot" to "cookpot". I haven't tried to add custom recipes or custom cookpot, so I have no idea what could possibly go wrong. Could you be more specific what is not working? Is it crashing at some point? Is the cooker not producing according to recipes? Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728734 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 Problem 1: The cooker not produce according to recipes. Problem 2: Food invisible on crock pot. But it's visible on ground. Here is my file. Can you take a look? Really thanks you @Muche [DST]Warly.zip Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728750 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 (edited) All my testing was done using sweetpotatosouffle (i.e. 2*carrot+2*egg) on locally hosted game. With enabled SmarterCrockpot mod, the result was indeed not as expected (ratatouille). With disabled SmartCrockpot mod, the result was sweetpotatosouffle. Following advice in , I have renamed stuff in sweetpotatosouffle.scml (which I got from anim/sweetpotatosouffle.zip using krane tool) - all symbol0 to sweetpotatosouffle, plus renamed files and folders as appropriate (I guess not all of them need to be named the same, I just didn't experiment which ones are needed). The cooked sweetpotatosouffle did appear on the portablecookpot, although it was not centered; I guess the pivot point will have to be moved. There was also another issue: loading the game with cooked sweetpotatosouffle left on the cooker, the image was not visible, because the loading of the cooker was executed before the games started (i.e. before mod's GamePostInit), thus recipe was not yet added. Moving AddCookerRecipes out of recipepostinit fixed that. Edited March 1, 2016 by Muche Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728783 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 (edited) 56 minutes ago, Muche said: All my testing was done using sweetpotatosouffle (i.e. 2*carrot+2*egg) on locally hosted game. With enabled SmarterCrockpot mod, the result was indeed not as expected (ratatouille). With disabled SmartCrockpot mod, the result was sweetpotatosouffle. Following advice in , I have renamed stuff in sweetpotatosouffle.scml (which I got from anim/sweetpotatosouffle.zip using krane tool) - all symbol0 to sweetpotatosouffle, plus renamed files and folders as appropriate (I guess not all of them need to be named the same, I just didn't experiment which ones are needed). The cooked sweetpotatosouffle did appear on the portablecookpot, although it was not centered; I guess the pivot point will have to be moved. There was also another issue: loading the game with cooked sweetpotatosouffle left on the cooker, the image was not visible, because the loading of the cooker was executed before the games started (i.e. before mod's GamePostInit), thus recipe was not yet added. Moving AddCookerRecipes out of recipepostinit fixed that. How to I change symbol0 to food name? I'm open sweetpotatosouffle.scml with Spriter and I can't find symbol0. Or I have to change symbol0 in anim.bin and build.bin with hex editor?? Edited March 1, 2016 by zUsername Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728797 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 3 minutes ago, zUsername said: Should I change symbol0 in anim.bin or build.bin or both ? Well, I didn't rename them in the bin files, I renamed it in the scml file which then autocompiler took and produced anim zip file. Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728800 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 Just now, Muche said: Well, I didn't rename them in the bin files, I renamed it in the scml file which then autocompiler took and produced anim zip file. Are you using Spriter to open scml file ?? Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728801 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 I did use Spriter to change the pivot point. I haven't yet learned how to use it properly, so I did renaming directly in the scml file. Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728803 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 Just now, Muche said: I did use Spriter to change the pivot point. I haven't yet learned how to use it properly, so I did renaming directly in the scml file. Â Found it. Thanks you very much. I'll try now and feedback you later. Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728804 Share on other sites More sharing options...
SenL Posted March 1, 2016 Share Posted March 1, 2016 When you fixed/figured this out, can you post a quick "how to" or tutorial? I tried myself awhile back and couldn't get it -- same issue:Â it's invisible etc. Thanks. Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728813 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 1 hour ago, SenL said: When you fixed/figured this out, can you post a quick "how to" or tutorial? I tried myself awhile back and couldn't get it -- same issue:Â it's invisible etc. Thanks. Open ,scml file with Notepad++Â then look for what I did "--this" . Make sure it same name. <?xml version="1.0" encoding="UTF-8"?> <spriter_data scml_version="1.0" generator="BrashMonkey Spriter" generator_version="b5"> <folder id="0" name="freshfruitcrepes"> -- this <file id="0" name="freshfruitcrepes-0.png" width="200" height="116" pivot_x="0.541248" pivot_y="0.509918"/> </folder> <entity id="0" name="freshfruitcrepes"> -- this <animation id="0" name="idle" length="34"> <mainline> <key id="0" time="0"> <object_ref id="0" name="freshfruitcrepes" folder="0" file="0" abs_x="0" abs_y="0" abs_pivot_x="0.541248" abs_pivot_y="0.509918" abs_angle="0" abs_scale_x="1" abs_scale_y="1" abs_a="1" timeline="0" key="0" z_index="1"/> --this </key> </mainline> <timeline id="0" name="freshfruitcrepes"> --this <key id="0" time="0" spin="1"> <object folder="0" file="0" x="2" y="4.799" scale_x="1" scale_y="1" angle="0" /> </key> </timeline> </animation> </entity> </spriter_data> Â Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728840 Share on other sites More sharing options...
zUsername Posted March 1, 2016 Author Share Posted March 1, 2016 2 hours ago, Muche said: I did use Spriter to change the pivot point. I haven't yet learned how to use it properly, so I did renaming directly in the scml file. With your help everything work fine for now but I'm have also another issue. If I use: AddCookerRecipe("cookpot", sweetpotatosouffle_recipe). Food on Portable Cookpot will invisible and the Food on Cookpot will visible. Any ideas? @Muche [DST]Warly.rar Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728845 Share on other sites More sharing options...
Muche Posted March 1, 2016 Share Posted March 1, 2016 (edited) I didn't see anything unusual. With warly_recipes option set to No the cookpot produced sweetpotatosouffle and it was visible on cookpot (and invisible on portablecookpot, if left on it previously). With warly_recipes option set to Yes the portablecookpot produced sweetpotatosouffle and it was visible on portablecookpot (and invisible on cookpot, if left on it previously). Using AddCookerRecipe in modmain adds the recipe for specified cooker and marks the recipe as mod recipe, so prefabs/cookpot.lua|ShowProduct function can distinguish between core and mod recipes. Edited March 1, 2016 by Muche Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-728863 Share on other sites More sharing options...
zUsername Posted March 2, 2016 Author Share Posted March 2, 2016 16 hours ago, Muche said: I didn't see anything unusual. With warly_recipes option set to No the cookpot produced sweetpotatosouffle and it was visible on cookpot (and invisible on portablecookpot, if left on it previously). With warly_recipes option set to Yes the portablecookpot produced sweetpotatosouffle and it was visible on portablecookpot (and invisible on cookpot, if left on it previously). Using AddCookerRecipe in modmain adds the recipe for specified cooker and marks the recipe as mod recipe, so prefabs/cookpot.lua|ShowProduct function can distinguish between core and mod recipes. Really thanks you @Muche Link to comment https://forums.kleientertainment.com/forums/topic/64933-help-custom-foods-recipe-for-custom-cookpot/#findComment-729095 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now