Jump to content

Recommended Posts

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

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 :shock: 

  • Like 1

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 by FurryEskimo
  • GL Happy 1

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.

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