HUGHESMI Posted May 1, 2022 Share Posted May 1, 2022 Is it possible to change the amount of sanity restored when prototyping a crafting recipe, and if so, how would I go about that? Link to comment https://forums.kleientertainment.com/forums/topic/139825-questions-regarding-sanity-reward-for-prototyping/ Share on other sites More sharing options...
-LukaS- Posted May 1, 2022 Share Posted May 1, 2022 It is possible. All you need to do is edit this builder function: function Builder:UnlockRecipe(recname) local recipe = GetValidRecipe(recname) if recipe ~= nil and not recipe.nounlock then --print("Unlocking: ", recname) if self.inst.components.sanity ~= nil then self.inst.components.sanity:DoDelta(TUNING.SANITY_MED) end self:AddRecipe(recname) self.inst:PushEvent("unlockrecipe", { recipe = recname }) end end To do that you need to put this in your modmain.lua: AddComponentPostInit("builder", function(component) component.UnlockRecipe = function(self, recname) local recipe = GLOBAL.GetValidRecipe(recname) if recipe and not recipe.nounlock then if self.inst.components.sanity then self.inst.components.sanity:DoDelta("your_value") end self:AddRecipe(recname) self.inst:PushEvent("unlockrecipe", { recipe = recname }) end end end) Link to comment https://forums.kleientertainment.com/forums/topic/139825-questions-regarding-sanity-reward-for-prototyping/#findComment-1565918 Share on other sites More sharing options...
HUGHESMI Posted May 1, 2022 Author Share Posted May 1, 2022 Awesome, thanks for the help! Link to comment https://forums.kleientertainment.com/forums/topic/139825-questions-regarding-sanity-reward-for-prototyping/#findComment-1566019 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