Jump to content

the creation of food and xp


kinyoshi

Recommended Posts

I'm having a little trouble with the Spices mod, and all of the food mods I have made and working on. When you get a food item out of a container, you gain cooking xp. I can understand gaining xp when making food, but getting a pickle out of a jar gains xp.. Any ideas how to stop it?

Link to comment
Share on other sites

Hey kinyoshi, I don't know much about modding etc, so probably haven't got any ideas on how to stop this, but I think I can see why it happens:

 

In the XpUpdate.lua in the XPSystem folder, it appears you get XP for crafting anything, and if the resulting item is classed as "Food", your cooking XP will be increased:

-- get xp when you craft somethingxpUpdate.onMakeItem = function(item, resultItem, recipe)if instanceof(resultItem, "Food") thengetPlayer():getXp():AddXP(Perks.Cooking, 3);end

and, an example of some code from your mod:

recipe Get Some Candied Ginger {    KMSmallMasonJarCandiedGinger,    Result:KMCandiedGinger,    Time:50.0,

So, you're "creating" the new food item "KMCandiedGinger" from "KMSmallMasonJarCandiedGinger", and I guess as the "KMCandiedGinger" is a new food item, you gain XP...

 

Not sure how you could stop this - no doubt some of the other modders out there will have a better idea, (and probably point and laugh at my ridiculous attempt at an explanation! :) )

 

 

 

Link to comment
Share on other sites

Hey kinyoshi, I don't know much about modding etc, so probably haven't got any ideas on how to stop this, but I think I can see why it happens:

 

In the XpUpdate.lua in the XPSystem folder, it appears you get XP for crafting anything, and if the resulting item is classed as "Food", your cooking XP will be increased:

-- get xp when you craft somethingxpUpdate.onMakeItem = function(item, resultItem, recipe)if instanceof(resultItem, "Food") thengetPlayer():getXp():AddXP(Perks.Cooking, 3);end

and, an example of some code from your mod:

recipe Get Some Candied Ginger {    KMSmallMasonJarCandiedGinger,    Result:KMCandiedGinger,    Time:50.0,

So, you're "creating" the new food item "KMCandiedGinger" from "KMSmallMasonJarCandiedGinger", and I guess as the "KMCandiedGinger" is a new food item, you gain XP...

 

Not sure how you could stop this - no doubt some of the other modders out there will have a better idea, (and probably point and laugh at my ridiculous attempt at an explanation! :) )

 

 

Thank you, I guess I should look at lua more :P,. I think I can get something to work, I hope

Link to comment
Share on other sites

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