shaochen Posted May 1, 2014 Share Posted May 1, 2014 I want to change the method of making "powcake" in my mod. I try to put the modified file "preparedfoods" in "mymod\scripts". But, when I enter into the game, I find nothing changed.How can I deal with it? Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/ Share on other sites More sharing options...
MidrealmDM Posted May 1, 2014 Share Posted May 1, 2014 (edited) I had a similar problem herehttp://forums.kleientertainment.com/topic/35617-cookpot-recipies/with creating new recipies, apparently you can't use prepared foods lua andhave to work around - for a solution I was pointed to thishttp://forums.kleientertainment.com/files/file/511-example-cookpot-fix/but I haven't been able to get that to work either, though that may be due to my own mistakes. Edited May 1, 2014 by MidrealmDM Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-467478 Share on other sites More sharing options...
squeek Posted May 1, 2014 Share Posted May 1, 2014 (edited) I want to change the method of making "powcake" in my mod. I try to put the modified file "preparedfoods" in "mymod\scripts". But, when I enter into the game, I find nothing changed. How can I deal with it?Modifying game files directly should never be done. See this post for how you could modify a recipe using the proper methods. Edited May 1, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-467858 Share on other sites More sharing options...
shaochen Posted May 2, 2014 Author Share Posted May 2, 2014 Modifying game files directly should never be done. See this post for how you could modify a recipe using the proper methods.Thanks a lot. However,it's too difficult for me. I decided to give up. Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-468363 Share on other sites More sharing options...
MidrealmDM Posted May 3, 2014 Share Posted May 3, 2014 Thanks a lot. However,it's too difficult for me. I decided to give up. honestly its not that difficult, it is just very particular about the way things must be done.It just takes determination and patience - and a lot of help from fellow modders in some cases. Rather than try to change an existing food, it is easier (and better) to just add a new one. What did you want in for your new food ? Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-469836 Share on other sites More sharing options...
shaochen Posted May 4, 2014 Author Share Posted May 4, 2014 honestly its not that difficult, it is just very particular about the way things must be done.It just takes determination and patience - and a lot of help from fellow modders in some cases. Rather than try to change an existing food, it is easier (and better) to just add a new one. What did you want in for your new food ?In fact, I want to change the healthvalue ,hungreyvalue and santivalue of"powcake".But, I failed after sveral attempts. Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-470015 Share on other sites More sharing options...
MidrealmDM Posted May 5, 2014 Share Posted May 5, 2014 In fact, I want to change the healthvalue ,hungreyvalue and santivalue of"powcake".But, I failed after sveral attempts. Dont try to change the existing food, instead just make your own. Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-471006 Share on other sites More sharing options...
squeek Posted May 5, 2014 Share Posted May 5, 2014 (edited) In fact, I want to change the healthvalue ,hungreyvalue and santivalue of"powcake".But, I failed after sveral attempts.Those values are not actually controlled by the recipe, they are controlled by the prefab (the recipe hunger/health/sanity settings are only used to set the values of the prefab at startup). To modify them, you'd want to use a PrefabPostInit like so: -- in modmain.luaAddPrefabPostInit("powcake", function(inst) inst.components.edible.healthvalue = 0 inst.components.edible.hungervalue = 0 inst.components.edible.sanityvalue = 0end) Edited May 5, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-471268 Share on other sites More sharing options...
shaochen Posted May 6, 2014 Author Share Posted May 6, 2014 Those values are not actually controlled by the recipe, they are controlled by the prefab (the recipe hunger/health/sanity settings are only used to set the values of the prefab at startup). To modify them, you'd want to use a PrefabPostInit like so: -- in modmain.luaAddPrefabPostInit("powcake", function(inst) inst.components.edible.healthvalue = 0 inst.components.edible.hungervalue = 0 inst.components.edible.sanityvalue = 0end)Thank you~ Link to comment https://forums.kleientertainment.com/forums/topic/35749-how-to-modify-the-cookbook/#findComment-471805 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