Demonskull Posted January 5, 2021 Share Posted January 5, 2021 So, I'm trying to make a character who can read books for sanity. Ideally, this would be sanity over time, rather than instant. The problem I'm having is that the code, even when copied directly from Wurt, doesn't seem to work? Here's my code: Spoiler local function peruse_brimstone(inst) inst.components.sanity:DoDelta(TUNING.SANITY_HUGE) end local function peruse_birds(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end local function peruse_tentacles(inst) inst.components.sanity:DoDelta(TUNING.SANITY_HUGE) end local function peruse_sleep(inst) inst.components.sanity:DoDelta(TUNING.SANITY_LARGE) end local function peruse_gardening(inst) inst.components.sanity:DoDelta(TUNING.SANITY_LARGE) end local function peruse_horticulture(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end local function peruse_silviculture(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end Compared to Wurt's: Spoiler local function peruse_brimstone(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end local function peruse_birds(inst) inst.components.sanity:DoDelta(TUNING.SANITY_HUGE) end local function peruse_tentacles(inst) inst.components.sanity:DoDelta(TUNING.SANITY_HUGE) end local function peruse_sleep(inst) inst.components.sanity:DoDelta(TUNING.SANITY_LARGE) end local function peruse_gardening(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end local function peruse_horticulture(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end local function peruse_silviculture(inst) inst.components.sanity:DoDelta(-TUNING.SANITY_LARGE) end And I also added this code, but it didn't fix the issue: Spoiler local master_postinit = function(inst) --[Removed irrelevant code] inst.peruse_brimstone = peruse_brimstone inst.peruse_birds = peruse_birds inst.peruse_tentacles = peruse_tentacles inst.peruse_sleep = peruse_sleep inst.peruse_gardening = peruse_gardening inst.peruse_horticulture = peruse_horticulture inst.peruse_silviculture = peruse_silviculture Wurt's copy of the code: Spoiler local function master_postinit(inst) --[Removed irrelevant code] inst.peruse_brimstone = peruse_brimstone inst.peruse_birds = peruse_birds inst.peruse_tentacles = peruse_tentacles inst.peruse_sleep = peruse_sleep inst.peruse_gardening = peruse_gardening inst.peruse_horticulture = peruse_horticulture inst.peruse_silviculture = peruse_silviculture Does anyone know how to fix this issue? Link to comment https://forums.kleientertainment.com/forums/topic/125757-is-there-a-way-to-make-books-readable-by-custom-characters/ Share on other sites More sharing options...
Thomas_klei Posted January 5, 2021 Share Posted January 5, 2021 --inst:AddComponent("reader")? or inst:AddTag("aspiring_bookworm") Link to comment https://forums.kleientertainment.com/forums/topic/125757-is-there-a-way-to-make-books-readable-by-custom-characters/#findComment-1413593 Share on other sites More sharing options...
Demonskull Posted January 5, 2021 Author Share Posted January 5, 2021 17 minutes ago, thomas4846 said: --inst:AddComponent("reader")? or inst:AddTag("aspiring_bookworm") That did it, thank you! I guess when I wrote this code I didn't take an in depth enough look at Wurt's prefab. For future readers, if there are any: The first line enables the character to read books like Wickerbottom, putting both together enables reading like Wurt. Link to comment https://forums.kleientertainment.com/forums/topic/125757-is-there-a-way-to-make-books-readable-by-custom-characters/#findComment-1413597 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