Goregonzola Posted December 6, 2020 Share Posted December 6, 2020 (edited) Hey-ho! I would like to make my custom character change it's certain textures based on his Sanity level - similarly as Wolfgang does, but without any game/stat changing effect. How should the coding and the image file arrangement look like? Thanks in advance! Edited December 7, 2020 by BillTheCipher Link to comment https://forums.kleientertainment.com/forums/topic/124488-solved-how-can-i-change-a-characters-appearance-based-on-its-stat-level/ Share on other sites More sharing options...
Yakuzashi Posted December 6, 2020 Share Posted December 6, 2020 Howdy! Inside of CHARACTERNAMEHERE.lua goes: Quote local assets Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber1.zip" ), Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber2.zip" ), Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber3.zip" ), Quote somewhere below local assets but not inside master_postinit local function changemymind(inst) local sanity = inst.components.sanity.current if inst:HasTag("playerghost") then return end if inst.components.health:IsDead() then return end -- stage I (0-50 sanity) if sanity <= 50 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber1") end -- stage II (51-100 sainity) if sanity >= 51 and sanity <= 100 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber2") end -- stage III (over 100 sanity) if sanity >= 101 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber3") end end Quote master_posinit inst:ListenForEvent("sanitydelta", changemymind) If you have any questions or you will encounter any poroblems, let me know and I will try to fix my mistakes. Cheers! 1 Link to comment https://forums.kleientertainment.com/forums/topic/124488-solved-how-can-i-change-a-characters-appearance-based-on-its-stat-level/#findComment-1401897 Share on other sites More sharing options...
Goregonzola Posted December 6, 2020 Author Share Posted December 6, 2020 @Yakuzashi You're a god, friend. I'll try it out in the next few days. 1 Link to comment https://forums.kleientertainment.com/forums/topic/124488-solved-how-can-i-change-a-characters-appearance-based-on-its-stat-level/#findComment-1401904 Share on other sites More sharing options...
Goregonzola Posted December 7, 2020 Author Share Posted December 7, 2020 (edited) @Yakuzashi It works! I love you Edited December 7, 2020 by BillTheCipher 2 Link to comment https://forums.kleientertainment.com/forums/topic/124488-solved-how-can-i-change-a-characters-appearance-based-on-its-stat-level/#findComment-1402171 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