inferjus4 Posted May 27, 2019 Share Posted May 27, 2019 What do I have to add to make recipe available only to one specific character? Link to comment https://forums.kleientertainment.com/forums/topic/106774-how-to-make-recipe-exclusive-to-specific-character/ Share on other sites More sharing options...
K1NGT1GER609 Posted June 5, 2019 Share Posted June 5, 2019 eh just copying and pasting a previous post I did, cause why not. Anyways to make a recipe only accessable to the modded character is simple as putting the recipe code in the character lua, under the main function where all his stats are like so: local fn = function(inst) --main character function local armor_device = Recipe("customhatimade", { Ingredient("purplegem", 1), Ingredient("goldnugget",10) }, RECIPETABS.SCIENCE, {SCIENCE=2}) armor_device.atlas = "images/inventoryimages/customhatimade.xml" inst.components.health:SetMaxHealth(200) --reference on where the code goes inst.components.hunger:SetMax(200) inst.components.sanity:SetMax(200) end If the mod crashes when you do this you might need this in the modmain: local TECH = GLOBAL.TECH local Ingredient = GLOBAL.Ingredient local RECIPETABS = GLOBAL.RECIPETABS local require = GLOBAL.require local STRINGS = GLOBAL.STRINGS local resolvefilepath = GLOBAL.resolvefilepath local ACTIONS = GLOBAL.ACTIONS local Action = GLOBAL.Action Link to comment https://forums.kleientertainment.com/forums/topic/106774-how-to-make-recipe-exclusive-to-specific-character/#findComment-1204917 Share on other sites More sharing options...
inferjus4 Posted June 8, 2019 Author Share Posted June 8, 2019 (edited) On 5.06.2019 at 3:09 AM, K1NGT1GER609 said: snip What if I would want to make recipe exclusive for original, not modded character? Edited June 8, 2019 by inferjus4 Link to comment https://forums.kleientertainment.com/forums/topic/106774-how-to-make-recipe-exclusive-to-specific-character/#findComment-1207007 Share on other sites More sharing options...
K1NGT1GER609 Posted June 9, 2019 Share Posted June 9, 2019 (edited) Hmmm dam I use to be good at this but ill give it a try.... AddComponentPostInit("builder", function(Builder, inst) --local addsomerecipe = Builder:AddRecipe --function Builder:AddRecipe(rec) if inst.prefab == "wilson" then local armor_device = Recipe("customhatimade", { Ingredient("purplegem", 1), Ingredient("goldnugget",10) }, RECIPETABS.SCIENCE, {SCIENCE=2}) armor_device.atlas = "images/inventoryimages/customhatimade.xml" end end end) can't remember if the notes are right or what else I have to include, been too long. Edited June 9, 2019 by K1NGT1GER609 Link to comment https://forums.kleientertainment.com/forums/topic/106774-how-to-make-recipe-exclusive-to-specific-character/#findComment-1207372 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