Jump to content

Recommended Posts

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.

Edited by MidrealmDM

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 by squeek

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 ?

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.

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 by squeek

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~

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