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 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 Share on other sites More sharing options...
inferjus4 Posted June 8, 2019 Author Share Posted June 8, 2019 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? Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted June 9, 2019 Share Posted June 9, 2019 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.