Luroshard Posted May 30, 2017 Share Posted May 30, 2017 (edited) After almost a dozen days, I finished a character to near completion (with the exception of the speaking script) I added inst:RemoveTag("scarytoprey") + sanity and damage taken for killing rabbits and various other prey Now I've realized that I can drop a trap ontop of a rabbit, take him out, and murder him, with no penalty. (the eating part is penalized though) I've searched around to find a post made by @IronHunter which involved a sanity penalty for crafting anything in general. I'd rather specify which items crafted penalize this character. Specifically traps, but other things later down the line. If reasonable, penalties for placing a trap would be swell! Current code is Edited May 31, 2017 by Luroshard SOLVED Link to comment Share on other sites More sharing options...
Lumina Posted May 30, 2017 Share Posted May 30, 2017 Also you will probably need a tag somewhere, to ensure only your character lose sanity when doing a trap, not all character. But i can't help more. Link to comment Share on other sites More sharing options...
IronHunter Posted May 31, 2017 Share Posted May 31, 2017 Instead of listening for "consumeingredients" which is called for all recipes you could listen for "builditem" which uses data (item = prod, recipe = recipe, skin = skin) I don't really have access to all my modding tools, but it should be a simple enough to edit from here. Spoiler inst:ListenForEvent("builditem", function(inst, data) if data.item.prefab == "trap" then inst.components.sanity:DoDelta(-15) end end) Depending on how many items you want to make have this penalty you could do a array to store their values so you don't have to make as many if statements. Spoiler inst:ListenForEvent("builditem", function(inst, data) local traps = {trap = true, birdtrap = true, beemine = true, trap_teeth = true} if traps[data.item.prefab] then inst.components.sanity:DoDelta(-15) end end) Cheers Link to comment 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