An Actual Ghoul Posted December 21, 2020 Share Posted December 21, 2020 Hi, I would like some help with creating a sanity aura for a character that I am currently making but, I think I screwed the order wrong or something. I'm not entirely the best at coding so yeah (it's gonna look a bit ugly). -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "mizukii.tex" ) end local function OnSanityDelta(inst, data) CurrentSanity = inst.components.sanity:GetPercent() if inst.sleepingbag == nil then if CurrentSanity <= 0.15 then inst.components.sanityaura.aura = TUNING.MIZUKII_AURARATE * 0 elseif CurrentSanity <= 0.5 then inst.components.sanityaura.aura = TUNING.MIZUKII_AURARATE * 0.5 else inst.components.sanityaura.aura = TUNING.MIZUKII_AURARATE end else inst.components.sanityaura.aura = TUNING.MIZUKII_AURARATE * 2 end end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- Set starting inventory inst.starting_inventory = start_inv[TheNet:GetServerGameMode()] or start_inv.default --Sanity Aura inst:AddComponent("sanityaura") inst.components.sanityaura.max_distsq = TUNING.MIZUKII_AURASIZE inst.components.sanityaura.aura = TUNING.MIZUKII_AURARATE inst.components.sanityaura.fallofffn = Mizukii_aurafallofffn -- choose which sounds this character will play inst.soundsname = "willow" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(135) inst.components.hunger:SetMax(155) inst.components.sanity:SetMax(200) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = .75 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1.15 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload end return MakePlayerCharacter("mizukii", prefabs, assets, common_postinit, master_postinit, prefabs) Whenever I try and test this character in-game, the game won't load at all so yeah, i definitely scrwed something up lol. Any help with this coding mess I have created would be much appreciated. Link to comment Share on other sites More sharing options...
DecDuck Posted December 22, 2020 Share Posted December 22, 2020 I can’t see anything wrong with the code straight away. Is there an error or? Have you set the values in TUNING? Link to comment Share on other sites More sharing options...
An Actual Ghoul Posted December 23, 2020 Author Share Posted December 23, 2020 No, I haven't. Would that be the problem? There is an error when I left the code like this though, it was taking an insanely long time for me to load into the game after I selected my character when I still had the sanity aura code. Link to comment Share on other sites More sharing options...
An Actual Ghoul Posted December 23, 2020 Author Share Posted December 23, 2020 Yeah, after I select my character and when I am loading into the world, it just stays on the loading screen forever Link to comment Share on other sites More sharing options...
DecDuck Posted December 24, 2020 Share Posted December 24, 2020 That usually means something is wrong with the character. There may be an error in the log? That may show us the issue. How to get logs: Open DST, go to the world that you were testing in. Above the delete button, there is an 'Open Cluster_X' button, click that. Then go into Master, and then open the log. Check for any errors 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