FurryEskimo Posted August 22, 2020 Share Posted August 22, 2020 (edited) I have a custom recipe and it seems to work fine, but I just realized, I don't seem to get a research bonus for building the item the first time. Do I have to add that somewhere? local Recipe = GLOBAL.Recipe --(Test code) local RECIPETABS = GLOBAL.RECIPETABS local TECH = GLOBAL.TECH local ice_den = Recipe("ice_den",{ Ingredient("twigs", 4), Ingredient("cutgrass", 2), Ingredient("ice", 6) }, RECIPETABS.SURVIVAL, TECH.SCIENCE_ONE, "ice_den_placer", nil, nil, nil, "furryeskimo") --Unsure what these 'nils' are used for yet. ice_den.atlas = "images/inventoryimages/ice_den.xml" Edited August 22, 2020 by FurryEskimo Link to comment https://forums.kleientertainment.com/forums/topic/121170-custom-recipe-with-research-bonus/ Share on other sites More sharing options...
krylincy Posted August 22, 2020 Share Posted August 22, 2020 Instead of calling the "Recipe" function you should use the "AddRecipe" function ("Warning: function Recipe in modmain is deprecated, please use AddRecipe") And if you wonder what parameters you pass, here is the recipe class that recive your data Recipe = Class(function(self, name, ingredients, tab, level, placer_or_more_data, min_spacing, nounlock, numtogive, builder_tag, atlas, image, testfn, product, build_mode, build_distance) you add a nil value to tell the class, that this value is not set. you can not skip them because you need to keep up with the order. if you wanna pass the last param you have "builder_tag" but eg. no min_spacing then it looks like your code. i hope the addrecipe function will solve your problem, i never noticed if my custom recipes give me the bonus or not 1 Link to comment https://forums.kleientertainment.com/forums/topic/121170-custom-recipe-with-research-bonus/#findComment-1365219 Share on other sites More sharing options...
FurryEskimo Posted August 22, 2020 Author Share Posted August 22, 2020 (edited) Yep, that seems to have worked! Literally just added the word 'Add' and it's working, haha. I'll be honest though, I only half understand what the rest of these values are for. Far as I can tell, things like this structure's appearance, mini-map icon, etc are all effectively defined inside its own file, and the build distance seems useless, since the player currently walks to the place to build, and builds. The tent can only be built by this character, and while I may change that, for now it's character locked. Edited August 22, 2020 by FurryEskimo 1 Link to comment https://forums.kleientertainment.com/forums/topic/121170-custom-recipe-with-research-bonus/#findComment-1365233 Share on other sites More sharing options...
krylincy Posted August 22, 2020 Share Posted August 22, 2020 hey great =) if you are interested in the values, you can take a look recipe.lua or recipes.lua in the main folder of the scripts (C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\databundles). there are the functions defined and all recipes. and yes, you add the placer image for that recipe and a builder tag to handle it. Link to comment https://forums.kleientertainment.com/forums/topic/121170-custom-recipe-with-research-bonus/#findComment-1365258 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