Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

shaochen

How to modify the cookbook?

Recommended Posts

shaochen    0

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?

Share this post


Link to post
Share on other sites
MidrealmDM    104

I had a similar problem here

http://forums.kleientertainment.com/topic/35617-cookpot-recipies/

with creating new recipies, apparently you can't use prepared foods lua and

have to work around -

 

for a solution I was pointed to this

http://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.

Share this post


Link to post
Share on other sites
squeek    236

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.

Share this post


Link to post
Share on other sites
shaochen    0

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.

Share this post


Link to post
Share on other sites
MidrealmDM    104

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 ?

Share this post


Link to post
Share on other sites
shaochen    0

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.

Share this post


Link to post
Share on other sites
MidrealmDM    104

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.

 

Share this post


Link to post
Share on other sites
squeek    236

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)

Share this post


Link to post
Share on other sites
shaochen    0

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~

Share this post


Link to post
Share on other sites