kinyoshi Posted July 27, 2013 Share Posted July 27, 2013 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 More sharing options...
EreWeGo Posted July 27, 2013 Share Posted July 27, 2013 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);endand, 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 More sharing options...
kinyoshi Posted July 27, 2013 Author Share Posted July 27, 2013 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);endand, 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 ,. I think I can get something to work, I hope Link to comment Share on other sites More sharing options...
7Roses Posted July 30, 2013 Share Posted July 30, 2013 and what if you just changed the Jar's item type to item? it isn't really a food item as you won't eat it directly (would you?) Link to comment Share on other sites More sharing options...
kinyoshi Posted July 30, 2013 Author Share Posted July 30, 2013 and what if you just changed the Jar's item type to item? it isn't really a food item as you won't eat it directly (would you?) The jars type is item, you use that to get the food item. Link to comment 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